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

Add baseURL to the URLPattern condition while routing rule registration #43272

Merged
merged 1 commit into from
Nov 28, 2023

Conversation

chromium-wpt-export-bot
Copy link
Collaborator

@chromium-wpt-export-bot chromium-wpt-export-bot commented Nov 21, 2023

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}

Copy link
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The review process for this patch is being conducted in the Chromium project.

@chromium-wpt-export-bot chromium-wpt-export-bot changed the title Add baseURL to the URLPattern condition while routing rule regustration Add baseURL to the URLPattern condition while routing rule registration Nov 27, 2023
@chromium-wpt-export-bot chromium-wpt-export-bot force-pushed the chromium-export-cl-5039680 branch 4 times, most recently from 4f0f34f to 421e513 Compare November 28, 2023 01:57
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}
@chromium-wpt-export-bot chromium-wpt-export-bot merged commit ffe06ef into master Nov 28, 2023
10 of 14 checks passed
@chromium-wpt-export-bot chromium-wpt-export-bot deleted the chromium-export-cl-5039680 branch November 28, 2023 05:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants