Files
sousa-gecko/testing/web-platform/tests/scroll-animations/css/progress-based-animation-timeline.html
T
Rune Lillesveen d2f9eadf49 Bug 1988833 [wpt PR 54843] - Make some scroll-animation tests not rely on dirty-tree snapshot, a=testonly
Automatic update from web-platform-tests
Make some scroll-animation tests not rely on dirty-tree snapshot

An HTML PR[1] is attempting to move snapshotting of post-layout state
to where the layout tree is actually clean. The plan is for the
scroll-animations spec to also be expressed in terms of post-layout
state snapshotting.

The test changes here makes them valid both when timelines are updated
before the rendering update, and when they are only updated post-layout.

This CL starts with a few edits to check if this is an acceptable
approach.

[1] https://github.com/whatwg/html/pull/11613

Bug: 384523570
Change-Id: I29c9d7d22c5abf481117857e9463b37413ef5a92
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6947907
Reviewed-by: Kevin Ellis <kevers@chromium.org>
Commit-Queue: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1515714}

--

wpt-commits: dbc92090de5866a72b5d48f979791979f895b177
wpt-pr: 54843
2025-09-18 11:36:10 +00:00

58 lines
1.5 KiB
HTML

<!DOCTYPE html>
<title>CSS Animation using progress based timeline</title>
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1">
<link rel="help" src="https://drafts.csswg.org/css-animations-2/#animation-timeline">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/web-animations/testcommon.js"></script>
<style>
main > div {
overflow: hidden;
width: 100px;
height: 100px;
}
main > div > div {
height: 200px;
}
@keyframes top {
from { top: 100px; }
to { top: 200px; }
}
#scroller1 {
scroll-timeline: --top_timeline;
}
#element {
animation-name: top;
animation-duration: 10s;
animation-timing-function: linear;
animation-timeline: --top_timeline;
position: absolute;
}
/* Ensure stable expectations if feature is not supported */
@supports not (animation-timeline:--foo) {
#element { animation-play-state: paused; }
}
</style>
<main>
<div id=scroller1>
<div></div>
<div id=element></div>
</div>
</main>
<script>
window.onload = async () => {
promise_test(async (t) => {
await waitForNextFrame();
const anim = document.getAnimations()[0];
await anim.ready;
await runAndWaitForFrameUpdate(() => {
scroller1.scrollTop = 20;
});
assert_equals(getComputedStyle(element).top, '120px');
}, 'progress based animation timeline works');
};
</script>