summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb
diff options
context:
space:
mode:
authorKenneth Myhra <kennethmyhra@gmail.com>2023-04-09 11:17:42 +0200
committerLinus Groh <mail@linusgroh.de>2023-04-09 17:27:27 +0200
commitcbefab21be0542119fc436304672b7f8e92d3e82 (patch)
tree475a33cd0f8cbde2dd41900b030b8f9ed8e6b778 /Userland/Libraries/LibWeb
parentbf048da8cbdd2fffe94402d842b5130b4276d6b2 (diff)
downloadserenity-cbefab21be0542119fc436304672b7f8e92d3e82.zip
LibWeb: Port fire_a_page_transition_event() to new FlyString
Diffstat (limited to 'Userland/Libraries/LibWeb')
-rw-r--r--Userland/Libraries/LibWeb/DOM/Document.cpp2
-rw-r--r--Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp2
-rw-r--r--Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp2
-rw-r--r--Userland/Libraries/LibWeb/HTML/Window.cpp4
-rw-r--r--Userland/Libraries/LibWeb/HTML/Window.h2
-rw-r--r--Userland/Libraries/LibWeb/XML/XMLDocumentBuilder.cpp2
6 files changed, 7 insertions, 7 deletions
diff --git a/Userland/Libraries/LibWeb/DOM/Document.cpp b/Userland/Libraries/LibWeb/DOM/Document.cpp
index d5061840f2..8e87bb1082 100644
--- a/Userland/Libraries/LibWeb/DOM/Document.cpp
+++ b/Userland/Libraries/LibWeb/DOM/Document.cpp
@@ -2327,7 +2327,7 @@ void Document::unload(bool recursive_flag, Optional<DocumentUnloadTimingInfo> un
m_page_showing = false;
// 2. Fire a page transition event named pagehide at document's relevant global object with document's salvageable state.
- global_object().fire_a_page_transition_event(HTML::EventNames::pagehide.to_deprecated_fly_string(), m_salvageable);
+ global_object().fire_a_page_transition_event(HTML::EventNames::pagehide, m_salvageable);
// 3. Update the visibility state of newDocument to "hidden".
update_the_visibility_state(HTML::VisibilityState::Hidden);
diff --git a/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp b/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp
index 69281fb2a0..53b3aa1f4a 100644
--- a/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp
+++ b/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp
@@ -1125,7 +1125,7 @@ WebIDL::ExceptionOr<void> BrowsingContext::traverse_the_history(size_t entry_ind
// 4. Fire a page transition event named pageshow at newDocument's relevant global object with true.
auto& window = verify_cast<HTML::Window>(relevant_global_object(*new_document));
- window.fire_a_page_transition_event(HTML::EventNames::pageshow.to_deprecated_fly_string(), true);
+ window.fire_a_page_transition_event(HTML::EventNames::pageshow, true);
});
}
diff --git a/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp b/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp
index de4a103977..fccbd1f256 100644
--- a/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp
+++ b/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp
@@ -313,7 +313,7 @@ void HTMLParser::the_end()
document->set_page_showing(true);
// 11. Fire a page transition event named pageshow at window with false.
- window->fire_a_page_transition_event(HTML::EventNames::pageshow.to_deprecated_fly_string(), false);
+ window->fire_a_page_transition_event(HTML::EventNames::pageshow, false);
// 12. Completely finish loading the Document.
document->completely_finish_loading();
diff --git a/Userland/Libraries/LibWeb/HTML/Window.cpp b/Userland/Libraries/LibWeb/HTML/Window.cpp
index e33f52b076..b6ddf11754 100644
--- a/Userland/Libraries/LibWeb/HTML/Window.cpp
+++ b/Userland/Libraries/LibWeb/HTML/Window.cpp
@@ -567,14 +567,14 @@ Optional<CSS::MediaFeatureValue> Window::query_media_feature(CSS::MediaFeatureID
}
// https://html.spec.whatwg.org/#fire-a-page-transition-event
-void Window::fire_a_page_transition_event(DeprecatedFlyString const& 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,
PageTransitionEventInit event_init {};
event_init.persisted = persisted;
- 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();
+ auto event = PageTransitionEvent::create(associated_document().realm(), event_name, event_init).release_value_but_fixme_should_propagate_errors();
// ...the cancelable attribute initialized to true,
event->set_cancelable(true);
diff --git a/Userland/Libraries/LibWeb/HTML/Window.h b/Userland/Libraries/LibWeb/HTML/Window.h
index e421ea90ef..be0b944a5e 100644
--- a/Userland/Libraries/LibWeb/HTML/Window.h
+++ b/Userland/Libraries/LibWeb/HTML/Window.h
@@ -106,7 +106,7 @@ public:
Optional<CSS::MediaFeatureValue> query_media_feature(CSS::MediaFeatureID) const;
- void fire_a_page_transition_event(DeprecatedFlyString const& event_name, bool persisted);
+ void fire_a_page_transition_event(FlyString const& event_name, bool persisted);
WebIDL::ExceptionOr<JS::NonnullGCPtr<Storage>> local_storage();
WebIDL::ExceptionOr<JS::NonnullGCPtr<Storage>> session_storage();
diff --git a/Userland/Libraries/LibWeb/XML/XMLDocumentBuilder.cpp b/Userland/Libraries/LibWeb/XML/XMLDocumentBuilder.cpp
index bf75430d7c..4d5d562010 100644
--- a/Userland/Libraries/LibWeb/XML/XMLDocumentBuilder.cpp
+++ b/Userland/Libraries/LibWeb/XML/XMLDocumentBuilder.cpp
@@ -245,7 +245,7 @@ void XMLDocumentBuilder::document_end()
document->set_page_showing(true);
// Fire a page transition event named pageshow at window with false.
- window->fire_a_page_transition_event(HTML::EventNames::pageshow.to_deprecated_fly_string(), false);
+ window->fire_a_page_transition_event(HTML::EventNames::pageshow, false);
// Completely finish loading the Document.
document->completely_finish_loading();