Implement URLPattern::{text, exec} (#37044)

With this change the URLPattern API is fully implemented. I'll look into
the remaining failures and then enable the preference by default.

Testing: Covered by web platform tests

Depends on https://github.com/servo/servo/pull/37042

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
This commit is contained in:
Simon Wülker 2025-05-24 13:12:11 +02:00 committed by GitHub
parent 0ed2c4816c
commit 7fd0c81f55
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 169 additions and 3633 deletions

View file

@ -11,9 +11,9 @@ interface URLPattern {
[Throws] constructor(URLPatternInput input, USVString baseURL, optional URLPatternOptions options = {});
[Throws] constructor(optional URLPatternInput input = {}, optional URLPatternOptions options = {});
// [Throws] boolean test(optional URLPatternInput input = {}, optional USVString baseURL);
[Throws] boolean test(optional URLPatternInput input = {}, optional USVString baseURL);
// [Throws] URLPatternResult? exec(optional URLPatternInput input = {}, optional USVString baseURL);
[Throws] URLPatternResult? exec(optional URLPatternInput input = {}, optional USVString baseURL);
readonly attribute USVString protocol;
readonly attribute USVString username;
@ -43,20 +43,20 @@ dictionary URLPatternOptions {
boolean ignoreCase = false;
};
// dictionary URLPatternResult {
// sequence<URLPatternInput> inputs;
dictionary URLPatternResult {
sequence<URLPatternInput> inputs;
// URLPatternComponentResult protocol;
// URLPatternComponentResult username;
// URLPatternComponentResult password;
// URLPatternComponentResult hostname;
// URLPatternComponentResult port;
// URLPatternComponentResult pathname;
// URLPatternComponentResult search;
// URLPatternComponentResult hash;
// };
URLPatternComponentResult protocol;
URLPatternComponentResult username;
URLPatternComponentResult password;
URLPatternComponentResult hostname;
URLPatternComponentResult port;
URLPatternComponentResult pathname;
URLPatternComponentResult search;
URLPatternComponentResult hash;
};
// dictionary URLPatternComponentResult {
// USVString input;
// record<USVString, (USVString or undefined)> groups;
// };
dictionary URLPatternComponentResult {
USVString input;
record<USVString, (USVString or undefined)> groups;
};