1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:18:11 +00:00

LibWeb: Port HTMLAreaElement interface from DeprecatedString to String

Which required HTMLHyperlinkElementUtils to also be changed to support
this.
This commit is contained in:
Shannon Booth 2023-09-03 15:36:00 +12:00 committed by Tim Flynn
parent 57d8b0ec73
commit de07fb5132
3 changed files with 22 additions and 22 deletions

View file

@ -2,7 +2,7 @@
#import <HTML/HTMLHyperlinkElementUtils.idl> #import <HTML/HTMLHyperlinkElementUtils.idl>
// https://html.spec.whatwg.org/multipage/image-maps.html#htmlareaelement // https://html.spec.whatwg.org/multipage/image-maps.html#htmlareaelement
[Exposed=Window, UseDeprecatedAKString] [Exposed=Window]
interface HTMLAreaElement : HTMLElement { interface HTMLAreaElement : HTMLElement {
[HTMLConstructor] constructor(); [HTMLConstructor] constructor();

View file

@ -68,7 +68,7 @@ DeprecatedString HTMLHyperlinkElementUtils::protocol() const
} }
// https://html.spec.whatwg.org/multipage/links.html#dom-hyperlink-protocol // 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. // 1. Reinitialize url.
reinitialize_url(); reinitialize_url();
@ -101,7 +101,7 @@ DeprecatedString HTMLHyperlinkElementUtils::username() const
} }
// https://html.spec.whatwg.org/multipage/links.html#dom-hyperlink-username // 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. // 1. Reinitialize url.
reinitialize_url(); reinitialize_url();
@ -138,7 +138,7 @@ DeprecatedString HTMLHyperlinkElementUtils::password() const
} }
// https://html.spec.whatwg.org/multipage/links.html#dom-hyperlink-password // 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. // 1. Reinitialize url.
reinitialize_url(); reinitialize_url();
@ -179,7 +179,7 @@ DeprecatedString HTMLHyperlinkElementUtils::host() const
} }
// https://html.spec.whatwg.org/multipage/links.html#dom-hyperlink-host // 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. // 1. Reinitialize url.
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(); 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. // 1. Reinitialize url.
reinitialize_url(); reinitialize_url();
@ -254,7 +254,7 @@ DeprecatedString HTMLHyperlinkElementUtils::port() const
} }
// https://html.spec.whatwg.org/multipage/links.html#dom-hyperlink-port // 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. // 1. Reinitialize url.
reinitialize_url(); reinitialize_url();
@ -298,7 +298,7 @@ DeprecatedString HTMLHyperlinkElementUtils::pathname() const
} }
// https://html.spec.whatwg.org/multipage/links.html#dom-hyperlink-pathname // 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. // 1. Reinitialize url.
reinitialize_url(); reinitialize_url();
@ -337,7 +337,7 @@ DeprecatedString HTMLHyperlinkElementUtils::search() const
return DeprecatedString::formatted("?{}", m_url->query()); return DeprecatedString::formatted("?{}", m_url->query());
} }
void HTMLHyperlinkElementUtils::set_search(DeprecatedString search) void HTMLHyperlinkElementUtils::set_search(StringView search)
{ {
// 1. Reinitialize url. // 1. Reinitialize url.
reinitialize_url(); reinitialize_url();
@ -385,7 +385,7 @@ DeprecatedString HTMLHyperlinkElementUtils::hash() const
return DeprecatedString::formatted("#{}", *m_url->fragment()); return DeprecatedString::formatted("#{}", *m_url->fragment());
} }
void HTMLHyperlinkElementUtils::set_hash(DeprecatedString hash) void HTMLHyperlinkElementUtils::set_hash(StringView hash)
{ {
// 1. Reinitialize url. // 1. Reinitialize url.
reinitialize_url(); reinitialize_url();
@ -441,10 +441,10 @@ DeprecatedString HTMLHyperlinkElementUtils::href() const
} }
// https://html.spec.whatwg.org/multipage/links.html#dom-hyperlink-href // https://html.spec.whatwg.org/multipage/links.html#dom-hyperlink-href
WebIDL::ExceptionOr<void> HTMLHyperlinkElementUtils::set_href(DeprecatedString href) WebIDL::ExceptionOr<void> HTMLHyperlinkElementUtils::set_href(StringView href)
{ {
// The href attribute's setter must set this element's href content attribute's value to the given value. // 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 // https://html.spec.whatwg.org/multipage/links.html#update-href

View file

@ -20,34 +20,34 @@ public:
DeprecatedString origin() const; DeprecatedString origin() const;
DeprecatedString href() const; DeprecatedString href() const;
WebIDL::ExceptionOr<void> set_href(DeprecatedString); WebIDL::ExceptionOr<void> set_href(StringView);
DeprecatedString protocol() const; DeprecatedString protocol() const;
void set_protocol(DeprecatedString); void set_protocol(StringView);
DeprecatedString username() const; DeprecatedString username() const;
void set_username(DeprecatedString); void set_username(StringView);
DeprecatedString password() const; DeprecatedString password() const;
void set_password(DeprecatedString); void set_password(StringView);
DeprecatedString host() const; DeprecatedString host() const;
void set_host(DeprecatedString); void set_host(StringView);
DeprecatedString hostname() const; DeprecatedString hostname() const;
void set_hostname(DeprecatedString); void set_hostname(StringView);
DeprecatedString port() const; DeprecatedString port() const;
void set_port(DeprecatedString); void set_port(StringView);
DeprecatedString pathname() const; DeprecatedString pathname() const;
void set_pathname(DeprecatedString); void set_pathname(StringView);
DeprecatedString search() const; DeprecatedString search() const;
void set_search(DeprecatedString); void set_search(StringView);
DeprecatedString hash() const; DeprecatedString hash() const;
void set_hash(DeprecatedString); void set_hash(StringView);
protected: protected:
virtual DOM::Document& hyperlink_element_utils_document() = 0; virtual DOM::Document& hyperlink_element_utils_document() = 0;