Some CanGc Fixes (#33865)

Signed-off-by: jahielkomu <ktumuhairwe24@gmail.com>
This commit is contained in:
komuhangi 2024-10-16 18:14:28 +03:00 committed by GitHub
parent 2b9527262c
commit b0a33d6b02
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 1 deletions

View file

@ -235,6 +235,7 @@ DOMInterfaces = {
'URL': {
'weakReferenceable': True,
'canGc': ['Parse'],
},
'VRDisplay': {

View file

@ -162,6 +162,7 @@ impl URLMethods for URL {
global: &GlobalScope,
url: USVString,
base: Option<USVString>,
can_gc: CanGc,
) -> Option<DomRoot<URL>> {
// Step 1: Let parsedURL be the result of running the API URL parser on url with base,
// if given.
@ -176,7 +177,7 @@ impl URLMethods for URL {
// These steps are all handled while mapping the Result to an Option<ServoUrl>.
// Regarding initialization, the same condition should apply here as stated in the comments
// in Self::Constructor above - construct it on-demand inside `URL::SearchParams`.
Some(URL::new(global, None, parsed_url.ok()?, CanGc::note()))
Some(URL::new(global, None, parsed_url.ok()?, can_gc))
}
/// <https://w3c.github.io/FileAPI/#dfn-createObjectURL>