Replace urlpattern implementation with rust-urlpattern crate (#36826)

This change implements the full URLPattern API using
https://github.com/denoland/rust-urlpattern, except the two most
important functions (`test` and `exec`). These two are blocked on
https://github.com/servo/servo/issues/28679 due to this union:
539ca27284/components/script_bindings/webidls/URLPattern.webidl (L61).

Testing: Covered by existing web platform tests
Makes https://github.com/servo/servo/pull/36421 obsolete

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
This commit is contained in:
Simon Wülker 2025-05-06 11:42:55 +02:00 committed by GitHub
parent 54c2818974
commit 03abec4148
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 292 additions and 2483 deletions

View file

@ -581,9 +581,6 @@
[Pattern: [{"pathname":"/foo/bar"}\] Inputs: ["./foo/bar","https://example.com"\]]
expected: FAIL
[Pattern: [{"pathname":"/foo/bar"}\] Inputs: [{"pathname":"/foo/bar"},"https://example.com"\]]
expected: FAIL
[Pattern: ["https://example.com:8080/foo?bar#baz"\] Inputs: [{"pathname":"/foo","search":"bar","hash":"baz","baseURL":"https://example.com:8080"}\]]
expected: FAIL
@ -932,6 +929,12 @@
[Pattern: ["https://{sub.}?example{.com/}foo"\] Inputs: ["https://example.com/foo"\]]
expected: FAIL
[Pattern: [{"hostname":"bad\\\\:hostname"}\] Inputs: undefined]
expected: FAIL
[Pattern: [{"pathname":"/foo","baseURL":""}\] Inputs: undefined]
expected: FAIL
[urlpattern.any.sharedworker.html]
expected: ERROR
@ -1519,9 +1522,6 @@
[Pattern: [{"pathname":"/foo/bar"}\] Inputs: ["./foo/bar","https://example.com"\]]
expected: FAIL
[Pattern: [{"pathname":"/foo/bar"}\] Inputs: [{"pathname":"/foo/bar"},"https://example.com"\]]
expected: FAIL
[Pattern: ["https://example.com:8080/foo?bar#baz"\] Inputs: [{"pathname":"/foo","search":"bar","hash":"baz","baseURL":"https://example.com:8080"}\]]
expected: FAIL
@ -1870,6 +1870,12 @@
[Pattern: ["https://{sub.}?example{.com/}foo"\] Inputs: ["https://example.com/foo"\]]
expected: FAIL
[Pattern: [{"hostname":"bad\\\\:hostname"}\] Inputs: undefined]
expected: FAIL
[Pattern: [{"pathname":"/foo","baseURL":""}\] Inputs: undefined]
expected: FAIL
[urlpattern.any.serviceworker.html]
expected: ERROR

View file

@ -584,9 +584,6 @@
[Pattern: [{"pathname":"/foo/bar"}\] Inputs: ["./foo/bar","https://example.com"\]]
expected: FAIL
[Pattern: [{"pathname":"/foo/bar"}\] Inputs: [{"pathname":"/foo/bar"},"https://example.com"\]]
expected: FAIL
[Pattern: ["https://example.com:8080/foo?bar#baz"\] Inputs: [{"pathname":"/foo","search":"bar","hash":"baz","baseURL":"https://example.com:8080"}\]]
expected: FAIL
@ -935,6 +932,12 @@
[Pattern: ["https://{sub.}?example{.com/}foo"\] Inputs: ["https://example.com/foo"\]]
expected: FAIL
[Pattern: [{"hostname":"bad\\\\:hostname"}\] Inputs: undefined]
expected: FAIL
[Pattern: [{"pathname":"/foo","baseURL":""}\] Inputs: undefined]
expected: FAIL
[urlpattern.https.any.worker.html]
[Pattern: [{"pathname":"/foo/bar"}\] Inputs: [{"pathname":"/foo/bar"}\]]
@ -1519,9 +1522,6 @@
[Pattern: [{"pathname":"/foo/bar"}\] Inputs: ["./foo/bar","https://example.com"\]]
expected: FAIL
[Pattern: [{"pathname":"/foo/bar"}\] Inputs: [{"pathname":"/foo/bar"},"https://example.com"\]]
expected: FAIL
[Pattern: ["https://example.com:8080/foo?bar#baz"\] Inputs: [{"pathname":"/foo","search":"bar","hash":"baz","baseURL":"https://example.com:8080"}\]]
expected: FAIL
@ -1870,6 +1870,12 @@
[Pattern: ["https://{sub.}?example{.com/}foo"\] Inputs: ["https://example.com/foo"\]]
expected: FAIL
[Pattern: [{"hostname":"bad\\\\:hostname"}\] Inputs: undefined]
expected: FAIL
[Pattern: [{"pathname":"/foo","baseURL":""}\] Inputs: undefined]
expected: FAIL
[urlpattern.https.any.serviceworker.html]
expected: ERROR