mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-11 20:16:02 +00:00
LibWeb: Use the global object to access the performance object
Previously, we were accessing the performance through the current window object. Thus caused a crash when `animate()` was called on an element within a document with no associated window object. The global object is now used to access the performance object in places where a window object is not guaranteed to exist.
This commit is contained in:
parent
eebdc7bc88
commit
558fef237c
Notes:
sideshowbarker
2024-07-17 11:33:34 +09:00
Author: https://github.com/tcl3
Commit: 558fef237c
Pull-request: https://github.com/SerenityOS/serenity/pull/23771
Reviewed-by: https://github.com/awesomekling
Reviewed-by: https://github.com/kalenikaliaksandr
Reviewed-by: https://github.com/shannonbooth
3 changed files with 15 additions and 2 deletions
|
@ -4185,8 +4185,9 @@ void Document::ensure_animation_timer()
|
|||
m_animation_driver_timer->stop();
|
||||
return;
|
||||
}
|
||||
|
||||
update_animations_and_send_events(window()->performance()->now());
|
||||
auto* window_or_worker = dynamic_cast<HTML::WindowOrWorkerGlobalScopeMixin*>(&realm().global_object());
|
||||
VERIFY(window_or_worker);
|
||||
update_animations_and_send_events(window_or_worker->performance()->now());
|
||||
}));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue