Closed Bug 2077691 Opened 1 month ago Closed 1 month ago

[wpt-sync] Sync PR 63216 - [line-clamp] Use the expected BFC offset in the LineClampAncestorChain

Categories

(Core :: Layout: Scrolling and Overflow, task, P4)

task

Tracking

()

RESOLVED FIXED
160 Branch
Tracking Status
firefox160 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

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

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

Andreu Botella <abotella@igalia.com> wrote:

[line-clamp] Use the expected BFC offset in the LineClampAncestorChain

Added in https://crrev.com/c/7566509, the LineClampAncestorChain is
a data structure used to compute the expected automatic block size of
a line-clamp container if we were to clamp at a given point, which is
used in order to line-clamp based on a height. It does this by storing
data for the current block box and its ancestors up to the line-clamp
container in an immutable single linked list.

One of the pieces of data the ancestor chain stores for each box is
its BFC offset. However, the ancestor chain for a box must be created
before any layout of its children, meaning that the BFC offset won't
be resolved at that point for any box other than the line-clamp
container itself.

Previously this was handled by having the BFC offset field be a
std::optional, by creating a replacement chain once the BFC offset
is known, and by assuming that if a descendant node resolves its BFC
offset, all nodes in the ancestor chain that don't have a BFC offset
must end up with the BFC offset we just resolved. Unfortunately, this
approach ended up having holes in cases where a BFC offset is resolved
without causing a relayout.

This patch instead refactors the ancestor chain so that it always
stores the expected BFC offset of each box, even if that expectation
is optimistic. It then also sets the
BlockLayoutAlgorithm::abort_when_bfc_block_offset_updated_ flag, to
make sure we relayout to invalidate the expectation.

This change regresses one WPT test, line-clamp-auto-045.html, but
this seems to be due to a preexisting issue when
abort_when_bfc_block_offset_updated_ is set, bug 568010387.

Bug: 40336192, 561613778
Change-Id: I1e5068b86e88b3b957235f18b5f5c383483bf997

Reviewed-on: https://chromium-review.googlesource.com/8501743
WPT-Export-Revision: 2b2c288350b939b337a0f26b81625531697d2152

Component: web-platform-tests → Layout: Scrolling and Overflow
Product: Testing → Core

CI Results

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

Total 305 tests

Status Summary

Firefox

OK : 1
PASS : 9[Gecko-linux2204-64-wayland-debug, Gecko-linux2204-64-wayland-opt] 11[Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt] 199[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview] 200[Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt] 202[Gecko-linux2404-64-debug, Gecko-linux2404-64-opt]
FAIL : 1[GitHub] 103[Gecko-linux2404-64-debug] 104[Gecko-linux2404-64-opt] 105[Gecko-windows11-64-25h2-debug] 106[Gecko-windows11-64-25h2-opt] 107[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview]
ERROR: 1

Chrome

PASS : 1

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

Status: NEW → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 160 Branch
You need to log in before you can comment on or make changes to this bug.