aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/element.rs
diff options
context:
space:
mode:
authorYerkebulan Tulibergenov <yerkebulan@gmail.com>2025-04-05 23:27:59 -0700
committerGitHub <noreply@github.com>2025-04-06 06:27:59 +0000
commit6898eae61ee8070bbc19815bc35428200e7074bf (patch)
treecb5fd5f1c83e93a4df5a10803b85a8c48197b3bc /components/script/dom/element.rs
parentbd43b7873587f9682ec8de53065d0049e3cd88ae (diff)
downloadservo-6898eae61ee8070bbc19815bc35428200e7074bf.tar.gz
servo-6898eae61ee8070bbc19815bc35428200e7074bf.zip
Add CanGc as arguments in methods in Attr and Node (#36371)
Add CanGc as argument to methods in `Attr` and `Node`. Addressed part of https://github.com/servo/servo/issues/34573. --- - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes do not require tests because they are a refactor. Signed-off-by: Yerkebulan Tulibergenov <yerkebulan@gmail.com>
Diffstat (limited to 'components/script/dom/element.rs')
-rw-r--r--components/script/dom/element.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/components/script/dom/element.rs b/components/script/dom/element.rs
index 8193c99c896..5216768c3ac 100644
--- a/components/script/dom/element.rs
+++ b/components/script/dom/element.rs
@@ -2170,7 +2170,10 @@ impl Element {
let fragment = DocumentFragment::new(&context_document, can_gc);
// Step 4.
for child in new_children {
- fragment.upcast::<Node>().AppendChild(&child).unwrap();
+ fragment
+ .upcast::<Node>()
+ .AppendChild(&child, can_gc)
+ .unwrap();
}
// Step 5.
Ok(fragment)
@@ -2973,7 +2976,7 @@ impl ElementMethods<crate::DomTypeHolder> for Element {
// For each node in newChildren, append node to fragment.
for child in new_children {
- frag.upcast::<Node>().AppendChild(&child).unwrap();
+ frag.upcast::<Node>().AppendChild(&child, can_gc).unwrap();
}
// Replace all with fragment within target.
@@ -3093,7 +3096,7 @@ impl ElementMethods<crate::DomTypeHolder> for Element {
// Step 5.
let frag = parent.parse_fragment(value, can_gc)?;
// Step 6.
- context_parent.ReplaceChild(frag.upcast(), context_node)?;
+ context_parent.ReplaceChild(frag.upcast(), context_node, can_gc)?;
Ok(())
}