Closed yoshisatoyanagisawa closed 9 months ago
Since URL is struct, we may need to do https://github.com/whatwg/urlpattern/issues/217 before this?
From a JS perspective, this works because URL
suffices for a URLPatternInit
dictionary (it exposes the necessary properties). If you're interested in calling this from another spec (rather than being concerned about the JS interface), maybe it would be convenient to have a spec helper which accepts URL records, sure.
Just FYI, but it was pointed out in https://github.com/w3c/ServiceWorker/pull/1701/files#r1484898361 while calling match
for the ServiceWorker static routing API.
I have updated the description to clarify that the match algorithm change is needed for the SW static routing API.
Making test()
or exec()
to accept the URL object is out of the scope because as @jeremyroman touched in https://github.com/whatwg/urlpattern/issues/218#issuecomment-1946247413, it is actually not needed for the external APIs.
What is the issue with the URL Pattern Standard?
In the ServiceWorker static routing API (https://github.com/w3c/ServiceWorker/pull/1701), the match algorithm is used for matching with a request URL, which is a URL. However, the specification expects either of
USVString
orURLPatternInit
as its input now.To fill the gap, we may need to make the match algorithm accept URL.