mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-05 23:59:49 +00:00
LibWeb+LibURL: Use URL paths directly for comparison
This matches the text of the spec a little more closely in many cases and is also more efficient than serializing the URL path.
This commit is contained in:
parent
ea68bdef26
commit
ffe070d7f9
Notes:
github-actions[bot]
2024-08-05 07:59:07 +00:00
Author: https://github.com/shannonbooth
Commit: ffe070d7f9
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/966
5 changed files with 9 additions and 11 deletions
|
@ -40,7 +40,7 @@ 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.paths().size() == 1 && url.paths()[0] == "blank"sv
|
||||
&& url.username().is_empty()
|
||||
&& url.password().is_empty()
|
||||
&& url.host().has<Empty>();
|
||||
|
@ -51,7 +51,7 @@ bool url_matches_about_srcdoc(URL::URL const& url)
|
|||
{
|
||||
// A URL matches about:srcdoc if its scheme is "about", its path contains a single string "srcdoc", its query is null, its username and password are the empty string, and its host is null.
|
||||
return url.scheme() == "about"sv
|
||||
&& url.serialize_path() == "srcdoc"sv
|
||||
&& url.paths().size() == 1 && url.paths()[0] == "srcdoc"sv
|
||||
&& !url.query().has_value()
|
||||
&& url.username().is_empty()
|
||||
&& url.password().is_empty()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue