Don't make our anonymous blocks that wrap blocks inside inlines be containing blocks so that we get the right containing block direction per the CSS spec. (Bug 423306) r+sr=roc
authorL. David Baron <dbaron@dbaron.org>
Thu, 05 Jun 2008 16:06:34 -0700
changeset 15270 e30af58993281d85f149b15929f8f27c80f3f7bb
parent 15269 dd28fa11cb15b318dcb23382837d39e5397cf4ee
child 15271 3599b2ccdf5752869d726ae5b959b0f4c664ef11
push idunknown
push userunknown
push dateunknown
bugs423306
milestone1.9.1a1pre
Don't make our anonymous blocks that wrap blocks inside inlines be containing blocks so that we get the right containing block direction per the CSS spec. (Bug 423306) r+sr=roc
layout/generic/nsBlockFrame.cpp
layout/reftests/box-properties/reftest.list
--- a/layout/generic/nsBlockFrame.cpp
+++ b/layout/generic/nsBlockFrame.cpp
@@ -565,17 +565,25 @@ nsBlockFrame::GetAdditionalChildListName
   default:
     return nsnull;
   }
 }
 
 /* virtual */ PRBool
 nsBlockFrame::IsContainingBlock() const
 {
-  return PR_TRUE;
+  // The block wrappers we use to wrap blocks inside inlines aren't
+  // described in the CSS spec.  We need to make them not be containing
+  // blocks for the cases where we care about the 'direction' property
+  // of an element's containing block.
+  // Since the parent of such a block is either a normal block or
+  // another such pseudo, this shouldn't cause anything bad to happen.
+  nsIAtom *pseudoType = GetStyleContext()->GetPseudoType();
+  return pseudoType != nsCSSAnonBoxes::mozAnonymousBlock &&
+         pseudoType != nsCSSAnonBoxes::mozAnonymousPositionedBlock;
 }
 
 /* virtual */ PRBool
 nsBlockFrame::IsFloatContainingBlock() const
 {
   return PR_TRUE;
 }
 
--- a/layout/reftests/box-properties/reftest.list
+++ b/layout/reftests/box-properties/reftest.list
@@ -13,10 +13,10 @@
 == width-special-values-cell-auto.html width-special-values-cell-auto-ref.html
 == width-special-values-cell-fixed.html width-special-values-cell-fixed-ref.html
 == box-sizing-1.html box-sizing-1-ref.html
 == box-sizing-2.html box-sizing-2-ref.html
 == box-sizing-3.html box-sizing-1-ref.html
 == box-sizing-4.html box-sizing-4-ref.html
 == abspos-non-replaced-width-offset-margin.html abspos-non-replaced-width-offset-margin-ref.html
 == abspos-replaced-width-offset-margin.html abspos-replaced-width-offset-margin-ref.html
-fails == CSS21-t100303.xhtml CSS21-t100303-ref.xhtml # bug 423306
+== CSS21-t100303.xhtml CSS21-t100303-ref.xhtml
 == CSS21-t100303-simple.xhtml CSS21-t100303-ref.xhtml