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

Make the match algorithm accept the URL struct #221

Merged
merged 6 commits into from
Feb 29, 2024
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
19 changes: 11 additions & 8 deletions spec.bs
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ A <dfn>component</dfn> is a [=struct=] with the following [=struct/items=]:
</div>

<div algorithm>
To perform a <dfn export for="URL pattern">match</dfn> given a [=URL pattern=] |urlPattern|, a {{URLPatternInput}} |input|, and an optional string |baseURLString|:
To perform a <dfn export for="URL pattern">match</dfn> given a [=URL pattern=] |urlPattern|, a {{URLPatternInput}} or [=/URL=] |input|, and an optional string |baseURLString|:

1. Let |protocol| be the empty string.
1. Let |username| be the empty string.
Expand All @@ -492,13 +492,16 @@ A <dfn>component</dfn> is a [=struct=] with the following [=struct/items=]:
1. Set |search| to |applyResult|["{{URLPatternInit/search}}"].
1. Set |hash| to |applyResult|["{{URLPatternInit/hash}}"].
1. Otherwise:
1. Let |baseURL| be null.
1. If |baseURLString| was given, then:
1. Set |baseURL| to the result of [=URL parser|parsing=] |baseURLString|.
1. If |baseURL| is failure, return null.
1. [=list/Append=] |baseURLString| to |inputs|.
1. Let |url| be the result of [=URL parser|parsing=] |input| given |baseURL|.
1. If |url| is failure, return null.
1. Let |url| be |input|.
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. 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. If |url| is failure, return null.
1. [=Assert=]: |url| is a [=/URL=].
1. Set |protocol| to |url|'s [=url/scheme=].
1. Set |username| to |url|'s [=url/username=].
1. Set |password| to |url|'s [=url/password=].
Expand Down
Loading