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

Remove JavaScript realm dependency #219

Merged
merged 26 commits into from
Feb 27, 2024
Merged
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
e2e4725
Remove JavaScript realm dependency
yoshisatoyanagisawa Feb 16, 2024
8fd2654
Omit "struct" after [=URL Pattern=].
yoshisatoyanagisawa Feb 16, 2024
5baf900
Make the create algorithm to avoid breaking the existing callers.
yoshisatoyanagisawa Feb 16, 2024
f2dc8dd
Addressed comments.
yoshisatoyanagisawa Feb 19, 2024
9ef78bf
Remove realm dependencies from other spec integrations
yoshisatoyanagisawa Feb 19, 2024
d188a8d
Update spec.bs
yoshisatoyanagisawa Feb 21, 2024
32acfe3
Rename [=URL Pattern=] to [=URL pattern=]
yoshisatoyanagisawa Feb 21, 2024
52c1032
Another URLPattern to URL pattern rename.
yoshisatoyanagisawa Feb 21, 2024
0d5c24d
Move match as URL pattern's function
yoshisatoyanagisawa Feb 21, 2024
fa9383e
Also updated has regexp groups
yoshisatoyanagisawa Feb 21, 2024
a365f6d
Use associated URL pattern instead of URLPattern itself in algorithms
yoshisatoyanagisawa Feb 22, 2024
46a8a05
Revise [=create=] to return a created [=URL pattern=]
yoshisatoyanagisawa Feb 22, 2024
0914443
Applied the suggested change on URLPattern class.
yoshisatoyanagisawa Feb 22, 2024
e7b873d
Minor fix.
yoshisatoyanagisawa Feb 22, 2024
84f8a34
Make create exported
yoshisatoyanagisawa Feb 22, 2024
6a3c376
Update spec.bs
yoshisatoyanagisawa Feb 26, 2024
29ef4bd
Update spec.bs
yoshisatoyanagisawa Feb 26, 2024
4fa6e48
Omit the beginning "A" from items.
yoshisatoyanagisawa Feb 26, 2024
8075951
Hold on mentioning about {{URLPattern}} in the introduction.
yoshisatoyanagisawa Feb 26, 2024
9311ab2
Remove ", which must be set upon creation."
yoshisatoyanagisawa Feb 26, 2024
d51ad85
Combine three steps.
yoshisatoyanagisawa Feb 26, 2024
17d8a18
Revert the update on {{URLPattern}} to [=URL pattern=]
yoshisatoyanagisawa Feb 26, 2024
4e893ec
Rename from |urlpattern| to |urlPattern|
yoshisatoyanagisawa Feb 26, 2024
bf7a7c0
Implement the algorithm to build {{URLPattern}}
yoshisatoyanagisawa Feb 26, 2024
0699d52
Update spec.bs
yoshisatoyanagisawa Feb 26, 2024
62f5ffa
Update spec.bs
yoshisatoyanagisawa Feb 27, 2024
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
37 changes: 20 additions & 17 deletions spec.bs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ spec: URL; urlPrefix: https://url.spec.whatwg.org/

<h2 id=urlpattern-class>The {{URLPattern}} class</h2>

A {{URLPattern}} consists of several [=components=], each of which represents a [=/pattern string|pattern=] which could be matched against the corresponding component of a [=/URL=].
A {{URLPattern}} has an associated [=URL Pattern=], which consists of several [=components=], each of which represents a [=/pattern string|pattern=] which could be matched against the corresponding component of a [=/URL=].

It can be constructed using a string for each component, or from a shorthand string. It can optionally be resolved relative to a base URL.

Expand Down Expand Up @@ -224,21 +224,21 @@ dictionary URLPatternComponentResult {
};
</xmp>

Each {{URLPattern}} object has an associated <dfn for=URLPattern>protocol component</dfn>, a [=component=], which must be set upon creation.
Each [=URL Pattern=] struct has an associated <dfn for=URLPattern>protocol component</dfn>, a [=component=], which must be set upon creation.

Each {{URLPattern}} object has an associated <dfn for=URLPattern>username component</dfn>, a [=component=], which must be set upon creation.
Each [=URL Pattern=] struct has an associated <dfn for=URLPattern>username component</dfn>, a [=component=], which must be set upon creation.

Each {{URLPattern}} object has an associated <dfn for=URLPattern>password component</dfn>, a [=component=], which must be set upon creation.
Each [=URL Pattern=] struct has an associated <dfn for=URLPattern>password component</dfn>, a [=component=], which must be set upon creation.

Each {{URLPattern}} object has an associated <dfn for=URLPattern>hostname component</dfn>, a [=component=], which must be set upon creation.
Each [=URL Pattern=] struct has an associated <dfn for=URLPattern>hostname component</dfn>, a [=component=], which must be set upon creation.

Each {{URLPattern}} object has an associated <dfn for=URLPattern>port component</dfn>, a [=component=], which must be set upon creation.
Each [=URL Pattern=] struct has an associated <dfn for=URLPattern>port component</dfn>, a [=component=], which must be set upon creation.

