Bug 1845951 [wpt PR 41226] - Allow urlPattern field to take URLPatternInit., a=testonly
commit936b92ee834a7527e97b4410feca44027ff6b45e
authorYoshisato Yanagisawa <yyanagisawa@chromium.org>
Wed, 9 Aug 2023 10:49:20 +0000 (9 10:49 +0000)
committermoz-wptsync-bot <wptsync@mozilla.com>
Thu, 10 Aug 2023 14:58:55 +0000 (10 14:58 +0000)
tree11070b893979f497239bbed09f56f661ad49eda9
parent520da8a54414d3c01e51c3c95a6487a8d8c49769
Bug 1845951 [wpt PR 41226] - Allow urlPattern field to take URLPatternInit., a=testonly

Automatic update from web-platform-tests
Allow urlPattern field to take URLPatternInit.

This is something told in:
https://github.com/yoshisatoyanagisawa/service-worker-static-routing-api/blob/main/final-form.md

To allow people to write a complex pattern and make URLPattern
understand it, let me make URLPatternInit also supported.
With this way, people can write like:

condition: {
  urlPattern: new URLPattern("*://example.com/*.ico")
}

With this change, we also changed the string URLPattern behavior.
It used to be thought as the pathname URL pattern.
i.e. equivalent behavior to:
  URLPattern({pathname: "<given argument>"}).
However, now it silently sets the ServiceWorker script's base URL
as the base URL.
i.e. URLPattern({pathname: "<given argument>"}, <script base URL>)

Bug: 1371756
Change-Id: I1f94e27f0dd76bbeb372878f3a9692fa094da8c0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4685593
Reviewed-by: Shunya Shishido <sisidovski@chromium.org>
Reviewed-by: Minoru Chikamune <chikamune@chromium.org>
Commit-Queue: Yoshisato Yanagisawa <yyanagisawa@chromium.org>
Reviewed-by: Giovanni Ortuno Urquidi <ortuno@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1177617}

--

wpt-commits: 8480d18f4bb810be5c8efc77f87daeb39c2300fb
wpt-pr: 41226
testing/web-platform/tests/service-workers/service-worker/tentative/static-router/resources/static-router-sw.js