AnimationEvent.cpp 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. * Copyright (c) 2024, Matthew Olsson <mattco@serenityos.org>.
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include <LibWeb/Bindings/Intrinsics.h>
  7. #include <LibWeb/CSS/AnimationEvent.h>
  8. namespace Web::CSS {
  9. JS_DEFINE_ALLOCATOR(AnimationEvent);
  10. JS::NonnullGCPtr<AnimationEvent> AnimationEvent::create(JS::Realm& realm, FlyString const& type, AnimationEventInit const& event_init)
  11. {
  12. return realm.heap().allocate<AnimationEvent>(realm, realm, type, event_init);
  13. }
  14. WebIDL::ExceptionOr<JS::NonnullGCPtr<AnimationEvent>> AnimationEvent::construct_impl(JS::Realm& realm, FlyString const& type, AnimationEventInit const& event_init)
  15. {
  16. return create(realm, type, event_init);
  17. }
  18. AnimationEvent::AnimationEvent(JS::Realm& realm, FlyString const& type, AnimationEventInit const& event_init)
  19. : DOM::Event(realm, type, event_init)
  20. , m_animation_name(event_init.animation_name)
  21. , m_elapsed_time(event_init.elapsed_time)
  22. , m_pseudo_element(event_init.pseudo_element)
  23. {
  24. }
  25. void AnimationEvent::initialize(JS::Realm& realm)
  26. {
  27. Base::initialize(realm);
  28. WEB_SET_PROTOTYPE_FOR_INTERFACE(AnimationEvent);
  29. }
  30. }