Each {{URLPattern}} object has an associated <dfn for=URLPattern>pathname component</dfn>, a [=component=], which must be set upon creation.
Each [=URL Pattern=] struct has an associated <dfn for=URLPattern>pathname component</dfn>, a [=component=], which must be set upon creation.

Each {{URLPattern}} object has an associated <dfn for=URLPattern>search component</dfn>, a [=component=], which must be set upon creation.
Each [=URL Pattern=] struct has an associated <dfn for=URLPattern>search component</dfn>, a [=component=], which must be set upon creation.

Each {{URLPattern}} object has an associated <dfn for=URLPattern>hash component</dfn>, a [=component=], which must be set upon creation.
Each [=URL Pattern=] struct has an associated <dfn for=URLPattern>hash component</dfn>, a [=component=], which must be set upon creation.

<dl class="domintro non-normative">
<dt><code>|urlPattern| = new {{URLPattern/constructor(input, baseURL, options)|URLPattern}}(|input|)</code></dt>
Expand Down Expand Up @@ -338,17 +338,17 @@ Each {{URLPattern}} object has an associated <dfn for=URLPattern>hash component<
<div algorithm>
The <dfn constructor for=URLPattern lt="URLPattern(input, baseURL, options)">new URLPattern(|input|, |baseURL|, |options|)</dfn> constructor steps are:

1. Run [=initialize=] given [=this=], |input|, |baseURL|, and |options|.
1. Run [=initialize=] given [=this=]'s associated [=URL Pattern=], |input|, |baseURL|, and |options|.
</div>

<div algorithm>
The <dfn constructor for=URLPattern lt="URLPattern(input, options)">new URLPattern(|input|, |options|)</dfn> constructor steps are:

1. Run [=initialize=] given [=this=], |input|, null, and |options|.
1. Run [=initialize=] given [=this=]'s associated [=URL Pattern=], |input|, null, and |options|.
</div>

<div algorithm>
To <dfn for=URLPattern>initialize</dfn> a {{URLPattern}} given a {{URLPattern}} |this|, {{URLPatternInput}} |input|, string or null |baseURL|, and {{URLPatternOptions}} |options|:
To <dfn for=URLPattern>initialize</dfn> a [=URL Pattern=] given a [=URL Pattern=] |this|, {{URLPatternInput}} |input|, string or null |baseURL|, and {{URLPatternOptions}} |options|:

1. Let |init| be null.
1. If |input| is a [=scalar value string=] then:
Expand Down Expand Up @@ -436,20 +436,22 @@ Each {{URLPattern}} object has an associated <dfn for=URLPattern>hash component<
<div algorithm>
The <dfn method for="URLPattern">test(|input|, |baseURL|)</dfn> method steps are:

1. Let |result| be the result of [=URLPattern/match=] given [=this=], |input|, and |baseURL| if given.
1. Let |result| be the result of [=URLPattern/match=] given [=this=]'s associated [=URL Pattern=], |input|, and |baseURL| if given.
1. If |result| is null, return false.
1. Return true.
</div>

<div algorithm>
The <dfn method for="URLPattern">exec(|input|, |baseURL|)</dfn> method steps are:

1. Return the result of [=URLPattern/match=] given [=this=], |input|, and |baseURL| if given.
1. Return the result of [=URLPattern/match=] given [=this=]'s associated [=URL Pattern=], |input|, and |baseURL| if given.
</div>

<h3 id=urlpattern-internals>Internals</h3>

A {{URLPattern}} is associated with multiple <dfn>component</dfn> [=structs=].
A {{URLPattern}} has an associated <dfn>URL pattern</dfn> [=structs=].

A [=URL pattern=] is associated with multiple <dfn>component</dfn> [=structs=].

A [=component=] has an associated <dfn for=component>pattern string</dfn>, a [=pattern string/well formed=] [=/pattern string=], which must be set upon creation.

Expand Down Expand Up @@ -477,8 +479,9 @@ A [=component=] has an associated <dfn for=component>has regexp groups</dfn>, a
</div>

<div algorithm>
A {{URLPattern}} |pattern| <dfn export for=URLPattern>has regexp groups</dfn> if the following steps return true:
A {{URLPattern}} |urlpattern| <dfn export for=URLPattern>has regexp groups</dfn> if the following steps return true:

1. Let |pattern| be |urlpattern|'s associated [=URL Pattern=].
1. If |pattern|'s [=URLPattern/protocol component=] [=component/has regexp groups=] is true, then return true.
1. If |pattern|'s [=URLPattern/username component=] [=component/has regexp groups=] is true, then return true.
1. If |pattern|'s [=URLPattern/password component=] [=component/has regexp groups=] is true, then return true.
Expand All @@ -491,7 +494,7 @@ A [=component=] has an associated <dfn for=component>has regexp groups</dfn>, a
</div>

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

1. Let |protocol| be the empty string.
1. Let |username| be the empty string.
Expand Down