diff options
author | Idan Horowitz <idan.horowitz@gmail.com> | 2021-10-01 19:05:28 +0300 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-10-01 20:14:45 +0200 |
commit | 1c4404c46a0a6a57246241dd428c5cefdb51c112 (patch) | |
tree | 52c2769373b3a84b2a419f0ed87f229a2b9598b3 /Userland/Libraries/LibWeb/HTML/PageTransitionEvent.h | |
parent | 4d71f226730ad5d1a6ea9779b17a64e26c06488a (diff) | |
download | serenity-1c4404c46a0a6a57246241dd428c5cefdb51c112.zip |
LibWeb: Add the missing PageTransitionEvent IDL constructor
Diffstat (limited to 'Userland/Libraries/LibWeb/HTML/PageTransitionEvent.h')
-rw-r--r-- | Userland/Libraries/LibWeb/HTML/PageTransitionEvent.h | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/Userland/Libraries/LibWeb/HTML/PageTransitionEvent.h b/Userland/Libraries/LibWeb/HTML/PageTransitionEvent.h index 7c3602ed1f..a2477524f0 100644 --- a/Userland/Libraries/LibWeb/HTML/PageTransitionEvent.h +++ b/Userland/Libraries/LibWeb/HTML/PageTransitionEvent.h @@ -10,13 +10,21 @@ namespace Web::HTML { +struct PageTransitionEventInit : public DOM::EventInit { + bool persisted { false }; +}; + class PageTransitionEvent final : public DOM::Event { public: using WrapperType = Bindings::PageTransitionEventWrapper; - static NonnullRefPtr<PageTransitionEvent> create(FlyString event_name, bool persisted) + static NonnullRefPtr<PageTransitionEvent> create(FlyString const& event_name, PageTransitionEventInit const& event_init) + { + return adopt_ref(*new PageTransitionEvent(event_name, event_init)); + } + static NonnullRefPtr<PageTransitionEvent> create_with_global_object(Bindings::WindowObject&, FlyString const& event_name, PageTransitionEventInit const& event_init) { - return adopt_ref(*new PageTransitionEvent(move(event_name), persisted)); + return PageTransitionEvent::create(event_name, event_init); } virtual ~PageTransitionEvent() override = default; @@ -24,9 +32,9 @@ public: bool persisted() const { return m_persisted; } protected: - PageTransitionEvent(FlyString event_name, bool persisted) - : DOM::Event(move(event_name)) - , m_persisted(persisted) + PageTransitionEvent(FlyString const& event_name, PageTransitionEventInit const& event_init) + : DOM::Event(event_name, event_init) + , m_persisted(event_init.persisted) { } |