Skip to content

Commit cbefab2

Browse files
kennethmyhralinusg
authored andcommitted
LibWeb: Port fire_a_page_transition_event() to new FlyString
1 parent bf048da commit cbefab2

File tree

6 files changed

+7
-7
lines changed

6 files changed

+7
-7
lines changed

Userland/Libraries/LibWeb/DOM/Document.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2327,7 +2327,7 @@ void Document::unload(bool recursive_flag, Optional<DocumentUnloadTimingInfo> un
23272327
m_page_showing = false;
23282328

23292329
// 2. Fire a page transition event named pagehide at document's relevant global object with document's salvageable state.
2330-
global_object().fire_a_page_transition_event(HTML::EventNames::pagehide.to_deprecated_fly_string(), m_salvageable);
2330+
global_object().fire_a_page_transition_event(HTML::EventNames::pagehide, m_salvageable);
23312331

23322332
// 3. Update the visibility state of newDocument to "hidden".
23332333
update_the_visibility_state(HTML::VisibilityState::Hidden);

Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1125,7 +1125,7 @@ WebIDL::ExceptionOr<void> BrowsingContext::traverse_the_history(size_t entry_ind
11251125

11261126
// 4. Fire a page transition event named pageshow at newDocument's relevant global object with true.
11271127
auto& window = verify_cast<HTML::Window>(relevant_global_object(*new_document));
1128-
window.fire_a_page_transition_event(HTML::EventNames::pageshow.to_deprecated_fly_string(), true);
1128+
window.fire_a_page_transition_event(HTML::EventNames::pageshow, true);
11291129
});
11301130
}
11311131

Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ void HTMLParser::the_end()
313313
document->set_page_showing(true);
314314

315315
// 11. Fire a page transition event named pageshow at window with false.
316-
window->fire_a_page_transition_event(HTML::EventNames::pageshow.to_deprecated_fly_string(), false);
316+
window->fire_a_page_transition_event(HTML::EventNames::pageshow, false);
317317

318318
// 12. Completely finish loading the Document.
319319
document->completely_finish_loading();

Userland/Libraries/LibWeb/HTML/Window.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -567,14 +567,14 @@ Optional<CSS::MediaFeatureValue> Window::query_media_feature(CSS::MediaFeatureID
567567
}
568568

569569
// https://html.spec.whatwg.org/#fire-a-page-transition-event
570-
void Window::fire_a_page_transition_event(DeprecatedFlyString const& event_name, bool persisted)
570+
void Window::fire_a_page_transition_event(FlyString const& event_name, bool persisted)
571571
{
572572
// To fire a page transition event named eventName at a Window window with a boolean persisted,
573573
// fire an event named eventName at window, using PageTransitionEvent,
574574
// with the persisted attribute initialized to persisted,
575575
PageTransitionEventInit event_init {};
576576
event_init.persisted = persisted;
577-
auto event = PageTransitionEvent::create(associated_document().realm(), String::from_deprecated_string(event_name).release_value_but_fixme_should_propagate_errors(), event_init).release_value_but_fixme_should_propagate_errors();
577+
auto event = PageTransitionEvent::create(associated_document().realm(), event_name, event_init).release_value_but_fixme_should_propagate_errors();
578578

579579
// ...the cancelable attribute initialized to true,
580580
event->set_cancelable(true);

Userland/Libraries/LibWeb/HTML/Window.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ class Window final
106106

107107
Optional<CSS::MediaFeatureValue> query_media_feature(CSS::MediaFeatureID) const;
108108

109-
void fire_a_page_transition_event(DeprecatedFlyString const& event_name, bool persisted);
109+
void fire_a_page_transition_event(FlyString const& event_name, bool persisted);
110110

111111
WebIDL::ExceptionOr<JS::NonnullGCPtr<Storage>> local_storage();
112112
WebIDL::ExceptionOr<JS::NonnullGCPtr<Storage>> session_storage();

Userland/Libraries/LibWeb/XML/XMLDocumentBuilder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ void XMLDocumentBuilder::document_end()
245245
document->set_page_showing(true);
246246

247247
// Fire a page transition event named pageshow at window with false.
248-
window->fire_a_page_transition_event(HTML::EventNames::pageshow.to_deprecated_fly_string(), false);
248+
window->fire_a_page_transition_event(HTML::EventNames::pageshow, false);
249249

250250
// Completely finish loading the Document.
251251
document->completely_finish_loading();

0 commit comments

Comments
 (0)