5 <link rel=
"help" src=
"https://drafts.csswg.org/scroll-animations-1/#named-timeline-range">
6 <script src=
"/resources/testharness.js"></script>
7 <script src=
"/resources/testharnessreport.js"></script>
8 <script src=
"/web-animations/testcommon.js"></script>
9 <script src=
"support/testcommon.js"></script>
10 <script src=
"/web-animations/resources/keyframe-utils.js"></script>
11 <title>Animation range and delay
</title>
13 <style type=
"text/css">
26 border: 10px solid lightgray
;
40 background-color: green
;
41 animation: anim auto both linear
;
42 /* using document timeline by default */
47 <div id=
"target"></div>
50 <script type=
"text/javascript">
51 async
function runTest() {
52 promise_test(async t
=> {
53 await
waitForNextFrame();
54 const anim
= document
.getAnimations()[0];
56 await
waitForNextFrame();
58 // Using a document timeline, so only the 50% keyframe is used.
59 let frames
= anim
.effect
.getKeyframes();
61 { offset
: 0, computedOffset
: 0, opacity
: "1", easing
: "linear",
62 composite
: "replace" },
63 { offset
: 0.5, computedOffset
: 0.5, opacity
: "0.5", easing
: "linear",
65 { offset
: 1, computedOffset
: 1, opacity
: "1", easing
: "linear",
66 composite
: "replace" }
68 assert_frame_lists_equal(frames
, expected
);
69 }, 'Keyframes with timeline-offsets ignored when using document ' +
73 window
.onload
= runTest
;