PageTransitionEvent.cpp 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. /*
  2. * Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include <LibWeb/Bindings/PageTransitionEventPrototype.h>
  7. #include <LibWeb/HTML/PageTransitionEvent.h>
  8. #include <LibWeb/HTML/Window.h>
  9. namespace Web::HTML {
  10. PageTransitionEvent* PageTransitionEvent::create(HTML::Window& window_object, FlyString const& event_name, PageTransitionEventInit const& event_init)
  11. {
  12. return window_object.heap().allocate<PageTransitionEvent>(window_object.realm(), window_object, event_name, event_init);
  13. }
  14. PageTransitionEvent* PageTransitionEvent::create_with_global_object(HTML::Window& window_object, FlyString const& event_name, PageTransitionEventInit const& event_init)
  15. {
  16. return create(window_object, event_name, event_init);
  17. }
  18. PageTransitionEvent::PageTransitionEvent(HTML::Window& window_object, FlyString const& event_name, PageTransitionEventInit const& event_init)
  19. : DOM::Event(window_object, event_name, event_init)
  20. , m_persisted(event_init.persisted)
  21. {
  22. set_prototype(&window_object.ensure_web_prototype<Bindings::PageTransitionEventPrototype>("PageTransitionEvent"));
  23. }
  24. PageTransitionEvent::~PageTransitionEvent() = default;
  25. }