script: Do not include fragments when comparing URLs in CookieStore (#38876)

Fixes a check for empty options in `getAll(options)` and makes url
comparison with exclude fragments set to true.

Testing: New passing WPT tests
Part of #37674

---------

Signed-off-by: Sebastian C <sebsebmc@gmail.com>
This commit is contained in:
Sebastian C 2025-08-27 18:41:11 -05:00 committed by GitHub
parent 84f478a47a
commit e5c83ec419
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 46 additions and 66 deletions

View file

@ -117,6 +117,13 @@ impl ServoUrl {
scheme == "wss"
}
/// <https://url.spec.whatwg.org/#url-equivalence>
/// In the future this may be removed if the helper is added upstream in rust-url
/// see <https://github.com/servo/rust-url/issues/1063> for details
pub fn is_equal_excluding_fragments(&self, other: &ServoUrl) -> bool {
self.0[..Position::AfterQuery] == other.0[..Position::AfterQuery]
}
pub fn as_str(&self) -> &str {
self.0.as_str()
}