Propagate CanGc arguments through callers in constructors (#35541)

Signed-off-by: Auguste Baum <auguste.apple@gmail.com>
This commit is contained in:
Auguste Baum 2025-02-20 17:17:45 +01:00 committed by GitHub
parent 5465bfc2af
commit 863d2ce871
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
260 changed files with 986 additions and 603 deletions

View file

@ -546,6 +546,7 @@ impl Element {
mode,
slot_assignment_mode,
clonable,
CanGc::note(),
);
self.ensure_rare_data().shadow_root = Some(Dom::from_ref(&*shadow_root));
shadow_root
@ -2182,7 +2183,7 @@ impl Element {
let elem = self
.downcast::<HTMLElement>()
.expect("ensure_element_internals should only be called for an HTMLElement");
Dom::from_ref(&*ElementInternals::new(elem))
Dom::from_ref(&*ElementInternals::new(elem, CanGc::note()))
}))
}
}
@ -2245,7 +2246,7 @@ impl ElementMethods<crate::DomTypeHolder> for Element {
// https://dom.spec.whatwg.org/#dom-element-classlist
fn ClassList(&self) -> DomRoot<DOMTokenList> {
self.class_list
.or_init(|| DOMTokenList::new(self, &local_name!("class"), None))
.or_init(|| DOMTokenList::new(self, &local_name!("class"), None, CanGc::note()))
}
// https://dom.spec.whatwg.org/#dom-element-slot
@ -2257,7 +2258,7 @@ impl ElementMethods<crate::DomTypeHolder> for Element {
// https://dom.spec.whatwg.org/#dom-element-attributes
fn Attributes(&self) -> DomRoot<NamedNodeMap> {
self.attr_list
.or_init(|| NamedNodeMap::new(&self.owner_window(), self))
.or_init(|| NamedNodeMap::new(&self.owner_window(), self, CanGc::note()))
}
// https://dom.spec.whatwg.org/#dom-element-hasattributes