Closed Bug 1653266 Opened 3 months ago Closed 2 months ago

[wpt-sync] Sync PR 24627 - [FlexNG] Fix %-relpos for a grandchild of a flexbox.

Categories

(Core :: Layout: Flexbox, task, P4)

task

Tracking

()

RESOLVED FIXED
mozilla80
Tracking Status
firefox80 --- fixed

People

(Reporter: mozilla.org, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

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

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

Ian Kilpatrick <ikilpatrick@chromium.org> wrote:

[FlexNG] Fix %-relpos for a grandchild of a flexbox.

When we resolve %-based offsets for a relative position child, if its
parent is a flex-item we'll read the constraint-space used to generate
this fragment, and resolve the %-based offset using that block-size. I.e.
https://source.chromium.org/chromium/chromium/src/+/master:third_party/blink/renderer/core/layout/layout_box.cc;l=4521;drc=3f50460dcc4c426eb876cd0a1d2838eb35472e18?originalUrl=https:%2F%2Fcs.chromium.org%2F

However flex can have two passes, one without a fixed block-size, and one
with. If we can determine ahead of time that these would result in the
same fragment we'll hit the cache, but the constraint space would
be the one within the fixed block-size.

In other words, if a flex-item remained the same size between the
measure, and layout passes, a relative position grandchild would resolve
its %-based offsets incorrectly.

This patch introduces some logic from another patch current WIP:
https://chromium-review.googlesource.com/c/chromium/src/+/2214608
which got reverted for unrelated reasons.

Effectively if we have a %-based grandchild like this, we'll miss the
cache, meaning that when we later read the constraint space fixed
block-size, it'll resolve against the correct size.

Bug: 1106074
Change-Id: I5003e4c0903bda408c45f8fb608ad4106c8f22b0

Reviewed-on: https://chromium-review.googlesource.com/2302231
WPT-Export-Revision: 4b8aa16e511d84038d0d461e9c32a9cb562c1b3b

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

CI Results

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

Total 1 tests

Status Summary

Firefox

PASS: 1

Chrome

FAIL: 1

Safari

PASS: 1

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Pushed by wptsync@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d1621ac94545
[wpt PR 24627] - [FlexNG] Fix %-relpos for a grandchild of a flexbox., a=testonly
Status: NEW → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla80
You need to log in before you can comment on or make changes to this bug.