Bug 1270891 - Don't honor forced break properties when generating flex lines. r=dholbert

This behavior was based on the old spec. See the spec changes in
https://drafts.csswg.org/css-flexbox-1/#change-201409-algo-breaks

Differential Revision: https://phabricator.services.mozilla.com/D172697
This commit is contained in:
Ting-Yu Lin 2023-03-16 23:19:10 +00:00
Родитель 5d4827ead4
Коммит f0015a059f
5 изменённых файлов: 0 добавлений и 24 удалений

Просмотреть файл

@ -3964,7 +3964,6 @@ void nsFlexContainerFrame::GenerateFlexLines(
AddOrRemoveStateBits(NS_STATE_FLEX_NORMAL_FLOW_CHILDREN_IN_CSS_ORDER,
iter.ItemsAreAlreadyInOrder());
bool prevItemRequestedBreakAfter = false;
const bool useMozBoxCollapseBehavior =
StyleVisibility()->UseLegacyCollapseBehavior();
@ -3976,15 +3975,6 @@ void nsFlexContainerFrame::GenerateFlexLines(
continue;
}
// If we're multi-line and current line isn't empty, create a new flex line
// to satisfy the previous flex item's request or to honor "break-before".
if (!isSingleLine && !curLine->IsEmpty() &&
(prevItemRequestedBreakAfter ||
childFrame->StyleDisplay()->BreakBefore())) {
curLine = ConstructNewFlexLine();
prevItemRequestedBreakAfter = false;
}
const bool collapsed = childFrame->StyleVisibility()->IsCollapse();
aHasCollapsedItems = aHasCollapsedItems || collapsed;
@ -4034,12 +4024,6 @@ void nsFlexContainerFrame::GenerateFlexLines(
// Update the line's bookkeeping about how large its items collectively are.
curLine->AddLastItemToMainSizeTotals();
// Honor "break-after" if we're multi-line. If we have more children, we
// will create a new flex line in the next iteration.
if (!isSingleLine && childFrame->StyleDisplay()->BreakAfter()) {
prevItemRequestedBreakAfter = true;
}
itemIdxInContainer++;
}
}

Просмотреть файл

@ -1,2 +0,0 @@
[flexbox-break-request-horiz-001a.html]
expected: FAIL

Просмотреть файл

@ -1,2 +0,0 @@
[flexbox-break-request-horiz-001b.html]
expected: FAIL

Просмотреть файл

@ -1,2 +0,0 @@
[flexbox-break-request-vert-001a.html]
expected: FAIL

Просмотреть файл

@ -1,2 +0,0 @@
[flexbox-break-request-vert-001b.html]
expected: FAIL