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
--- 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