mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-22 09:18:55 +00:00
LibWeb: Use InternalAnimationTimeline in the startTime.html test
This commit is contained in:
parent
7dcd7206d3
commit
d1f35653b1
Notes:
sideshowbarker
2024-07-17 01:00:06 +09:00
Author: https://github.com/mattco98
Commit: d1f35653b1
Pull-request: https://github.com/SerenityOS/serenity/pull/23750
1 changed files with 8 additions and 4 deletions
|
@ -4,6 +4,7 @@
|
||||||
<script>
|
<script>
|
||||||
asyncTest(async done => {
|
asyncTest(async done => {
|
||||||
const foo = document.getElementById("foo");
|
const foo = document.getElementById("foo");
|
||||||
|
|
||||||
let animation = foo.animate({ opacity: [0, 1] }, { duration: 1000 });
|
let animation = foo.animate({ opacity: [0, 1] }, { duration: 1000 });
|
||||||
println(`Animation's startTime is initially null: ${animation.startTime === null}`);
|
println(`Animation's startTime is initially null: ${animation.startTime === null}`);
|
||||||
animation.startTime = 100;
|
animation.startTime = 100;
|
||||||
|
@ -20,14 +21,17 @@
|
||||||
animation.currentTime = 100;
|
animation.currentTime = 100;
|
||||||
println(`Animation's startTime is null after calling pause() and setting currentTime: ${animation.startTime === null}`);
|
println(`Animation's startTime is null after calling pause() and setting currentTime: ${animation.startTime === null}`);
|
||||||
|
|
||||||
animation = foo.animate({ opacity: [0, 1] }, { duration: 1000 });
|
const timeline = internals.createInternalAnimationTimeline();
|
||||||
|
timeline.setTime(0);
|
||||||
|
|
||||||
|
animation = foo.animate({ opacity: [0, 1] }, { duration: 1000, timeline });
|
||||||
animation.startTime = 100;
|
animation.startTime = 100;
|
||||||
animation.playbackRate = -1;
|
animation.playbackRate = -1;
|
||||||
println(`Animation's startTime updates after reversing playbackRate: ${animation.startTime > -150 && animation.startTime < -50}`);
|
println(`Animation's startTime updates after reversing playbackRate: ${animation.startTime === -100}`);
|
||||||
|
|
||||||
animation = foo.animate({ opacity: [0, 1] }, { duration: 1000 });
|
animation = foo.animate({ opacity: [0, 1] }, { duration: 1000, timeline });
|
||||||
animation.finish();
|
animation.finish();
|
||||||
println(`Animation's startTime updates after calling finish(): ${animation.startTime > -1050 && animation.startTime < -950}`);
|
println(`Animation's startTime updates after calling finish(): ${animation.startTime === -1000}`);
|
||||||
|
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue