From de07fb51325a102d61c339719e84b4004b31d387 Mon Sep 17 00:00:00 2001 From: Shannon Booth Date: Sun, 3 Sep 2023 15:36:00 +1200 Subject: [PATCH] LibWeb: Port HTMLAreaElement interface from DeprecatedString to String Which required HTMLHyperlinkElementUtils to also be changed to support this. --- .../Libraries/LibWeb/HTML/HTMLAreaElement.idl | 2 +- .../LibWeb/HTML/HTMLHyperlinkElementUtils.cpp | 22 +++++++++---------- .../LibWeb/HTML/HTMLHyperlinkElementUtils.h | 20 ++++++++--------- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLAreaElement.idl b/Userland/Libraries/LibWeb/HTML/HTMLAreaElement.idl index 4cdd4b53de1..df8a755d774 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLAreaElement.idl +++ b/Userland/Libraries/LibWeb/HTML/HTMLAreaElement.idl @@ -2,7 +2,7 @@ #import // https://html.spec.whatwg.org/multipage/image-maps.html#htmlareaelement -[Exposed=Window, UseDeprecatedAKString] +[Exposed=Window] interface HTMLAreaElement : HTMLElement { [HTMLConstructor] constructor(); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLHyperlinkElementUtils.cpp b/Userland/Libraries/LibWeb/HTML/HTMLHyperlinkElementUtils.cpp index b81afbd6aed..82d2f03908c 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLHyperlinkElementUtils.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLHyperlinkElementUtils.cpp @@ -68,7 +68,7 @@ DeprecatedString HTMLHyperlinkElementUtils::protocol() const } // https://html.spec.whatwg.org/multipage/links.html#dom-hyperlink-protocol -void HTMLHyperlinkElementUtils::set_protocol(DeprecatedString protocol) +void HTMLHyperlinkElementUtils::set_protocol(StringView protocol) { // 1. Reinitialize url. reinitialize_url(); @@ -101,7 +101,7 @@ DeprecatedString HTMLHyperlinkElementUtils::username() const } // https://html.spec.whatwg.org/multipage/links.html#dom-hyperlink-username -void HTMLHyperlinkElementUtils::set_username(DeprecatedString username) +void HTMLHyperlinkElementUtils::set_username(StringView username) { // 1. Reinitialize url. reinitialize_url(); @@ -138,7 +138,7 @@ DeprecatedString HTMLHyperlinkElementUtils::password() const } // https://html.spec.whatwg.org/multipage/links.html#dom-hyperlink-password -void HTMLHyperlinkElementUtils::set_password(DeprecatedString password) +void HTMLHyperlinkElementUtils::set_password(StringView password) { // 1. Reinitialize url. reinitialize_url(); @@ -179,7 +179,7 @@ DeprecatedString HTMLHyperlinkElementUtils::host() const } // https://html.spec.whatwg.org/multipage/links.html#dom-hyperlink-host -void HTMLHyperlinkElementUtils::set_host(DeprecatedString host) +void HTMLHyperlinkElementUtils::set_host(StringView host) { // 1. Reinitialize url. reinitialize_url(); @@ -215,7 +215,7 @@ DeprecatedString HTMLHyperlinkElementUtils::hostname() const return url.serialized_host().release_value_but_fixme_should_propagate_errors().to_deprecated_string(); } -void HTMLHyperlinkElementUtils::set_hostname(DeprecatedString hostname) +void HTMLHyperlinkElementUtils::set_hostname(StringView hostname) { // 1. Reinitialize url. reinitialize_url(); @@ -254,7 +254,7 @@ DeprecatedString HTMLHyperlinkElementUtils::port() const } // https://html.spec.whatwg.org/multipage/links.html#dom-hyperlink-port -void HTMLHyperlinkElementUtils::set_port(DeprecatedString port) +void HTMLHyperlinkElementUtils::set_port(StringView port) { // 1. Reinitialize url. reinitialize_url(); @@ -298,7 +298,7 @@ DeprecatedString HTMLHyperlinkElementUtils::pathname() const } // https://html.spec.whatwg.org/multipage/links.html#dom-hyperlink-pathname -void HTMLHyperlinkElementUtils::set_pathname(DeprecatedString pathname) +void HTMLHyperlinkElementUtils::set_pathname(StringView pathname) { // 1. Reinitialize url. reinitialize_url(); @@ -337,7 +337,7 @@ DeprecatedString HTMLHyperlinkElementUtils::search() const return DeprecatedString::formatted("?{}", m_url->query()); } -void HTMLHyperlinkElementUtils::set_search(DeprecatedString search) +void HTMLHyperlinkElementUtils::set_search(StringView search) { // 1. Reinitialize url. reinitialize_url(); @@ -385,7 +385,7 @@ DeprecatedString HTMLHyperlinkElementUtils::hash() const return DeprecatedString::formatted("#{}", *m_url->fragment()); } -void HTMLHyperlinkElementUtils::set_hash(DeprecatedString hash) +void HTMLHyperlinkElementUtils::set_hash(StringView hash) { // 1. Reinitialize url. reinitialize_url(); @@ -441,10 +441,10 @@ DeprecatedString HTMLHyperlinkElementUtils::href() const } // https://html.spec.whatwg.org/multipage/links.html#dom-hyperlink-href -WebIDL::ExceptionOr HTMLHyperlinkElementUtils::set_href(DeprecatedString href) +WebIDL::ExceptionOr HTMLHyperlinkElementUtils::set_href(StringView href) { // The href attribute's setter must set this element's href content attribute's value to the given value. - return set_hyperlink_element_utils_href(move(href)); + return set_hyperlink_element_utils_href(href); } // https://html.spec.whatwg.org/multipage/links.html#update-href diff --git a/Userland/Libraries/LibWeb/HTML/HTMLHyperlinkElementUtils.h b/Userland/Libraries/LibWeb/HTML/HTMLHyperlinkElementUtils.h index 9f25273a8d5..ec15a02d558 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLHyperlinkElementUtils.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLHyperlinkElementUtils.h @@ -20,34 +20,34 @@ public: DeprecatedString origin() const; DeprecatedString href() const; - WebIDL::ExceptionOr set_href(DeprecatedString); + WebIDL::ExceptionOr set_href(StringView); DeprecatedString protocol() const; - void set_protocol(DeprecatedString); + void set_protocol(StringView); DeprecatedString username() const; - void set_username(DeprecatedString); + void set_username(StringView); DeprecatedString password() const; - void set_password(DeprecatedString); + void set_password(StringView); DeprecatedString host() const; - void set_host(DeprecatedString); + void set_host(StringView); DeprecatedString hostname() const; - void set_hostname(DeprecatedString); + void set_hostname(StringView); DeprecatedString port() const; - void set_port(DeprecatedString); + void set_port(StringView); DeprecatedString pathname() const; - void set_pathname(DeprecatedString); + void set_pathname(StringView); DeprecatedString search() const; - void set_search(DeprecatedString); + void set_search(StringView); DeprecatedString hash() const; - void set_hash(DeprecatedString); + void set_hash(StringView); protected: virtual DOM::Document& hyperlink_element_utils_document() = 0;