mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +00:00
LibWeb: Save time for animationcancel event before transitioning to idle
The if statement in the dispatch implies we are in the idle state, so of course the active time will always be undefined. If this was cancelled via a call to cancel(), we can save the time at that point. Otherwise, just send 0.
This commit is contained in:
parent
de02a2680f
commit
15a8baee03
Notes:
sideshowbarker
2024-07-17 10:16:43 +09:00
Author: https://github.com/mattco98
Commit: 15a8baee03
Pull-request: https://github.com/SerenityOS/serenity/pull/24427
Issue: https://github.com/SerenityOS/serenity/issues/24424
5 changed files with 38 additions and 2 deletions
|
@ -470,6 +470,10 @@ void Animation::cancel(ShouldInvalidate should_invalidate)
|
|||
// 3. Make animation’s start time unresolved.
|
||||
m_start_time = {};
|
||||
|
||||
// This time is needed for dispatching the animationcancel DOM event
|
||||
if (auto effect = m_effect)
|
||||
m_saved_cancel_time = effect->active_time_using_fill(Bindings::FillMode::Both);
|
||||
|
||||
if (should_invalidate == ShouldInvalidate::Yes)
|
||||
invalidate_effect();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue