Closed Bug 2092423 Opened 4 days ago Closed 2 days ago

[wpt-sync] Sync PR 64348 - [css-anchor-position] Relayout anchor-positioned elements on scroll end

Categories

(Core :: CSS Parsing and Computation, task, P4)

task

Tracking

()

RESOLVED FIXED
162 Branch
Tracking Status
firefox162 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

(Blocks 1 open bug, )

Details

(Whiteboard: [wptsync downstream])

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

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

Vladimir Levin <vmpstr@chromium.org> wrote:

[css-anchor-position] Relayout anchor-positioned elements on scroll end

Per the CSSWG resolution in w3c/csswg-drafts#14112, once a scroll
operation has stopped, the UA must ensure the layout of
anchor-positioned elements is consistent with a full relayout at that
point (while continuing to slide them on the compositor during active
scrolling).

When a scroll finishes (emitting scrollend), notify active
AnchorPositionScrollData instances whose adjustment containers include
the scrolled element. On the next snapshot update, invalidate their
layout (which also clears the remembered scroll offsets), so the element
is relaid out at the current scroll position.

Also:

  • Filter layout scroll offsets per-axis in
    AnchorEvaluatorImpl::CalculateAnchorRectWithScrollOffset() using
    ShouldUseScrollAdjustmentFor(). Scroll is only compensated per axis
    for anchors sharing the default anchor's scroll container in that
    axis, so without this, a relayout on scroll end would start applying
    scroll offsets that are not compensated for (breaking
    anchor-scroll-single-axis-{mixed,default}-anchor.html).
  • Use PixelSnappedScrollOffset() in
    AnchorPositionScrollData::ComputeAdjustmentContainersData() to match
    compositor and paint property rounding of half-pixel scroll offsets.
  • Update WPTs (including anchor-scroll-011.html and
    anchor-scroll-012.html) to reflect relayout on scroll end.

Bug: 543008837
Test: blink_unittests --gtest_filter=AnchorPositionScrollDataTest.*
Test: external/wpt/css/css-anchor-position/position-area-scrolling-008.html
Change-Id: I123ee8913368fd3489cb938d6315d52436fd45bf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8646229
Commit-Queue: Vladimir Levin \<vmpstr@chromium.org>
Reviewed-by: Ian Kilpatrick \<ikilpatrick@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1733054}

Component: web-platform-tests → CSS Parsing and Computation
Product: Testing → Core

CI Results

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

Total 548 tests

Status Summary

Firefox

OK : 5[GitHub] 266[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, Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]
PASS: 13[GitHub] 42[Gecko-linux2204-64-wayland-debug, Gecko-linux2204-64-wayland-opt] 13607[Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt] 13795[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] 13809[Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt] 13812[Gecko-linux2404-64-debug, Gecko-linux2404-64-opt]
FAIL: 7[GitHub] 101[Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt] 134[Gecko-linux2404-64-debug, Gecko-linux2404-64-opt] 137[Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt] 150[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]

Chrome

OK : 5
PASS: 9
FAIL: 11

Safari

OK : 5
PASS: 14
FAIL: 6

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

Tests Disabled in Gecko Infrastructure

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