mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-23 17:33:12 +00:00
LibURL: Rename 'cannot have a base URL' to 'has an opaque path'
This follows a rename made in the URL specification.
This commit is contained in:
parent
6b85748f53
commit
3f73cd30a2
Notes:
github-actions[bot]
2025-04-06 12:28:23 +00:00
Author: https://github.com/shannonbooth
Commit: 3f73cd30a2
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3847
Reviewed-by: https://github.com/trflynn89
8 changed files with 40 additions and 38 deletions
|
@ -288,11 +288,11 @@ String DOMURL::host() const
|
|||
return MUST(String::formatted("{}:{}", url.serialized_host(), *url.port()));
|
||||
}
|
||||
|
||||
// https://url.spec.whatwg.org/#dom-url-hostref-for-dom-url-host%E2%91%A0
|
||||
// https://url.spec.whatwg.org/#dom-url-host
|
||||
void DOMURL::set_host(String const& host)
|
||||
{
|
||||
// 1. If this’s URL’s cannot-be-a-base-URL is true, then return.
|
||||
if (m_url.cannot_be_a_base_url())
|
||||
// 1. If this’s URL has an opaque path, then return.
|
||||
if (m_url.has_an_opaque_path())
|
||||
return;
|
||||
|
||||
// 2. Basic URL parse the given value with this’s URL as url and host state as state override.
|
||||
|
@ -313,8 +313,8 @@ String DOMURL::hostname() const
|
|||
// https://url.spec.whatwg.org/#ref-for-dom-url-hostname①
|
||||
void DOMURL::set_hostname(String const& hostname)
|
||||
{
|
||||
// 1. If this’s URL’s cannot-be-a-base-URL is true, then return.
|
||||
if (m_url.cannot_be_a_base_url())
|
||||
// 1. If this’s URL has an opaque path, then return.
|
||||
if (m_url.has_an_opaque_path())
|
||||
return;
|
||||
|
||||
// 2. Basic URL parse the given value with this’s URL as url and hostname state as state override.
|
||||
|
@ -359,9 +359,8 @@ String DOMURL::pathname() const
|
|||
// https://url.spec.whatwg.org/#ref-for-dom-url-pathname%E2%91%A0
|
||||
void DOMURL::set_pathname(String const& pathname)
|
||||
{
|
||||
// FIXME: These steps no longer match the speci.
|
||||
// 1. If this’s URL’s cannot-be-a-base-URL is true, then return.
|
||||
if (m_url.cannot_be_a_base_url())
|
||||
// 1. If this’s URL has an opaque path, then return.
|
||||
if (m_url.has_an_opaque_path())
|
||||
return;
|
||||
|
||||
// 2. Empty this’s URL’s path.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue