Automatic update from web-platform-tests [URLPattern] implement URLPattern.generate() in Blink This CL exposes the new Web API, `URLPattern.generate()`, discussed in the DesignDoc [1]. The new experimental `URLPatternGenerate` flag is needed to enable this feature. This CL also adds WPTs for this feature. [1] https://docs.google.com/document/d/1hOG2SzMVab0fBJrV8J8w3wSWsbGZxDLyvjdhDu8WsT0/ Bug: 414682820 Change-Id: Id1df99bede7782dfdee605c2b998150422158f4b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6582245 Commit-Queue: Takashi Nakayama <tnak@chromium.org> Reviewed-by: Domenic Denicola <domenic@chromium.org> Cr-Commit-Position: refs/heads/main@{#1465737} -- wpt-commits: 3ffda23e5af7c59590b17c2710a22efd22dd4973 wpt-pr: 52796 Differential Revision: https://phabricator.services.mozilla.com/D251832
117 lines
2.4 KiB
JSON
117 lines
2.4 KiB
JSON
[
|
|
{
|
|
"pattern": { "pathname": "/foo" },
|
|
"component": "invalid",
|
|
"groups": {},
|
|
"expected": null
|
|
},
|
|
{
|
|
"pattern": { "pathname": "/foo" },
|
|
"component": "pathname",
|
|
"groups": {},
|
|
"expected": "/foo"
|
|
},
|
|
{
|
|
"pattern": { "pathname": "/:foo" },
|
|
"component": "pathname",
|
|
"groups": { "foo": "bar" },
|
|
"expected": "/bar"
|
|
},
|
|
{
|
|
"pattern": { "pathname": "/:foo" },
|
|
"component": "pathname",
|
|
"groups": { "foo": "🍅" },
|
|
"expected": "/%F0%9F%8D%85"
|
|
},
|
|
{
|
|
"pattern": { "hostname": "{:foo}.example.com" },
|
|
"component": "hostname",
|
|
"groups": { "foo": "🍅" },
|
|
"expected": "xn--fi8h.example.com"
|
|
},
|
|
{
|
|
"pattern": { "pathname": "/:foo" },
|
|
"component": "pathname",
|
|
"groups": {},
|
|
"expected": null
|
|
},
|
|
{
|
|
"pattern": { "pathname": "/foo/:bar" },
|
|
"component": "pathname",
|
|
"groups": { "bar": "baz" },
|
|
"expected": "/foo/baz"
|
|
},
|
|
{
|
|
"pattern": { "pathname": "/foo:bar" },
|
|
"component": "pathname",
|
|
"groups": { "bar": "baz" },
|
|
"expected": "/foobaz"
|
|
},
|
|
{
|
|
"pattern": { "pathname": "/:foo/:bar" },
|
|
"component": "pathname",
|
|
"groups": { "foo": "baz", "bar": "qux" },
|
|
"expected": "/baz/qux"
|
|
},
|
|
{
|
|
"pattern": "https://example.com/:foo",
|
|
"component": "pathname",
|
|
"groups": { "foo": " " },
|
|
"expected": "/%20"
|
|
},
|
|
{
|
|
"pattern": "original-scheme://example.com/:foo",
|
|
"component": "pathname",
|
|
"groups": { "foo": " " },
|
|
"expected": "/ "
|
|
},
|
|
{
|
|
"pattern": { "pathname": "/:foo" },
|
|
"component": "pathname",
|
|
"groups": { "foo": "bar/baz" },
|
|
"expected": null
|
|
},
|
|
{
|
|
"pattern": { "pathname": "*" },
|
|
"component": "pathname",
|
|
"groups": {},
|
|
"expected": null
|
|
},
|
|
{
|
|
"pattern": { "pathname": "/{foo}+" },
|
|
"component": "pathname",
|
|
"groups": {},
|
|
"expected": null
|
|
},
|
|
{
|
|
"pattern": { "pathname": "/{foo}?" },
|
|
"component": "pathname",
|
|
"groups": {},
|
|
"expected": null
|
|
},
|
|
{
|
|
"pattern": { "pathname": "/{foo}*" },
|
|
"component": "pathname",
|
|
"groups": {},
|
|
"expected": null
|
|
},
|
|
{
|
|
"pattern": { "pathname": "/(regexp)" },
|
|
"component": "pathname",
|
|
"groups": {},
|
|
"expected": null
|
|
},
|
|
{
|
|
"pattern": { "pathname": "/([^\\/]+?)" },
|
|
"component": "pathname",
|
|
"groups": {},
|
|
"expected": null
|
|
},
|
|
{
|
|
"pattern": { "port": "([^\\:]+?)" },
|
|
"component": "port",
|
|
"groups": {},
|
|
"expected": null
|
|
}
|
|
]
|