Bug 1700421 [wpt PR 28192] - URLPattern: Allow a second argument to test()/exec(...
commit5ead681f2da55dcadf7605cc6a6f852c89dd201c
authorBen Kelly <wanderview@chromium.org>
Sat, 27 Mar 2021 11:06:21 +0000 (27 11:06 +0000)
committermoz-wptsync-bot <wptsync@mozilla.com>
Sat, 27 Mar 2021 17:41:14 +0000 (27 17:41 +0000)
tree5cb0f270cf924c37ec1394f4ae4afbbca02e453c
parent11e951f7e72c9db73ba17524ff46414c91a1c828
Bug 1700421 [wpt PR 28192] - URLPattern: Allow a second argument to test()/exec() for baseURL., a=testonly

Automatic update from web-platform-tests
URLPattern: Allow a second argument to test()/exec() for baseURL.

This CL adds support for code to pass a secondary argument to test()
and exec() to act as a baseURL.  For example:

  pattern.test('./index.html', self.location);

To support this the webidl was restructured to have separate method
overloads for USVString and URLPatternInit inputs.  In addition, the
internal implementation was refactored to account for the fact that
a union type is no longer used for the input.

Finally, there was one open question about what to reflect in the
`input` property on the URLPatternResult returned from exec().  This
property contains the input passed to exec().  In the past this was
always a single value, but now there are two values.  This CL deals
with the situation by populating `result.input` with the fully resolved
URL when a baseURL is present.  This is a bit inconsistent with the
value when populated in other cases, but seems less weird than trying
to use an array or secondary property.

Bug: 1141510
Change-Id: Ia247f59b1541ca254ba7d1d871f64d65a7b0b7e6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2779364
Reviewed-by: Jeremy Roman <jbroman@chromium.org>
Commit-Queue: Ben Kelly <wanderview@chromium.org>
Cr-Commit-Position: refs/heads/master@{#865794}

--

wpt-commits: 0d7dd845ec0c0482cbd8c11bddafe9878dc32522
wpt-pr: 28192
testing/web-platform/tests/urlpattern/resources/urlpatterntestdata.json
testing/web-platform/tests/urlpattern/urlpattern.https.any.js