AnimationEvent.cpp 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  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::NonnullGCPtr<AnimationEvent> AnimationEvent::create(JS::Realm& realm, FlyString const& type, AnimationEventInit const& event_init)
  10. {
  11. return realm.heap().allocate<AnimationEvent>(realm, realm, type, event_init);
  12. }
  13. WebIDL::ExceptionOr<JS::NonnullGCPtr<AnimationEvent>> AnimationEvent::construct_impl(JS::Realm& realm, FlyString const& type, AnimationEventInit const& event_init)
  14. {
  15. return create(realm, type, event_init);
  16. }
  17. AnimationEvent::AnimationEvent(JS::Realm& realm, FlyString const& type, AnimationEventInit const& event_init)
  18. : DOM::Event(realm, type, event_init)
  19. , m_animation_name(event_init.animation_name)
  20. , m_elapsed_time(event_init.elapsed_time)
  21. , m_pseudo_element(event_init.pseudo_element)
  22. {
  23. }
  24. void AnimationEvent::initialize(JS::Realm& realm)
  25. {
  26. Base::initialize(realm);
  27. WEB_SET_PROTOTYPE_FOR_INTERFACE(AnimationEvent);
  28. }
  29. }