Bug 1833972 [wpt PR 40083] - [scroll-start] Apply scroll-start after layout, a=testonly
commitadd7dba1d9637186865f651c1f51a44f055ae442
authorDavid Awogbemila <awogbemila@chromium.org>
Mon, 19 Jun 2023 20:25:16 +0000 (19 20:25 +0000)
committermoz-wptsync-bot <wptsync@mozilla.com>
Wed, 21 Jun 2023 14:35:35 +0000 (21 14:35 +0000)
tree51046dfe09cbec09a778aeb551f853d07ee616ad
parent4febe994cc3539c8eb283d31857c23706e2e1535
Bug 1833972 [wpt PR 40083] - [scroll-start] Apply scroll-start after layout, a=testonly

Automatic update from web-platform-tests
[scroll-start] Apply scroll-start after layout

scroll-start[1] should set the initial/default scroll position of a
scroller. Many different things may cause a scroller's size/layout
to change as a page loads which can affect how scroll-start should
be applied. So, this patch applies scroll-start on each frame until
the scroller has been explicitly scrolled, i.e. by the user or via a
programmatic scroll. After an explicit scroll, scroll-start is no
longer applied.

We propagate scroll-start from the document element to the viewport
so that scroll-start can be applied to the page. We save an
explicitly_scrolled_ bit on the element so that scroll-start
does not prevent saved (explicit) scrolls from surviving changes
to display and overflow.

[1] https://drafts.csswg.org/css-scroll-snap-2/#scroll-start

Bug: 1439807
Change-Id: I5655f8e74b85fe45038f700091065fa11eeac0f8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4546420
Commit-Queue: David Awogbemila <awogbemila@chromium.org>
Reviewed-by: Stefan Zager <szager@chromium.org>
Reviewed-by: Steve Kobes <skobes@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1159106}

--

wpt-commits: 4203f37b7415c420aa495d315339e8e5b51b8288
wpt-pr: 40083
testing/web-platform/tests/css/css-scroll-snap-2/scroll-start-fieldset.html