From d74b72ae21e9b595c7f81df561275a97cf2c9217 Mon Sep 17 00:00:00 2001 From: Sam Sneddon Date: Fri, 16 Feb 2024 16:45:38 +0000 Subject: [PATCH 1/2] Add RFC 181 - URLManifestItem.url shouldn't contain non-URL-unit characters --- rfcs/valid-item-urls.md | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 rfcs/valid-item-urls.md diff --git a/rfcs/valid-item-urls.md b/rfcs/valid-item-urls.md new file mode 100644 index 00000000..6db572dc --- /dev/null +++ b/rfcs/valid-item-urls.md @@ -0,0 +1,40 @@ +# RFC 181 - URLManifestItem.url shouldn't contain non-URL-unit characters + +## Summary + +Currently we end up storing URLs such as: `/xhr/xmlhttprequest-timeout-worker-aborted.html?aborted immediately after send()`. If you pass this to the [URL parser](https://url.spec.whatwg.org/#concept-url-parser) with a base URL of `http://web-platform.test`, this results in a number of [invalid-URL-unit](https://url.spec.whatwg.org/#invalid-url-unit) [validation errors](https://url.spec.whatwg.org/#validation-error). + +We should instead store the output of [URL serialize](https://url.spec.whatwg.org/#concept-url-serializer) ∘ [URL parse](https://url.spec.whatwg.org/#concept-url-parser) of the URL. + +## Details + +There are various systems at various vendors which expect test identifiers to not contain spaces, and when in principle the test identifier is a URL one might expect it to not contain any spaces. + +This is primarily a concern with variants, which vastly more often include spaces, such as the example above. + +We do have a few files in WPT which contain spaces: + +``` +gsnedders@gsnedders-marsha web-platform-tests % find . -name '* *' +./tools/wave/test/WAVE Local.postman_environment.json +./tools/wave/test/WAVE Server REST API Tests.postman_collection.json +./tools/wave/tests/WAVE Local.postman_environment.json +./tools/wave/tests/WAVE Server REST API Tests.postman_collection.json +./css/CSS2/syntax/support/'green block.png +./html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/support/url foo +./html/canvas/offscreen/path-objects/2d.path.roundrect.1.radius.dompoint.single argument.worker.js +./html/canvas/offscreen/path-objects/2d.path.roundrect.1.radius.dompoint.single argument.html +./html/canvas/element/path-objects/2d.path.roundrect.1.radius.dompoint.single argument.html +``` + +Only the last three of these are test files, which generate three test items. + +One question here is whether we should disallow test file paths that allow spaces, or whether we should just escape these in the URL. + +## Risks + +Any test system that keys off the test URLs will have to deal with URLs changing. + +This includes the wptmanifest (i.e., wptrunner's expectation manifest), WebKit (and I believe Blink)'s TestExpectations files and results expectations files. + +This may also affect items in wpt-metadata. From 447ff37e968846daa03d819c1f7674f72ac66a1b Mon Sep 17 00:00:00 2001 From: Sam Sneddon Date: Fri, 16 Feb 2024 18:04:13 +0000 Subject: [PATCH 2/2] Update rfcs/valid-item-urls.md Co-authored-by: Ms2ger --- rfcs/valid-item-urls.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rfcs/valid-item-urls.md b/rfcs/valid-item-urls.md index 6db572dc..c6e8355e 100644 --- a/rfcs/valid-item-urls.md +++ b/rfcs/valid-item-urls.md @@ -29,7 +29,7 @@ gsnedders@gsnedders-marsha web-platform-tests % find . -name '* *' Only the last three of these are test files, which generate three test items. -One question here is whether we should disallow test file paths that allow spaces, or whether we should just escape these in the URL. +One question here is whether we should disallow test file paths that contain spaces, or whether we should just escape these in the URL. ## Risks