script: Implement input preprocessing for URLPatterns (#36225)

Implements https://urlpattern.spec.whatwg.org/#process-a-urlpatterninit
and the component canonicalization functions. These handle
percent-encoding and such for the components of a `URLPattern`.

No new tests pass, because the tokenizer and parser are still missing.

This is part 2 of upstreaming the changes in
https://github.com/simonwuelker/servo/tree/urlpattern

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
This commit is contained in:
Simon Wülker 2025-04-05 01:42:28 +02:00 committed by GitHub
parent 944e795606
commit 478e876f6d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 686 additions and 52 deletions

View file

@ -78,7 +78,7 @@ impl ops::Deref for ByteString {
/// A string that is constructed from a UCS-2 buffer by replacing invalid code
/// points with the replacement character.
#[derive(Clone, Default, Eq, Hash, MallocSizeOf, Ord, PartialEq, PartialOrd)]
#[derive(Clone, Debug, Default, Eq, Hash, MallocSizeOf, Ord, PartialEq, PartialOrd)]
pub struct USVString(pub String);
impl Borrow<str> for USVString {