diff --git a/Userland/Libraries/LibWeb/DOM/Range.idl b/Userland/Libraries/LibWeb/DOM/Range.idl index 9ab4b3d4ab..677d4d3824 100644 --- a/Userland/Libraries/LibWeb/DOM/Range.idl +++ b/Userland/Libraries/LibWeb/DOM/Range.idl @@ -2,7 +2,7 @@ #import #import -[Exposed=Window] +[Exposed=Window, UseNewAKString] interface Range : AbstractRange { constructor(); diff --git a/Userland/Libraries/LibWeb/HTML/History.cpp b/Userland/Libraries/LibWeb/HTML/History.cpp index 3d1533c35d..9a6b5a7182 100644 --- a/Userland/Libraries/LibWeb/HTML/History.cpp +++ b/Userland/Libraries/LibWeb/HTML/History.cpp @@ -37,14 +37,14 @@ void History::visit_edges(Cell::Visitor& visitor) } // https://html.spec.whatwg.org/multipage/history.html#dom-history-pushstate -WebIDL::ExceptionOr History::push_state(JS::Value data, DeprecatedString const&, DeprecatedString const& url) +WebIDL::ExceptionOr History::push_state(JS::Value data, String const&, Optional const& url) { // NOTE: The second parameter of this function is intentionally unused. return shared_history_push_replace_state(data, url, IsPush::Yes); } // https://html.spec.whatwg.org/multipage/history.html#dom-history-replacestate -WebIDL::ExceptionOr History::replace_state(JS::Value data, DeprecatedString const&, DeprecatedString const& url) +WebIDL::ExceptionOr History::replace_state(JS::Value data, String const&, Optional const& url) { // NOTE: The second parameter of this function is intentionally unused. return shared_history_push_replace_state(data, url, IsPush::No); @@ -150,7 +150,7 @@ static bool can_have_its_url_rewritten(DOM::Document const& document, AK::URL co } // https://html.spec.whatwg.org/multipage/history.html#shared-history-push/replace-state-steps -WebIDL::ExceptionOr History::shared_history_push_replace_state(JS::Value value, DeprecatedString const& url, IsPush) +WebIDL::ExceptionOr History::shared_history_push_replace_state(JS::Value value, Optional const& url, IsPush) { // 1. Let document be history's associated Document. auto& document = m_associated_document; @@ -171,10 +171,10 @@ WebIDL::ExceptionOr History::shared_history_push_replace_state(JS::Value v auto new_url = document->url(); // 6. If url is not null or the empty string, then: - if (!url.is_empty() && !url.is_null()) { + if (url.has_value() && !url->is_empty()) { // 1. Parse url, relative to the relevant settings object of history. - auto parsed_url = relevant_settings_object(*this).parse_url(url); + auto parsed_url = relevant_settings_object(*this).parse_url(url->to_deprecated_string()); // 2. If that fails, then throw a "SecurityError" DOMException. if (!parsed_url.is_valid()) diff --git a/Userland/Libraries/LibWeb/HTML/History.h b/Userland/Libraries/LibWeb/HTML/History.h index c11aa2b5e7..d176715954 100644 --- a/Userland/Libraries/LibWeb/HTML/History.h +++ b/Userland/Libraries/LibWeb/HTML/History.h @@ -20,8 +20,8 @@ public: virtual ~History() override; - WebIDL::ExceptionOr push_state(JS::Value data, DeprecatedString const& unused, DeprecatedString const& url); - WebIDL::ExceptionOr replace_state(JS::Value data, DeprecatedString const& unused, DeprecatedString const& url); + WebIDL::ExceptionOr push_state(JS::Value data, String const& unused, Optional const& url = {}); + WebIDL::ExceptionOr replace_state(JS::Value data, String const& unused, Optional const& url = {}); WebIDL::ExceptionOr go(long delta); WebIDL::ExceptionOr back(); WebIDL::ExceptionOr forward(); @@ -37,7 +37,7 @@ private: No, Yes, }; - WebIDL::ExceptionOr shared_history_push_replace_state(JS::Value data, DeprecatedString const& url, IsPush is_push); + WebIDL::ExceptionOr shared_history_push_replace_state(JS::Value data, Optional const& url, IsPush is_push); JS::NonnullGCPtr m_associated_document; }; diff --git a/Userland/Libraries/LibWeb/HTML/History.idl b/Userland/Libraries/LibWeb/HTML/History.idl index 000655737d..4c52847103 100644 --- a/Userland/Libraries/LibWeb/HTML/History.idl +++ b/Userland/Libraries/LibWeb/HTML/History.idl @@ -1,5 +1,5 @@ // https://html.spec.whatwg.org/multipage/history.html#the-history-interface -[Exposed=Window] +[Exposed=Window, UseNewAKString] interface History { readonly attribute unsigned long length; // FIXME: attribute ScrollRestoration scrollRestoration;