[wpt-sync] Sync PR 32021 - URLPattern: Avoid over-generating '{}' for custom names.
Categories
(Testing :: web-platform-tests, task, P4)
Tracking
(firefox97 fixed)
| Tracking | Status | |
|---|---|---|
| firefox97 | --- | fixed |
People
(Reporter: wpt-sync, 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}barinstead 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}
| Assignee | ||
Comment 1•4 years ago
|
||
| Assignee | ||
Comment 2•4 years ago
|
||
| Assignee | ||
Comment 4•4 years ago
|
||
Comment 5•4 years ago
|
||
| bugherder | ||
Description
•