mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:47:36 +00:00
LibWeb: Add the missing PageTransitionEvent IDL constructor
This commit is contained in:
parent
4d71f22673
commit
1c4404c46a
4 changed files with 25 additions and 9 deletions
|
@ -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(move(event_name), persisted));
|
||||
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 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)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue