Closed Bug 1864648 Opened 2 years ago Closed 2 years ago

[wpt-sync] Sync PR 43151 - Once content is added to a builder, break as normally.

Categories

(Core :: Layout, task, P4)

task

Tracking

()

RESOLVED FIXED
122 Branch
Tracking Status
firefox122 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

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

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

Morten Stenshorne <mstensho@chromium.org> wrote:

Once content is added to a builder, break as normally.

If the RequiresContentBeforeBreaking flag was set when initializing the
fragment builder, it was never set to false again. This was generally
unproblematic, since it only affected last-resort break opportunities,
which generally only occur at the beginning of a fragment (e.g. between
a container and its first child). However, in flex layout there may be a
last-resort break opportunity before any flex item that's flush with its
flex line, because that is seen as having no container separation.

Therefore, reset the RequiresContentBeforeBreaking flag once a child has
been added to the builder. That in itself is a simple fix, in
NGBoxFragmentBuilder::AddChild().

The rest of this CL is about keeping this mechanism working for
out-of-flow positioned elements. We now need to check the
RequiresContentBeforeBreaking state exactly when the out-of-flow
positioned element is found in the box tree, not when it's being laid
out. Doing it later, in NGOutOfFlowLayoutPart, is now too late, since
the flag may have been reset in the meantime, which would prevent us
from forcing OOFs to stay in the current fragmentainer when they should.
So store it directly in NGLogicalOutOfFlowPositionedNode when creating
it. Since these objects bubble up the parent chain as physical
fragments, NGPhysicalOutOfFlowPositionedNode also needs to store this.
Storing it in NGContainingBlock is no longer necessary, on the other
hand.

css/css-break/tall-content-inside-constrained-block-006.tentative.html
is a test for this.

Bug: 1500947
Change-Id: I3b60239b0bdac82477748b3e0a99daf074d7246d
Reviewed-on: https://chromium-review.googlesource.com/5029777
WPT-Export-Revision: 27a1c7008e47254fc16d1e19e29510d067d2b66f

Component: web-platform-tests → Layout
Product: Testing → Core

CI Results

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

Total 3 tests

Status Summary

Firefox

PASS: 3

Chrome

FAIL: 3

Safari

FAIL: 3

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Pushed by wptsync@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/a8872dc769f0 [wpt PR 43151] - Once content is added to a builder, break as normally., a=testonly
Pushed by wptsync@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d8bef5d2717f [wpt PR 43151] - Once content is added to a builder, break as normally., a=testonly
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 122 Branch
You need to log in before you can comment on or make changes to this bug.