From 9e024d5262a334964a1acd265d1a705af619ebef Mon Sep 17 00:00:00 2001 From: "bzbarsky%mit.edu" Date: Mon, 16 Apr 2007 05:55:42 +0000 Subject: [PATCH] The parent style context frame determination for an inner table should use the inner table's pseudo, not the outer table's. Bug 377603, r+sr=dbaron git-svn-id: svn://10.0.0.236/trunk@224565 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/generic/nsFrame.cpp | 13 ++++++--- .../layout/reftests/bugs/377603-1-ref.html | 24 +++++++++++++++++ mozilla/layout/reftests/bugs/377603-1.html | 27 +++++++++++++++++++ mozilla/layout/reftests/bugs/reftest.list | 1 + 4 files changed, 61 insertions(+), 4 deletions(-) create mode 100644 mozilla/layout/reftests/bugs/377603-1-ref.html create mode 100644 mozilla/layout/reftests/bugs/377603-1.html diff --git a/mozilla/layout/generic/nsFrame.cpp b/mozilla/layout/generic/nsFrame.cpp index d1fac274114..1618d3d2d8d 100644 --- a/mozilla/layout/generic/nsFrame.cpp +++ b/mozilla/layout/generic/nsFrame.cpp @@ -5463,10 +5463,15 @@ GetCorrectedParent(nsPresContext* aPresContext, nsIFrame* aFrame, if (!parent) { *aSpecialParent = nsnull; } else { - *aSpecialParent = - nsFrame::CorrectStyleParentFrame(parent, - aFrame->GetStyleContext()-> - GetPseudoType()); + nsIAtom* pseudo = aFrame->GetStyleContext()->GetPseudoType(); + // Outer tables are always anon boxes; if we're in here for an outer + // table, that actually means its the _inner_ table that wants to + // know its parent. So get the pseudo of the inner in that case. + if (pseudo == nsCSSAnonBoxes::tableOuter) { + pseudo = + aFrame->GetFirstChild(nsnull)->GetStyleContext()->GetPseudoType(); + } + *aSpecialParent = nsFrame::CorrectStyleParentFrame(parent, pseudo); } return NS_OK; diff --git a/mozilla/layout/reftests/bugs/377603-1-ref.html b/mozilla/layout/reftests/bugs/377603-1-ref.html new file mode 100644 index 00000000000..a87cdb7891d --- /dev/null +++ b/mozilla/layout/reftests/bugs/377603-1-ref.html @@ -0,0 +1,24 @@ + + + + + + + + + + +
+ + +
+ + +
+
+ + diff --git a/mozilla/layout/reftests/bugs/377603-1.html b/mozilla/layout/reftests/bugs/377603-1.html new file mode 100644 index 00000000000..e45672e5ebe --- /dev/null +++ b/mozilla/layout/reftests/bugs/377603-1.html @@ -0,0 +1,27 @@ + + + + + + + + + + +
+ + +
+ + +
+ +
+ + diff --git a/mozilla/layout/reftests/bugs/reftest.list b/mozilla/layout/reftests/bugs/reftest.list index a84d2ab7e9a..42a3c52f484 100644 --- a/mozilla/layout/reftests/bugs/reftest.list +++ b/mozilla/layout/reftests/bugs/reftest.list @@ -216,3 +216,4 @@ fails-if(MOZ_WIDGET_TOOLKIT=="cocoa") == 372037-1.html 372037-1-ref.html # bug 3 == 374038-2.xul 374038-2-ref.xul == 374193-1.xhtml about:blank fails == 376484-1.html 376484-1-ref.html +== 377603-1.html 377603-1-ref.html