Bug 956046: Allow adjacent anonymous flex items if we've reordered items with the "order" property. r=dbaron

This commit is contained in:
Daniel Holbert 2014-01-08 14:37:13 -08:00
parent 7e5c00fb99
commit 84bbf5a65a
4 changed files with 47 additions and 2 deletions

View File

@ -1359,8 +1359,9 @@ nsFlexContainerFrame::SanityCheckAnonymousFlexItems() const
"but it isn't");
if (child->StyleContext()->GetPseudo() ==
nsCSSAnonBoxes::anonymousFlexItem) {
MOZ_ASSERT(!prevChildWasAnonFlexItem,
"two anon flex items in a row (shouldn't happen)");
MOZ_ASSERT(!prevChildWasAnonFlexItem || mChildrenHaveBeenReordered,
"two anon flex items in a row (shouldn't happen, unless our "
"children have been reordered with the 'order' property)");
nsIFrame* firstWrappedChild = child->GetFirstPrincipalChild();
MOZ_ASSERT(firstWrappedChild,

View File

@ -0,0 +1,15 @@
<!DOCTYPE html>
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<html>
<head>
<title>CSS Reftest Reference</title>
<link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com">
<meta charset="utf-8">
</head>
<body>
a ab bx x
</body>
</html>

View File

@ -0,0 +1,26 @@
<!DOCTYPE html>
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<html>
<head>
<title>CSS Test: Testing that we gracefully handle cases where two anonymous flex items become adjacent due to "order" reordering</title>
<link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com">
<link rel="help" href="http://www.w3.org/TR/css3-flexbox/#flex-items">
<link rel="match" href="flexbox-anonymous-items-1-ref.html">
<meta charset="utf-8">
<style>
.flexContainer {
display: flex;
}
</style>
</head>
<body>
<div class="flexContainer">
a a
<div style="order: 1">x x</div>
b b
</div>
</body>
</html>

View File

@ -1,3 +1,6 @@
# Tests for handling anonymous flex items
== flexbox-anonymous-items-1.html flexbox-anonymous-items-1-ref.html
# Tests for alignment of flex lines (align-content property)
== flexbox-align-content-horiz-1a.xhtml flexbox-align-content-horiz-1-ref.xhtml
== flexbox-align-content-horiz-1b.xhtml flexbox-align-content-horiz-1-ref.xhtml