Skip to content

deps: update ada and web-platform tests #57693

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions deps/ada/ada.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* auto-generated on 2025-03-10 13:14:56 -0400. Do not edit! */
/* auto-generated on 2025-03-30 13:24:42 -0400. Do not edit! */
/* begin file src/ada.cpp */
#include "ada.h"
/* begin file src/checkers.cpp */
Expand Down Expand Up @@ -13334,10 +13334,18 @@ result_type parse_url_impl(std::string_view user_input,
input_position = input_size + 1;
}
url.has_opaque_path = true;

// This is a really unlikely scenario in real world. We should not seek
// to optimize it.
url.update_base_pathname(unicode::percent_encode(
view, character_sets::C0_CONTROL_PERCENT_ENCODE));
if (view.ends_with(' ')) {
std::string modified_view =
std::string(view.begin(), view.end() - 1) + "%20";
url.update_base_pathname(unicode::percent_encode(
modified_view, character_sets::C0_CONTROL_PERCENT_ENCODE));
} else {
url.update_base_pathname(unicode::percent_encode(
view, character_sets::C0_CONTROL_PERCENT_ENCODE));
}
break;
}
case state::PORT: {
Expand Down
7 changes: 3 additions & 4 deletions deps/ada/ada.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* auto-generated on 2025-03-10 13:14:56 -0400. Do not edit! */
/* auto-generated on 2025-03-30 13:24:42 -0400. Do not edit! */
/* begin file include/ada.h */
/**
* @file ada.h
Expand Down Expand Up @@ -5859,7 +5859,6 @@ tl::expected<url_pattern<regex_provider>, errors> parse_url_pattern_impl(
// TODO: Optimization opportunity.
if (scheme::is_special(*processed_init->protocol)) {
std::string_view port = processed_init->port.value();
helpers::trim_c0_whitespace(port);
if (std::to_string(scheme::get_special_port(*processed_init->protocol)) ==
port) {
processed_init->port->clear();
Expand Down Expand Up @@ -10503,14 +10502,14 @@ constructor_string_parser<regex_provider>::parse(std::string_view input) {
#ifndef ADA_ADA_VERSION_H
#define ADA_ADA_VERSION_H

#define ADA_VERSION "3.2.1"
#define ADA_VERSION "3.2.2"

namespace ada {

enum {
ADA_VERSION_MAJOR = 3,
ADA_VERSION_MINOR = 2,
ADA_VERSION_REVISION = 1,
ADA_VERSION_REVISION = 2,
};

} // namespace ada
Expand Down
4 changes: 2 additions & 2 deletions test/fixtures/wpt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ Last update:
- resource-timing: https://github.com/web-platform-tests/wpt/tree/22d38586d0/resource-timing
- resources: https://github.com/web-platform-tests/wpt/tree/1e140d63ec/resources
- streams: https://github.com/web-platform-tests/wpt/tree/bc9dcbbf1a/streams
- url: https://github.com/web-platform-tests/wpt/tree/d86fcc9e87/url
- urlpattern: https://github.com/web-platform-tests/wpt/tree/6ceca69d26/urlpattern
- url: https://github.com/web-platform-tests/wpt/tree/9504a83e01/url
- urlpattern: https://github.com/web-platform-tests/wpt/tree/f07d05f49c/urlpattern
- user-timing: https://github.com/web-platform-tests/wpt/tree/5ae85bf826/user-timing
- wasm/jsapi: https://github.com/web-platform-tests/wpt/tree/cde25e7e3c/wasm/jsapi
- wasm/webapi: https://github.com/web-platform-tests/wpt/tree/fd1b23eeaa/wasm/webapi
Expand Down
21 changes: 21 additions & 0 deletions test/fixtures/wpt/url/IdnaTestV2-removed.window.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
promise_test(() => fetch("resources/IdnaTestV2-removed.json").then(res => res.json()).then(runTests), "Loading data…");

function runTests(idnaTests) {
for (const idnaTest of idnaTests) {
if (typeof idnaTest === "string") {
continue // skip comments
}

test(() => {
if (idnaTest.output === null) {
assert_throws_js(TypeError, () => new URL(`https://${idnaTest.input}/x`));
} else {
const url = new URL(`https://${idnaTest.input}/x`);
assert_equals(url.host, idnaTest.output);
assert_equals(url.hostname, idnaTest.output);
assert_equals(url.pathname, "/x");
assert_equals(url.href, `https://${idnaTest.output}/x`);
}
}, `ToASCII("${idnaTest.input}")${idnaTest.comment ? " " + idnaTest.comment : ""}`);
}
}
104 changes: 104 additions & 0 deletions test/fixtures/wpt/url/resources/IdnaTestV2-removed.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
[
"This is generated with the help from ../tools/IdnaTestV2-compare.py.",
"These tests are from an older IdnaTestV2 and thus the comment line may no longer be accurate.",
{
"comment": "P1; V6; V3 (ignored)",
"input": "-\udb40\ude56\ua867\uff0e\udb40\ude82\ud8dc\udd83\ud83c\udd09",
"output": null
},
{
"comment": "P1; V5; V6",
"input": "\ud83c\udd04\uff0e\u1cdc\u2488\u00df",
"output": null
},
{
"comment": "P1; V5; V6",
"input": "\ud83c\udd04\uff0e\u1cdc\u2488SS",
"output": null
},
{
"comment": "P1; V5; V6",
"input": "\ud83c\udd04\uff0e\u1cdc\u2488ss",
"output": null
},
{
"comment": "P1; V5; V6",
"input": "\ud83c\udd04\uff0e\u1cdc\u2488Ss",
"output": null
},
{
"comment": "C2; P1; V6",
"input": "\u0756\u3002\u3164\u200d\u03c2",
"output": null
},
{
"comment": "C2; P1; V6",
"input": "\u0756\u3002\u1160\u200d\u03c2",
"output": null
},
{
"comment": "C2; P1; V6",
"input": "\u0756\u3002\u1160\u200d\u03a3",
"output": null
},
{
"comment": "C2; P1; V6",
"input": "\u0756\u3002\u1160\u200d\u03c3",
"output": null
},
{
"comment": "C2; P1; V6",
"input": "\u0756\u3002\u3164\u200d\u03a3",
"output": null
},
{
"comment": "C2; P1; V6",
"input": "\u0756\u3002\u3164\u200d\u03c3",
"output": null
},
{
"comment": "P1; V6",
"input": "\ud83c\udd07\u4f10\ufe12.\ud831\ude5a\ua8c4",
"output": null
},
{
"comment": "P1; V5; V6",
"input": "\ud802\ude3f.\ud83c\udd06\u2014",
"output": null
},
{
"comment": "C2; P1; V5; V6",
"input": "\u1c32\ud83c\udd08\u2f9b\u05a6\uff0e\u200d\uda7e\udd64\u07fd",
"output": null
},
{
"comment": "C2; P1; V5; V6",
"input": "\ud83e\udc9f\ud83c\udd08\u200d\ua84e\uff61\u0f84",
"output": null
},
{
"comment": "P1; V6",
"input": "\udaa5\udeaa\uff61\ud83c\udd02",
"output": null
},
{
"comment": "C2; P1; V6",
"input": "\u186f\u2689\u59f6\ud83c\udd09\uff0e\u06f7\u200d\ud83c\udfaa\u200d",
"output": null
},
{
"comment": "C1; P1; V5; V6",
"input": "\ua67d\u200c\ud87e\uddf5\ud83c\udd06\uff61\u200c\ud804\udc42\u1b01",
"output": null
},
{
"comment": "C1; P1; V5; V6",
"input": "\ua67d\u200c\u9723\ud83c\udd06\uff61\u200c\ud804\udc42\u1b01",
"output": null
},
{
"comment": "C1; P1; V5; V6; V3 (ignored)",
"input": "-\u1897\u200c\ud83c\udd04.\ud805\udf22",
"output": null
}
]
68 changes: 52 additions & 16 deletions test/fixtures/wpt/url/resources/setters_tests.json
Original file line number Diff line number Diff line change
Expand Up @@ -1177,6 +1177,24 @@
"host": "test.invalid",
"hostname": "test.invalid"
}
},
{
"href": "https://test.invalid/",
"new_value": "test/@aaa",
"expected": {
"href": "https://test/",
"host": "test",
"hostname": "test"
}
},
{
"href": "https://test.invalid/",
"new_value": "test/:aaa",
"expected": {
"href": "https://test/",
"host": "test",
"hostname": "test"
}
}
],
"hostname": [
Expand Down Expand Up @@ -1624,6 +1642,24 @@
"host": "test.invalid",
"hostname": "test.invalid"
}
},
{
"href": "https://test.invalid/",
"new_value": "test/@aaa",
"expected": {
"href": "https://test/",
"host": "test",
"hostname": "test"
}
},
{
"href": "https://test.invalid/",
"new_value": "test/:aaa",
"expected": {
"href": "https://test/",
"host": "test",
"hostname": "test"
}
}
],
"port": [
Expand Down Expand Up @@ -2241,38 +2277,38 @@
}
},
{
"comment": "Drop trailing spaces from trailing opaque paths",
"comment": "Trailing spaces and opaque paths",
"href": "data:space ?query",
"new_value": "",
"expected": {
"href": "data:space",
"pathname": "space",
"href": "data:space%20",
"pathname": "space%20",
"search": ""
}
},
{
"href": "sc:space ?query",
"new_value": "",
"expected": {
"href": "sc:space",
"pathname": "space",
"href": "sc:space%20",
"pathname": "space%20",
"search": ""
}
},
{
"comment": "Do not drop trailing spaces from non-trailing opaque paths",
"comment": "Trailing spaces and opaque paths",
"href": "data:space ?query#fragment",
"new_value": "",
"expected": {
"href": "data:space #fragment",
"href": "data:space %20#fragment",
"search": ""
}
},
{
"href": "sc:space ?query#fragment",
"new_value": "",
"expected": {
"href": "sc:space #fragment",
"href": "sc:space %20#fragment",
"search": ""
}
},
Expand Down Expand Up @@ -2429,38 +2465,38 @@
}
},
{
"comment": "Drop trailing spaces from trailing opaque paths",
"comment": "Trailing spaces and opaque paths",
"href": "data:space #fragment",
"new_value": "",
"expected": {
"href": "data:space",
"pathname": "space",
"href": "data:space %20",
"pathname": "space %20",
"hash": ""
}
},
{
"href": "sc:space #fragment",
"new_value": "",
"expected": {
"href": "sc:space",
"pathname": "space",
"href": "sc:space %20",
"pathname": "space %20",
"hash": ""
}
},
{
"comment": "Do not drop trailing spaces from non-trailing opaque paths",
"comment": "Trailing spaces and opaque paths",
"href": "data:space ?query#fragment",
"new_value": "",
"expected": {
"href": "data:space ?query",
"href": "data:space %20?query",
"hash": ""
}
},
{
"href": "sc:space ?query#fragment",
"new_value": "",
"expected": {
"href": "sc:space ?query",
"href": "sc:space %20?query",
"hash": ""
}
},
Expand Down
12 changes: 9 additions & 3 deletions test/fixtures/wpt/url/resources/toascii.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
[
"This contains assorted IDNA tests that IdnaTestV2 might not cover.",
"Feel free to deduplicate with a clear commit message.",
"",
"If the test only applies to the URL Standard's 'domain to ASCII', ",
"and not to TR46's ToASCII, then tag it with `urlStandardOnly`",
{
"comment": "Label with hyphens in 3rd and 4th position",
"input": "aa--",
Expand Down Expand Up @@ -239,19 +242,22 @@
},
{
"input": "www.lookout.net\u2A7480",
"output": null
"output": null,
"urlStandardOnly": true
},
{
"input": "www\u00A0.lookout.net",
"output": null
"output": null,
"urlStandardOnly": true
},
{
"input": "\u1680lookout.net",
"output": null
},
{
"input": "\u001flookout.net",
"output": null
"output": null,
"urlStandardOnly": true
},
{
"input": "look\u06DDout.net",
Expand Down
Loading
Loading