LibWeb: Associate InternalAnimationTimeline with a DOM::Document

This commit is contained in:
Matthew Olsson 2024-03-28 17:49:00 -07:00 committed by Andreas Kling
commit 291871e0cc
Notes: sideshowbarker 2024-07-17 09:37:30 +09:00

View file

@ -5,6 +5,8 @@
*/ */
#include <LibWeb/Bindings/Intrinsics.h> #include <LibWeb/Bindings/Intrinsics.h>
#include <LibWeb/DOM/Document.h>
#include <LibWeb/HTML/Window.h>
#include <LibWeb/Internals/InternalAnimationTimeline.h> #include <LibWeb/Internals/InternalAnimationTimeline.h>
namespace Web::Internals { namespace Web::Internals {
@ -26,6 +28,9 @@ InternalAnimationTimeline::InternalAnimationTimeline(JS::Realm& realm)
: AnimationTimeline(realm) : AnimationTimeline(realm)
{ {
m_current_time = 0.0; m_current_time = 0.0;
auto& document = static_cast<HTML::Window&>(global_object()).associated_document();
document.associate_with_timeline(*this);
} }
void InternalAnimationTimeline::initialize(JS::Realm& realm) void InternalAnimationTimeline::initialize(JS::Realm& realm)