Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the basic URL parser when parsing URLs #248

Merged
merged 2 commits into from
Jan 9, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions spec.bs
Original file line number Diff line number Diff line change
Expand Up @@ -513,10 +513,10 @@ A <dfn>component</dfn> is a [=struct=] with the following [=struct/items=]:
1. If |input| is a {{USVString}}:
1. Let |baseURL| be null.
1. If |baseURLString| was given, then:
1. Set |baseURL| to the result of [=URL parser|parsing=] |baseURLString|.
1. Set |baseURL| to the result of running the [=basic URL parser=] on |baseURLString|.
1. If |baseURL| is failure, return null.
1. [=list/Append=] |baseURLString| to |inputs|.
1. Set |url| to the result of [=URL parser|parsing=] |input| given |baseURL|.
1. Set |url| to the result of running the [=basic URL parser=] on |input| with |baseURL|.
1. If |url| is failure, return null.
1. [=Assert=]: |url| is a [=/URL=].
1. Set |protocol| to |url|'s [=url/scheme=].
Expand Down Expand Up @@ -1852,7 +1852,7 @@ To <dfn>convert a modifier to a string</dfn> given a [=part/modifier=] |modifier

Username and password are also never inherited from a base URL when constructing a {{URLPattern}}. (They are, however, inherited from the base URL when parsing a URL supplied as an argument to {{URLPattern/test()}} or {{URLPattern/exec()}}.)
</div>
1. Set |baseURL| to the result of [=URL parser|parsing=] |init|["{{URLPatternInit/baseURL}}"].
1. Set |baseURL| to the result of running the [=basic URL parser=] on |init|["{{URLPatternInit/baseURL}}"].
1. If |baseURL| is failure, then throw a {{TypeError}}.
1. If |init|["{{URLPatternInit/protocol}}"] does not [=map/exist=], then set |result|["{{URLPatternInit/protocol}}"] to the result of [=processing a base URL string=] given |baseURL|'s [=url/scheme=] and |type|.
1. If |type| is not "`pattern`" and |init| [=map/contains=] none of "{{URLPatternInit/protocol}}", "{{URLPatternInit/hostname}}", "{{URLPatternInit/port}}" and "{{URLPatternInit/username}}", then set |result|["{{URLPatternInit/username}}"] to the result of [=processing a base URL string=] given |baseURL|'s [=url/username=] and |type|.
Expand Down