Closed Bug 1745953 Opened 2 years ago Closed 2 years ago

[wpt-sync] Sync PR 32021 - URLPattern: Avoid over-generating '{}' for custom names.

Categories

(Testing :: web-platform-tests, task, P4)

task

Tracking

(firefox97 fixed)

RESOLVED FIXED
97 Branch
Tracking Status
firefox97 --- fixed

People

(Reporter: mozilla.org, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 32021 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/32021
Details from upstream follow.

Ben Kelly <wanderview@chromium.org> wrote:

URLPattern: Avoid over-generating '{}' for custom names.

This CL fixes a minor issue with a previous change landed to address
the problems in:

https://github.com/WICG/urlpattern/issues/145

We previously made a change to produce {:foo}bar instead of
:foobar, etc. That change, however, also emitted the {} even when
the custom name had a regexp associated with it; e.g. :foo(baz).
In that case we don't need the protection of the {} since the regexp
placement prevents confusion with the following group.

This CL fixes this minor issue by checking if the part's type is
kSegmentWildcard. It also adds some tests to validate this behavior.

Bug: 1263673
Change-Id: I613009c59a621e394ea697611077bf1fc34c5c43
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3328146
Reviewed-by: Jeremy Roman \<jbroman@chromium.org>
Commit-Queue: Ben Kelly \<wanderview@chromium.org>
Cr-Commit-Position: refs/heads/main@{#951229}

PR 32021 applied with additional changes from upstream: ba47328a5138c4fbbc0841dc2f5bf31ab4da0b33, 938a88f9b3121e0f88bfce4baead83af93111cad, 73d24b5e86feab550aa5ab7271a814aaa5882cf7, a36704733a365f09211d1de341c3b208fe473638, 9743972c7c7c0fd8eef8c2b8c2248028e825692b
Pushed by wptsync@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/daa8884bd392
[wpt PR 32021] - URLPattern: Avoid over-generating '{}' for custom names., a=testonly
Test result changes from PR not available.
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 97 Branch
You need to log in before you can comment on or make changes to this bug.