-
Notifications
You must be signed in to change notification settings - Fork 22
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
Add a section on other specs integrating with URLPattern #199
Conversation
A section which covers how other specifications should use URLPattern and how developer-facing APIs should work is added, along with helpful algorithms. One of these is whether a pattern has regexp groups (which may require an ECMAScript regexp engine); a corresponding WebIDL attribute is added to expose this property to authors as well.
spec.bs
Outdated
1. Otherwise, if |rawPattern| is a [=map=], then: | ||
1. Let |init| be «[ "`baseURL`" → |serializedBaseURL| ]», representing a dictionary of type {{URLPatternInit}}. | ||
1. [=map/For each=] |key| → |value| of |rawPattern|: | ||
1. If |key| is not the [=identifier=] of a [=dictionary member=] of {{URLPatternInit}} or one of its [=inherited dictionaries=], |value| is not a [=string=], or the member's type is not declared to be {{USVString}}, then return null. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not 100% clear to me that every spec wants the kind of restrictive error handling we've used here. But I feel like we discussed this in the past when writing the speculation rules spec. I'm OK carrying it over for now, until someone raises an issue.
spec.bs
Outdated
1. Return a new [=component=] whose [=component/pattern string=] is |pattern string|, [=component/regular expression=] is |regular expression|, and [=component/group name list=] is |name list|. | ||
1. Let |has regexp groups| be false. | ||
1. [=list/For each=] |part| of |part list|: | ||
1. If |part|'s [=part/type=] is "<a for=token/type>`regexp`</a>", then set |has regexp groups| to true. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<a for=token/type>`regexp`</a>
: part/type
is correct instead of token/type
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're correct; done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found a few more nits, but it's looking quite nice to me.
It might be worth adding (either here or in a followup PR) a section on using URL patterns in HTTP fields, since that's another use case that's coming up in practice. Initial thoughts:
- Encourage just using strings for now, and not necessarily accepting dictionaries
- The algorithm can be a wrapper around "build a URLPattern from an Infra value" that is only ever called with a string
- Give them some help on figuring out exactly which base URL to use. Maybe consider both the request and response header cases?
- Maybe omit the realm argument and just use "an implementation-defined realm", because it's quite silly to make HTTP specs deal with realms? We can still have an XXX box, but I'd hate to have the realm as part of the public interface for this particular call site. (Related discussion regarding "implementation-defined realm": "Parse JSON to Infra" algorithms shouldn't require a current JS realm infra#625)
Yeah, I thought about including HTTP fields in this PR, but wasn't sure if we'd hammered out enough of the details yet. At surface I would have thought the constructor string syntax would have been the most natural fit, but from what I understand of WICG/compression-dictionary-transport#52 they're currently looking at separate Besides that one I don't have a clear enough concept of the likely uses to be confident writing guidance, and would probably rather they file an issue or otherwise bring it up to us for now. |
Hmm, we should discuss with them what's going on. This seems contrary to the design of URL patterns... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. It'd be great to get @yoshisatoyanagisawa's review as well, as someone who would be working on the service worker static routing spec, which follows these guidelines.
While I'm here, want to note -- the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I think the new sections explain well. SW static routing API would be able to follow this change.
To promote consistency on the web platform, other documents integrating with this specification should adhere to the following guidelines, unless there is good reason to diverge. | ||
|
||
1. **Accept shorthands**. Most author patterns will be simple and straightforward. Accordingly, APIs should accept shorthands for those common cases and avoid the need for authors to take additional steps to transform these into complete {{URLPattern}} objects. | ||
1. **Respect the base URL**. Just as URLs are generally parsed relative to a base URL for their environment (most commonly, a [=document base URL=]), URL patterns should respect this as well. The {{URLPattern}} constructor itself is an exception because it directly exposes the concept itself, similar to how the <a interface spec=URL>URL</a> constructor does not respect the base URL even though the rest of the platform does. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"most commonly" might mean that each specification can choose the base URL to something most relevant to it, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Below it suggests the environment settings object's API base URL, which is the document base URL most of the time (in a document), but in a worker it's the global scope's base URL. In an HTTP header it would probably be the request or response URL. Most of the time there's a fairly strong precedent about what URLs are resolved relative to already, and specs should probably follow that unless they have a compelling reason to deviate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok. thanks for the clarification.
spec.bs
Outdated
To accomplish this, specifications should accept {{URLPatternCompatible}} as an argument to an [=operation=] or [=dictionary member=], and process it using the following algorithm, using the appropriate [=environment settings object=]'s [=environment settings object/API base URL=] or equivalent. | ||
|
||
<div algorithm> | ||
To <dfn for=URLPattern>build a {{URLPattern}} from a WebIDL value</dfn> {{URLPatternCompatible}} |input| given [=/URL=] |baseURL| and [=ECMAScript/realm=]</a> |realm|, perform the following steps: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit but where is a counterpart of this ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand what you're asking; can you elaborate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, I should have updated this when I noticed the comment can only be given per line X(
In this line, there is </a>
. However, I could not find opening of this </a>
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was an mistakenly left behind when rewriting back and forth between Bikeshed shorthand and <a>
syntax. Thanks for catching; removed.
<p class="XXX">Ideally we wouldn't need a realm here. If we extricate the URL pattern concept from the {{URLPattern}} interface, we won't anymore.</p> | ||
</div> | ||
|
||
This allows authors to concisely specify most patterns, and use the <a constructor for="URLPattern">constructor</a> to access uncommon options if necessary. The implicit use of the base URL is similar to, and consistent with, <cite>HTML</cite>'s [=parse a URL=] algorithm. [[HTML]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit but this phrase reminds me #200. It seems that the URLPattern initialization for the short-hand is slightly different from the URL algorithm.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is indeed slightly different, yeah. Still, I think it's good to keep it broadly similar where we can.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. I hope we can discuss about the topic in #200.
Thanks for looping me in, @domenic. |
Given the comments like
over in WICG/compression-dictionary-transport#52 it seems like it'd be good to add a section on HTTP header usage, either in this PR or as a near-future followup. |
This behavior change was originally started in whatwg/urlpattern#182, and follows the spec change in whatwg/urlpattern#199. This CL changes the behavior of the router rule registration in the ServiceWorker Static Routing API, especially when the |urlPattern| condition receives URLPatternInit or USVString. Before this CL, the URLPatternInit input was accepted as it is, that means any unspecified fields are resulted in the wildcards (*). This behavior is inconsistent with the case when |urlPattern| accepts a string. When a string is passed, missing fields are complemented by baseURL, the SW script URL is internally treated as baseURL. After this CL, the URLPatternInit input also internally uses the SW script URL as a baseURL if it's not explicitly provided. This is achieved by the helper method `URLPattern::From()`, which was added in [1]. This change doesn't affect the case when the input is URLPattern, which means the input is the object constructed via `new URLPattern()`. [1] crrev.com/c/5053645 Bug: 1371756 Change-Id: I5cce80fde05cf18237c8b6412b00e017ff5aad5b
This behavior change was originally started in whatwg/urlpattern#182, and follows the spec change in whatwg/urlpattern#199. This CL changes the behavior of the router rule registration in the ServiceWorker Static Routing API, especially when the |urlPattern| condition receives URLPatternInit or USVString. Before this CL, the URLPatternInit input was accepted as it is, that means any unspecified fields are resulted in the wildcards (*). This behavior is inconsistent with the case when |urlPattern| accepts a string. When a string is passed, missing fields are complemented by baseURL, the SW script URL is internally treated as baseURL. After this CL, the URLPatternInit input also internally uses the SW script URL as a baseURL if it's not explicitly provided. This is achieved by the helper method `URLPattern::From()`, which was added in [1]. This change doesn't affect the case when the input is URLPattern, which means the input is the object constructed via `new URLPattern()`. [1] crrev.com/c/5053645 Bug: 1371756 Change-Id: I5cce80fde05cf18237c8b6412b00e017ff5aad5b
I agree it would be good to cover once we're agreed on what to do and feel fairly confident it will generalize. I was hoping to avoid entangling these two, so doing HTTP header fields in a followup. It feels slightly silly to write our opinions here and then turn around and use ourselves as authority to back up our own position, but if that's helpful we can do that too. |
This behavior change was originally started in whatwg/urlpattern#182, and follows the spec change in whatwg/urlpattern#199. This CL changes the behavior of the router rule registration in the ServiceWorker Static Routing API, especially when the |urlPattern| condition receives URLPatternInit or USVString. Before this CL, the URLPatternInit input was accepted as it is, that means any unspecified fields are resulted in the wildcards (*). This behavior is inconsistent with the case when |urlPattern| accepts a string. When a string is passed, missing fields are complemented by baseURL, the SW script URL is internally treated as baseURL. After this CL, the URLPatternInit input also internally uses the SW script URL as a baseURL if it's not explicitly provided. This is achieved by the helper method `URLPattern::From()`, which was added in [1]. This change doesn't affect the case when the input is URLPattern, which means the input is the object constructed via `new URLPattern()`. [1] crrev.com/c/5053645 Bug: 1371756 Change-Id: I5cce80fde05cf18237c8b6412b00e017ff5aad5b
This behavior change was originally started in whatwg/urlpattern#182, and follows the spec change in whatwg/urlpattern#199. This CL changes the behavior of the router rule registration in the ServiceWorker Static Routing API, especially when the |urlPattern| condition receives URLPatternInit or USVString. Before this CL, the URLPatternInit input was accepted as it is, that means any unspecified fields are resulted in the wildcards (*). This behavior is inconsistent with the case when |urlPattern| accepts a string. When a string is passed, missing fields are complemented by baseURL, the SW script URL is internally treated as baseURL. After this CL, the URLPatternInit input also internally uses the SW script URL as a baseURL if it's not explicitly provided. This is achieved by the helper method `URLPattern::From()`, which was added in [1]. This change doesn't affect the case when the input is URLPattern, which means the input is the object constructed via `new URLPattern()`. [1] crrev.com/c/5053645 Bug: 1371756 Change-Id: I5cce80fde05cf18237c8b6412b00e017ff5aad5b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5039680 Reviewed-by: Takashi Toyoshima <[email protected]> Reviewed-by: Kouhei Ueno <[email protected]> Commit-Queue: Shunya Shishido <[email protected]> Reviewed-by: Yoshisato Yanagisawa <[email protected]> Auto-Submit: Shunya Shishido <[email protected]> Cr-Commit-Position: refs/heads/main@{#1229724}
This behavior change was originally started in whatwg/urlpattern#182, and follows the spec change in whatwg/urlpattern#199. This CL changes the behavior of the router rule registration in the ServiceWorker Static Routing API, especially when the |urlPattern| condition receives URLPatternInit or USVString. Before this CL, the URLPatternInit input was accepted as it is, that means any unspecified fields are resulted in the wildcards (*). This behavior is inconsistent with the case when |urlPattern| accepts a string. When a string is passed, missing fields are complemented by baseURL, the SW script URL is internally treated as baseURL. After this CL, the URLPatternInit input also internally uses the SW script URL as a baseURL if it's not explicitly provided. This is achieved by the helper method `URLPattern::From()`, which was added in [1]. This change doesn't affect the case when the input is URLPattern, which means the input is the object constructed via `new URLPattern()`. [1] crrev.com/c/5053645 Bug: 1371756 Change-Id: I5cce80fde05cf18237c8b6412b00e017ff5aad5b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5039680 Reviewed-by: Takashi Toyoshima <[email protected]> Reviewed-by: Kouhei Ueno <[email protected]> Commit-Queue: Shunya Shishido <[email protected]> Reviewed-by: Yoshisato Yanagisawa <[email protected]> Auto-Submit: Shunya Shishido <[email protected]> Cr-Commit-Position: refs/heads/main@{#1229724}
This behavior change was originally started in whatwg/urlpattern#182, and follows the spec change in whatwg/urlpattern#199. This CL changes the behavior of the router rule registration in the ServiceWorker Static Routing API, especially when the |urlPattern| condition receives URLPatternInit or USVString. Before this CL, the URLPatternInit input was accepted as it is, that means any unspecified fields are resulted in the wildcards (*). This behavior is inconsistent with the case when |urlPattern| accepts a string. When a string is passed, missing fields are complemented by baseURL, the SW script URL is internally treated as baseURL. After this CL, the URLPatternInit input also internally uses the SW script URL as a baseURL if it's not explicitly provided. This is achieved by the helper method `URLPattern::From()`, which was added in [1]. This change doesn't affect the case when the input is URLPattern, which means the input is the object constructed via `new URLPattern()`. [1] crrev.com/c/5053645 Bug: 1371756 Change-Id: I5cce80fde05cf18237c8b6412b00e017ff5aad5b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5039680 Reviewed-by: Takashi Toyoshima <[email protected]> Reviewed-by: Kouhei Ueno <[email protected]> Commit-Queue: Shunya Shishido <[email protected]> Reviewed-by: Yoshisato Yanagisawa <[email protected]> Auto-Submit: Shunya Shishido <[email protected]> Cr-Commit-Position: refs/heads/main@{#1229724}
@jeremyroman I don't understand the references to Deno in #199 (comment). WebKit is supportive of figuring out an interface to URLPattern so it can be reused in environments where regular expression engines are a no-no. I'm not entirely sure that the JavaScript API needs to make the difference observable (as that won't be accessible in those environments), but I guess it's reasonable. |
Those were supposed to be links to issues in this repository; for some reason Github autolinked to the wrong repository. (???)
One reason might be registering service worker static routes, where the pattern is registered from a JavaScript environment but evaluated in the fetch handling path. |
Makes sense, yeah. I do think we need a string-only version (realm-free) of the part you're not explicitly seeking feedback on yet, but we can get there through iteration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should also export the "match" definition https://urlpattern.spec.whatwg.org/#match
@yoshisatoyanagisawa @domenic still lgty both? I'll merge if so, as I think we've met the process requirements. |
Still LGTM except I don't think you saw this comment:
|
Thanks for heads up. |
Whoops, super easy to miss unfortunately because of how GitHub requires me to switch to Files to be able to start a review (and not send tons of individual emails), which hides comments not attached to lines. Will fix. |
…while routing rule registration, a=testonly Automatic update from web-platform-tests Add baseURL to the URLPattern condition while routing rule registration This behavior change was originally started in whatwg/urlpattern#182, and follows the spec change in whatwg/urlpattern#199. This CL changes the behavior of the router rule registration in the ServiceWorker Static Routing API, especially when the |urlPattern| condition receives URLPatternInit or USVString. Before this CL, the URLPatternInit input was accepted as it is, that means any unspecified fields are resulted in the wildcards (*). This behavior is inconsistent with the case when |urlPattern| accepts a string. When a string is passed, missing fields are complemented by baseURL, the SW script URL is internally treated as baseURL. After this CL, the URLPatternInit input also internally uses the SW script URL as a baseURL if it's not explicitly provided. This is achieved by the helper method `URLPattern::From()`, which was added in [1]. This change doesn't affect the case when the input is URLPattern, which means the input is the object constructed via `new URLPattern()`. [1] crrev.com/c/5053645 Bug: 1371756 Change-Id: I5cce80fde05cf18237c8b6412b00e017ff5aad5b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5039680 Reviewed-by: Takashi Toyoshima <[email protected]> Reviewed-by: Kouhei Ueno <[email protected]> Commit-Queue: Shunya Shishido <[email protected]> Reviewed-by: Yoshisato Yanagisawa <[email protected]> Auto-Submit: Shunya Shishido <[email protected]> Cr-Commit-Position: refs/heads/main@{#1229724} -- wpt-commits: ffe06ef95d4d48be147e640fd9d1c489b810f929 wpt-pr: 43272
…while routing rule registration, a=testonly Automatic update from web-platform-tests Add baseURL to the URLPattern condition while routing rule registration This behavior change was originally started in whatwg/urlpattern#182, and follows the spec change in whatwg/urlpattern#199. This CL changes the behavior of the router rule registration in the ServiceWorker Static Routing API, especially when the |urlPattern| condition receives URLPatternInit or USVString. Before this CL, the URLPatternInit input was accepted as it is, that means any unspecified fields are resulted in the wildcards (*). This behavior is inconsistent with the case when |urlPattern| accepts a string. When a string is passed, missing fields are complemented by baseURL, the SW script URL is internally treated as baseURL. After this CL, the URLPatternInit input also internally uses the SW script URL as a baseURL if it's not explicitly provided. This is achieved by the helper method `URLPattern::From()`, which was added in [1]. This change doesn't affect the case when the input is URLPattern, which means the input is the object constructed via `new URLPattern()`. [1] crrev.com/c/5053645 Bug: 1371756 Change-Id: I5cce80fde05cf18237c8b6412b00e017ff5aad5b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5039680 Reviewed-by: Takashi Toyoshima <[email protected]> Reviewed-by: Kouhei Ueno <[email protected]> Commit-Queue: Shunya Shishido <[email protected]> Reviewed-by: Yoshisato Yanagisawa <[email protected]> Auto-Submit: Shunya Shishido <[email protected]> Cr-Commit-Position: refs/heads/main@{#1229724} -- wpt-commits: ffe06ef95d4d48be147e640fd9d1c489b810f929 wpt-pr: 43272
…while routing rule registration, a=testonly Automatic update from web-platform-tests Add baseURL to the URLPattern condition while routing rule registration This behavior change was originally started in whatwg/urlpattern#182, and follows the spec change in whatwg/urlpattern#199. This CL changes the behavior of the router rule registration in the ServiceWorker Static Routing API, especially when the |urlPattern| condition receives URLPatternInit or USVString. Before this CL, the URLPatternInit input was accepted as it is, that means any unspecified fields are resulted in the wildcards (*). This behavior is inconsistent with the case when |urlPattern| accepts a string. When a string is passed, missing fields are complemented by baseURL, the SW script URL is internally treated as baseURL. After this CL, the URLPatternInit input also internally uses the SW script URL as a baseURL if it's not explicitly provided. This is achieved by the helper method `URLPattern::From()`, which was added in [1]. This change doesn't affect the case when the input is URLPattern, which means the input is the object constructed via `new URLPattern()`. [1] crrev.com/c/5053645 Bug: 1371756 Change-Id: I5cce80fde05cf18237c8b6412b00e017ff5aad5b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5039680 Reviewed-by: Takashi Toyoshima <toyoshimchromium.org> Reviewed-by: Kouhei Ueno <kouheichromium.org> Commit-Queue: Shunya Shishido <sisidovskichromium.org> Reviewed-by: Yoshisato Yanagisawa <yyanagisawachromium.org> Auto-Submit: Shunya Shishido <sisidovskichromium.org> Cr-Commit-Position: refs/heads/main{#1229724} -- wpt-commits: ffe06ef95d4d48be147e640fd9d1c489b810f929 wpt-pr: 43272 UltraBlame original commit: 8cba5e465039e56ad23ca65c4e4b1c307f2f8379
…while routing rule registration, a=testonly Automatic update from web-platform-tests Add baseURL to the URLPattern condition while routing rule registration This behavior change was originally started in whatwg/urlpattern#182, and follows the spec change in whatwg/urlpattern#199. This CL changes the behavior of the router rule registration in the ServiceWorker Static Routing API, especially when the |urlPattern| condition receives URLPatternInit or USVString. Before this CL, the URLPatternInit input was accepted as it is, that means any unspecified fields are resulted in the wildcards (*). This behavior is inconsistent with the case when |urlPattern| accepts a string. When a string is passed, missing fields are complemented by baseURL, the SW script URL is internally treated as baseURL. After this CL, the URLPatternInit input also internally uses the SW script URL as a baseURL if it's not explicitly provided. This is achieved by the helper method `URLPattern::From()`, which was added in [1]. This change doesn't affect the case when the input is URLPattern, which means the input is the object constructed via `new URLPattern()`. [1] crrev.com/c/5053645 Bug: 1371756 Change-Id: I5cce80fde05cf18237c8b6412b00e017ff5aad5b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5039680 Reviewed-by: Takashi Toyoshima <toyoshimchromium.org> Reviewed-by: Kouhei Ueno <kouheichromium.org> Commit-Queue: Shunya Shishido <sisidovskichromium.org> Reviewed-by: Yoshisato Yanagisawa <yyanagisawachromium.org> Auto-Submit: Shunya Shishido <sisidovskichromium.org> Cr-Commit-Position: refs/heads/main{#1229724} -- wpt-commits: ffe06ef95d4d48be147e640fd9d1c489b810f929 wpt-pr: 43272 UltraBlame original commit: 8cba5e465039e56ad23ca65c4e4b1c307f2f8379
…while routing rule registration, a=testonly Automatic update from web-platform-tests Add baseURL to the URLPattern condition while routing rule registration This behavior change was originally started in whatwg/urlpattern#182, and follows the spec change in whatwg/urlpattern#199. This CL changes the behavior of the router rule registration in the ServiceWorker Static Routing API, especially when the |urlPattern| condition receives URLPatternInit or USVString. Before this CL, the URLPatternInit input was accepted as it is, that means any unspecified fields are resulted in the wildcards (*). This behavior is inconsistent with the case when |urlPattern| accepts a string. When a string is passed, missing fields are complemented by baseURL, the SW script URL is internally treated as baseURL. After this CL, the URLPatternInit input also internally uses the SW script URL as a baseURL if it's not explicitly provided. This is achieved by the helper method `URLPattern::From()`, which was added in [1]. This change doesn't affect the case when the input is URLPattern, which means the input is the object constructed via `new URLPattern()`. [1] crrev.com/c/5053645 Bug: 1371756 Change-Id: I5cce80fde05cf18237c8b6412b00e017ff5aad5b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5039680 Reviewed-by: Takashi Toyoshima <toyoshimchromium.org> Reviewed-by: Kouhei Ueno <kouheichromium.org> Commit-Queue: Shunya Shishido <sisidovskichromium.org> Reviewed-by: Yoshisato Yanagisawa <yyanagisawachromium.org> Auto-Submit: Shunya Shishido <sisidovskichromium.org> Cr-Commit-Position: refs/heads/main{#1229724} -- wpt-commits: ffe06ef95d4d48be147e640fd9d1c489b810f929 wpt-pr: 43272 UltraBlame original commit: 8cba5e465039e56ad23ca65c4e4b1c307f2f8379
A section which covers how other specifications should use URLPattern and how developer-facing APIs should work is added, along with helpful algorithms.
One of these is whether a pattern has regexp groups (which may require an ECMAScript regexp engine); a corresponding WebIDL attribute is added to expose this property to authors as well.
(See WHATWG Working Mode: Changes for more details.)
Preview | Diff