Skip to content

Commit ea708aa

Browse files
lillesmoz-wptsync-bot
authored andcommitted
Bug 1999761 [wpt PR 56000] - Make scroll-timeline snapshotting tests align with spec and proposal, a=testonly
Automatic update from web-platform-tests Make scroll-timeline snapshotting tests align with spec and proposal According to the current spec, scroll-timelines are update after scroll events are dispatched, but before style and layout is updated for the frame update. With the proposed change[1] in the HTML specification, the scroll-timelines are updated after a first style/layout update in the resizeObserver loop. We modify the scroll-timeline-snapshotting tests to allow them to pass for both timings. This reveals an issue with the current Blink implementation not matching the current spec, as we snapshot the timelines before the scroll events are dispatched. WebKit implements the current spec and still pass the tests after modification. [1] whatwg/html#11613 Bug: 384523570 Change-Id: I03b29b1f85527f9e54d597586d0764fc53f7776b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7141779 Reviewed-by: Kevin Ellis <[email protected]> Commit-Queue: Rune Lillesveen <[email protected]> Cr-Commit-Position: refs/heads/main@{#1543753} -- wpt-commits: d702e50d6999b5ac1fdd815992887be83e49cbd7 wpt-pr: 56000
1 parent a4e03c1 commit ea708aa

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

testing/web-platform/tests/scroll-animations/scroll-timelines/scroll-timeline-snapshotting.html

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
<!DOCTYPE html>
22
<meta charset="utf-8">
33
<title>ScrollTimeline snapshotting</title>
4-
<link rel="help" href="https://wicg.github.io/scroll-animations/#avoiding-cycles">
4+
<link rel="help" href="https://drafts.csswg.org/scroll-animations-1/#event-loop">
5+
<link rel="help" href="https://github.com/whatwg/html/pull/11613">
56
<script src="/resources/testharness.js"></script>
67
<script src="/resources/testharnessreport.js"></script>
78
<script src="/resources/testdriver.js"></script>
89
<script src="/resources/testdriver-vendor.js"></script>
910
<script src="/resources/testdriver-actions.js"></script>
1011
<script src="/web-animations/testcommon.js"></script>
1112
<script src="./testcommon.js"></script>
13+
<script src="/css/css-scroll-snap/support/common.js"></script>
1214

1315
<style>
1416
body {
@@ -30,13 +32,17 @@
3032

3133
scroller.scrollBy({top: 100, behavior: 'smooth'});
3234
// Wait for the scroll to change.
33-
const startScroll = scroller.scrollTop;
34-
do {
35-
await waitForNextFrame();
36-
} while(scroller.scrollTop == startScroll);
35+
await waitForScrollEvent(document);
36+
// The next frame the scroll changes, the scroll-timelines should not be
37+
// updated before the scroll events are dispatched. Store the scroll position
38+
// from the previous frame to compare the timeline to.
39+
let scroll_percentage = (scroller.scrollTop / maxScroll) * 100;
40+
41+
await waitForScrollEvent(document);
42+
3743
assert_percents_equal(
3844
timeline.currentTime,
39-
(scroller.scrollTop / maxScroll) * 100,
45+
scroll_percentage,
4046
'Scroll timeline current time corresponds to the scroll position.');
4147
}, 'ScrollTimeline current time is updated after programmatic animated ' +
4248
'scroll.');

0 commit comments

Comments
 (0)