mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-10 03:26:10 +00:00
LibWeb: Handle persisting an animation after it has been removed
This commit is contained in:
parent
a80af938eb
commit
6859826e3d
Notes:
sideshowbarker
2024-07-17 03:59:29 +09:00
Author: https://github.com/mattco98
Commit: 6859826e3d
Pull-request: https://github.com/SerenityOS/serenity/pull/24514
3 changed files with 16 additions and 2 deletions
|
@ -10,6 +10,14 @@
|
|||
anim.persist();
|
||||
if (prevReplaceState === "active" && anim.replaceState === "persisted")
|
||||
println("persist() sets animation's replaceState to persist");
|
||||
anim.cancel();
|
||||
|
||||
// "Undo" the removal of an animation by the Document
|
||||
anim1 = foo.animate({ opacity: 0 }, { duration: 1, fill: 'forwards' });
|
||||
anim2 = foo.animate({ opacity: 0 }, { duration: 1, fill: 'forwards' });
|
||||
await anim1.finished;
|
||||
anim1.persist();
|
||||
println(`persist() undoes the Document removal effects: ${foo.getAnimations().length === 2}`);
|
||||
|
||||
const timeline = internals.createInternalAnimationTimeline();
|
||||
let anim1 = foo.animate({ opacity: 0 }, { duration: 1000, fill: "forwards", timeline });
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue