Bug 973701: Check NS_FRAME_OUT_OF_FLOW state bit instead of IsAbsolutelyPositioned(), when excluding out-of-flow frames from being considered as flex items. r=mats

This commit is contained in:
Daniel Holbert 2014-03-04 11:08:54 -08:00
parent 554e5b8c75
commit 25bd4e0e40
5 changed files with 22 additions and 5 deletions

View File

@ -0,0 +1,5 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<body style="display: flex;">
<munderover xmlns="http://www.w3.org/1998/Math/MathML" style="position: absolute;" />
</body>
</html>

View File

@ -0,0 +1,6 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<body style="display: flex;">
<munderover xmlns="http://www.w3.org/1998/Math/MathML" style="position: absolute;" />
<munderover xmlns="http://www.w3.org/1998/Math/MathML" style="position: absolute;" />
</body>
</html>

View File

@ -525,4 +525,6 @@ test-pref(layout.css.sticky.enabled,true) load 915475.xhtml
load 943509-1.html
asserts(4-8) load 944909-1.html
test-pref(layout.css.sticky.enabled,true) load 949932.html
load 973701-1.xhtml
load 973701-2.xhtml
load outline-on-frameset.xhtml

View File

@ -1053,8 +1053,10 @@ FlexItem::FlexItem(nsIFrame* aChildFrame,
mAlignSelf(aChildFrame->StylePosition()->mAlignSelf)
{
MOZ_ASSERT(mFrame, "expecting a non-null child frame");
MOZ_ASSERT(!mFrame->IsAbsolutelyPositioned(),
"abspos child frames should not be treated as flex items");
MOZ_ASSERT(mFrame->GetType() != nsGkAtoms::placeholderFrame,
"placeholder frames should not be treated as flex items");
MOZ_ASSERT(!(mFrame->GetStateBits() & NS_FRAME_OUT_OF_FLOW),
"out-of-flow frames should not be treated as flex items");
SetFlexBaseSizeAndMainSize(aFlexBaseSize);
@ -1126,8 +1128,10 @@ FlexItem::FlexItem(nsIFrame* aChildFrame, nscoord aCrossSize)
MOZ_ASSERT(NS_STYLE_VISIBILITY_COLLAPSE ==
mFrame->StyleVisibility()->mVisible,
"Should only make struts for children with 'visibility:collapse'");
MOZ_ASSERT(!mFrame->IsAbsolutelyPositioned(),
"abspos child frames should not be treated as flex items");
MOZ_ASSERT(mFrame->GetType() != nsGkAtoms::placeholderFrame,
"placeholder frames should not be treated as flex items");
MOZ_ASSERT(!(mFrame->GetStateBits() & NS_FRAME_OUT_OF_FLOW),
"out-of-flow frames should not be treated as flex items");
}
nscoord

View File

@ -15,7 +15,7 @@ nsIFrame::IsFlexItem() const
{
return mParent &&
mParent->GetType() == nsGkAtoms::flexContainerFrame &&
!IsAbsolutelyPositioned();
!(GetStateBits() & NS_FRAME_OUT_OF_FLOW);
}
bool