mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-03 06:40:05 +00:00
LibURL+LibWeb: Do not percent decode in password/username getters
Doing it is not part of the spec. Whenever needed, the spec will explicitly percent decode the username and password. This fixes some URL WPT tests.
This commit is contained in:
parent
a10610a1ca
commit
f511c0b441
Notes:
github-actions[bot]
2024-08-04 11:59:57 +00:00
Author: https://github.com/shannonbooth
Commit: f511c0b441
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/954
Reviewed-by: https://github.com/kennethmyhra ✅
Reviewed-by: https://github.com/tcl3 ✅
14 changed files with 62 additions and 45 deletions
|
@ -41,8 +41,8 @@ bool url_matches_about_blank(URL::URL const& url)
|
|||
// A URL matches about:blank if its scheme is "about", its path contains a single string "blank", its username and password are the empty string, and its host is null.
|
||||
return url.scheme() == "about"sv
|
||||
&& url.serialize_path() == "blank"sv
|
||||
&& url.raw_username().is_empty()
|
||||
&& url.raw_password().is_empty()
|
||||
&& url.username().is_empty()
|
||||
&& url.password().is_empty()
|
||||
&& url.host().has<Empty>();
|
||||
}
|
||||
|
||||
|
@ -53,8 +53,8 @@ bool url_matches_about_srcdoc(URL::URL const& url)
|
|||
return url.scheme() == "about"sv
|
||||
&& url.serialize_path() == "srcdoc"sv
|
||||
&& !url.query().has_value()
|
||||
&& url.raw_username().is_empty()
|
||||
&& url.raw_password().is_empty()
|
||||
&& url.username().is_empty()
|
||||
&& url.password().is_empty()
|
||||
&& url.host().has<Empty>();
|
||||
}
|
||||
|
||||
|
|
|
@ -97,7 +97,7 @@ String HTMLHyperlinkElementUtils::username() const
|
|||
return String {};
|
||||
|
||||
// 3. Return this element's url's username.
|
||||
return m_url->username().release_value();
|
||||
return m_url->username();
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/links.html#dom-hyperlink-username
|
||||
|
@ -134,7 +134,7 @@ String HTMLHyperlinkElementUtils::password() const
|
|||
return String {};
|
||||
|
||||
// 4. Return url's password.
|
||||
return url->password().release_value();
|
||||
return url->password();
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/links.html#dom-hyperlink-password
|
||||
|
|
|
@ -135,8 +135,8 @@ bool can_have_its_url_rewritten(DOM::Document const& document, URL::URL const& t
|
|||
// 2. If targetURL and documentURL differ in their scheme, username, password, host, or port components,
|
||||
// then return false.
|
||||
if (target_url.scheme() != document_url.scheme()
|
||||
|| target_url.raw_username() != document_url.raw_username()
|
||||
|| target_url.raw_password() != document_url.raw_password()
|
||||
|| target_url.username() != document_url.username()
|
||||
|| target_url.password() != document_url.password()
|
||||
|| target_url.host() != document_url.host()
|
||||
|| target_url.port() != document_url.port())
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue