LibURL: Replace Host's Empty state with making Url's Host optional

A couple of reasons:
- Origin's Host (when in the tuple state) can't be null
- There's an "empty host" concept in the spec which is NOT the same as a
  null Host, and that was confusing me.
This commit is contained in:
Sam Atkins 2024-11-27 12:48:28 +00:00 committed by Andreas Kling
commit 90e763de4c
Notes: github-actions[bot] 2024-11-30 11:24:09 +00:00
17 changed files with 44 additions and 42 deletions

View file

@ -44,7 +44,7 @@ bool url_matches_about_blank(URL::URL const& url)
&& url.paths().size() == 1 && url.paths()[0] == "blank"sv
&& url.username().is_empty()
&& url.password().is_empty()
&& url.host().has<Empty>();
&& !url.host().has_value();
}
// https://html.spec.whatwg.org/multipage/urls-and-fetching.html#matches-about:srcdoc
@ -56,7 +56,7 @@ bool url_matches_about_srcdoc(URL::URL const& url)
&& !url.query().has_value()
&& url.username().is_empty()
&& url.password().is_empty()
&& url.host().has<Empty>();
&& !url.host().has_value();
}
// https://html.spec.whatwg.org/multipage/document-sequences.html#determining-the-origin