From 85fb7d8a472defab5ed9cb12a068932c13f947c9 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Sun, 1 Mar 2009 10:16:29 -0500 Subject: [PATCH] Bug 480017. Suppress misplaced popups before we construct table pseudoframe parents. r+sr=roc --- layout/base/nsCSSFrameConstructor.cpp | 16 ++++++++-------- layout/reftests/bugs/480017-1-ref.html | 15 +++++++++++++++ layout/reftests/bugs/480017-1.html | 24 ++++++++++++++++++++++++ layout/reftests/bugs/reftest.list | 1 + 4 files changed, 48 insertions(+), 8 deletions(-) create mode 100644 layout/reftests/bugs/480017-1-ref.html create mode 100644 layout/reftests/bugs/480017-1.html diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp index 04c9c89589e2..111d266d664e 100644 --- a/layout/base/nsCSSFrameConstructor.cpp +++ b/layout/base/nsCSSFrameConstructor.cpp @@ -6634,6 +6634,14 @@ nsCSSFrameConstructor::ConstructFrameInternal(nsFrameConstructorState& aState, if (data->mBits & FCDATA_SUPPRESS_FRAME) { return NS_OK; } + +#ifdef MOZ_XUL + if ((data->mBits & FCDATA_IS_POPUP) && + aParentFrame->GetType() != nsGkAtoms::menuFrame && + !aState.mPopupItems.containingBlock) { + return NS_OK; + } +#endif /* MOZ_XUL */ } nsIFrame* adjParentFrame = aParentFrame; @@ -6669,14 +6677,6 @@ nsCSSFrameConstructor::ConstructFrameInternal(nsFrameConstructorState& aState, styleContext->GetStyleBackground(); } -#ifdef MOZ_XUL - if ((data->mBits & FCDATA_IS_POPUP) && - adjParentFrame->GetType() != nsGkAtoms::menuFrame && - !aState.mPopupItems.containingBlock) { - return NS_OK; - } -#endif /* MOZ_XUL */ - // Construct a page break frame for page-break-before, if needed, and // remember whether we need one for page-break-after. PRBool pageBreakAfter = diff --git a/layout/reftests/bugs/480017-1-ref.html b/layout/reftests/bugs/480017-1-ref.html new file mode 100644 index 000000000000..3cb305a14a3a --- /dev/null +++ b/layout/reftests/bugs/480017-1-ref.html @@ -0,0 +1,15 @@ + + + + + + + + + + + + +
First ColumnSecond Column
First ColumnSecond Column
+ + diff --git a/layout/reftests/bugs/480017-1.html b/layout/reftests/bugs/480017-1.html new file mode 100644 index 000000000000..d1dd33a0df72 --- /dev/null +++ b/layout/reftests/bugs/480017-1.html @@ -0,0 +1,24 @@ + + + +
+
+
+ First Column +
+
+ Second Column +
+
+
+
+ First Column +
+
+
+ Second Column +
+
+
+ + diff --git a/layout/reftests/bugs/reftest.list b/layout/reftests/bugs/reftest.list index beba24adc833..860d8f20a452 100644 --- a/layout/reftests/bugs/reftest.list +++ b/layout/reftests/bugs/reftest.list @@ -1094,3 +1094,4 @@ fails == 461512-1.html 461512-1-ref.html # Bug 461512 == 478811-4.html 478811-4-ref.html == 478956-1a.html 478956-1-ref.html == 478956-1b.html 478956-1-ref.html +== 480017-1.html 480017-1-ref.html