Closed Bug 1762439 Opened 2 years ago Closed 2 years ago

[wpt-sync] Sync PR 33455 - [FlexNG] Expand row cross size for fragmentation

Categories

(Core :: Layout, task, P4)

task

Tracking

()

RESOLVED FIXED
101 Branch
Tracking Status
firefox101 --- fixed

People

(Reporter: mozilla.org, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 33455 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/33455
Details from upstream follow.

Alison Maher <almaher@microsoft.com> wrote:

[FlexNG] Expand row cross size for fragmentation

Previously, for flex rows, when items expanded as a result of
fragmentation, we would only adjust the subsequent rows' offsets based
on the expansion amount. However, we also want to expand the row
block-size to allow items in that row to stretch to the newly expanded
size.

Because flex items in a row can break before, we couldn't implement
this in the same way as grid (i.e. by storing the results and
offsets and then adding them to the builder once all expansion is
handled). Otherwise, we could end up with a child break before added
to the builder before the previous items in the row had been added.

Instead, we need to abort layout and re-run with the updated row
block-sizes (using the newly added layout result status of
kNeedsRelayoutWithRowCrossSizeChanges and the newly added
RelayoutWithNewRowSizes() method).

Since we will re-layout as we go, we can no longer wait to detect
the row expansion until items have completed layout, but we need to
find the max row expansion in each fragmentainer as we go (and as
items cross the current row block-size). As such, we now calculate
row expansion without making use of NGFlexItem's
total_remaining_block_size (as we do for columns).

Because more than one row can expand per fragmentainer, we can avoid
aborting layout more than once by adjusting subsequent row offsets
as expansion is discovered and by keeping track of the expansion
of all rows in a given fragmentainer (there should only be at most two
row expansions at a time, though).

While testing, I had noticed a bug with how row expansion was handled
for items that broke before. We would previously adjust the offset
of all items in the row rather than just the offset of the item itself.
This is now fixed by not updating |line_output.item_offset_adjustment|
in this case.

Note: We will stop row expansion if the container's consumed block-size
hits the max to avoid infinite expansion. This keeps the following test
from timing out:
external/wpt/css/css-break/flexbox/flexbox-fragmentation-layout-001-crash.html

multi-line-row-flex-fragmentation-016.html was previously incorrect
since item stretching as a result of row expansion was not yet
implemented. The test is now updated to account for the new
behavior.

Bug: 660611
Change-Id: If4fca22d10a43052a2f0218333d3a74752762b79

Reviewed-on: https://chromium-review.googlesource.com/3561235
WPT-Export-Revision: 3e2593ad413c3dd738a4d9d8c1b4f7dd617cd0ba

Component: web-platform-tests → Layout
Product: Testing → Core
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → INVALID
Status: RESOLVED → REOPENED
Resolution: INVALID → ---

CI Results

Ran 0 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 6 tests

Status Summary

Firefox

PASS: 1
FAIL: 5

Chrome

PASS: 2
FAIL: 4

Safari

PASS: 1
FAIL: 5

Links

GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

/css/css-break/flexbox/multi-line-row-flex-fragmentation-016.html: FAIL (Chrome: FAIL, Safari: FAIL)
/css/css-break/flexbox/multi-line-row-flex-fragmentation-052.html: FAIL (Chrome: FAIL, Safari: FAIL)
/css/css-break/flexbox/multi-line-row-flex-fragmentation-053.html: FAIL (Chrome: FAIL, Safari: FAIL)
/css/css-break/flexbox/multi-line-row-flex-fragmentation-054.html: FAIL (Chrome: FAIL, Safari: FAIL)
/css/css-break/flexbox/single-line-row-flex-fragmentation-029.html: FAIL (Chrome: PASS, Safari: FAIL)

Pushed by wptsync@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/befd36dc602c
[wpt PR 33455] - [FlexNG] Expand row cross size for fragmentation, a=testonly
https://hg.mozilla.org/integration/autoland/rev/87f5e3b727ff
[wpt PR 33455] - Update wpt metadata, a=testonly
Status: REOPENED → RESOLVED
Closed: 2 years ago2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 101 Branch
You need to log in before you can comment on or make changes to this bug.