cangc fixes in node.rs (#33984)

Signed-off-by: L Ashwin B <lashwinib@gmail.com>
This commit is contained in:
chickenleaf 2024-10-24 04:14:50 +05:30 committed by GitHub
parent 3ed778150f
commit bb4932026c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
97 changed files with 1038 additions and 534 deletions

View file

@ -40,18 +40,20 @@ impl DocumentFragment {
}
}
pub fn new(document: &Document) -> DomRoot<DocumentFragment> {
Self::new_with_proto(document, None)
pub fn new(document: &Document, can_gc: CanGc) -> DomRoot<DocumentFragment> {
Self::new_with_proto(document, None, can_gc)
}
fn new_with_proto(
document: &Document,
proto: Option<HandleObject>,
can_gc: CanGc,
) -> DomRoot<DocumentFragment> {
Node::reflect_node_with_proto(
Box::new(DocumentFragment::new_inherited(document)),
document,
proto,
can_gc,
)
}
@ -65,11 +67,11 @@ impl DocumentFragmentMethods for DocumentFragment {
fn Constructor(
window: &Window,
proto: Option<HandleObject>,
_can_gc: CanGc,
can_gc: CanGc,
) -> Fallible<DomRoot<DocumentFragment>> {
let document = window.Document();
Ok(DocumentFragment::new_with_proto(&document, proto))
Ok(DocumentFragment::new_with_proto(&document, proto, can_gc))
}
// https://dom.spec.whatwg.org/#dom-parentnode-children
@ -106,18 +108,18 @@ impl DocumentFragmentMethods for DocumentFragment {
}
// https://dom.spec.whatwg.org/#dom-parentnode-prepend
fn Prepend(&self, nodes: Vec<NodeOrString>) -> ErrorResult {
self.upcast::<Node>().prepend(nodes)
fn Prepend(&self, nodes: Vec<NodeOrString>, can_gc: CanGc) -> ErrorResult {
self.upcast::<Node>().prepend(nodes, can_gc)
}
// https://dom.spec.whatwg.org/#dom-parentnode-append
fn Append(&self, nodes: Vec<NodeOrString>) -> ErrorResult {
self.upcast::<Node>().append(nodes)
fn Append(&self, nodes: Vec<NodeOrString>, can_gc: CanGc) -> ErrorResult {
self.upcast::<Node>().append(nodes, can_gc)
}
// https://dom.spec.whatwg.org/#dom-parentnode-replacechildren
fn ReplaceChildren(&self, nodes: Vec<NodeOrString>) -> ErrorResult {
self.upcast::<Node>().replace_children(nodes)
fn ReplaceChildren(&self, nodes: Vec<NodeOrString>, can_gc: CanGc) -> ErrorResult {
self.upcast::<Node>().replace_children(nodes, can_gc)
}
// https://dom.spec.whatwg.org/#dom-parentnode-queryselector