1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:07:46 +00:00

LibWeb: Add the missing PageTransitionEvent IDL constructor

This commit is contained in:
Idan Horowitz 2021-10-01 19:05:28 +03:00 committed by Andreas Kling
parent 4d71f22673
commit 1c4404c46a
4 changed files with 25 additions and 9 deletions

View file

@ -282,12 +282,14 @@ float Window::scroll_y() const
}
// https://html.spec.whatwg.org/#fire-a-page-transition-event
void Window::fire_a_page_transition_event(FlyString event_name, bool persisted)
void Window::fire_a_page_transition_event(FlyString const& event_name, bool persisted)
{
// To fire a page transition event named eventName at a Window window with a boolean persisted,
// fire an event named eventName at window, using PageTransitionEvent,
// with the persisted attribute initialized to persisted,
auto event = HTML::PageTransitionEvent::create(move(event_name), persisted);
HTML::PageTransitionEventInit event_init {};
event_init.persisted = persisted;
auto event = HTML::PageTransitionEvent::create(event_name, event_init);
// ...the cancelable attribute initialized to true,
event->set_cancelable(true);