mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 04:39:06 +00:00
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:
parent
8b984c0c57
commit
90e763de4c
Notes:
github-actions[bot]
2024-11-30 11:24:09 +00:00
Author: https://github.com/AtkinsSJ
Commit: 90e763de4c
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2610
Reviewed-by: https://github.com/shannonbooth ✅
17 changed files with 44 additions and 42 deletions
|
@ -203,7 +203,7 @@ WebIDL::ExceptionOr<String> Location::host() const
|
|||
auto url = this->url();
|
||||
|
||||
// 3. If url's host is null, return the empty string.
|
||||
if (url.host().has<Empty>())
|
||||
if (!url.host().has_value())
|
||||
return String {};
|
||||
|
||||
// 4. If url's port is null, return url's host, serialized.
|
||||
|
@ -233,7 +233,7 @@ WebIDL::ExceptionOr<String> Location::hostname() const
|
|||
auto url = this->url();
|
||||
|
||||
// 2. If this's url's host is null, return the empty string.
|
||||
if (url.host().has<Empty>())
|
||||
if (!url.host().has_value())
|
||||
return String {};
|
||||
|
||||
// 3. Return this's url's host, serialized.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue