diff options
author | Yerkebulan Tulibergenov <yerkebulan@gmail.com> | 2025-04-05 23:27:59 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-06 06:27:59 +0000 |
commit | 6898eae61ee8070bbc19815bc35428200e7074bf (patch) | |
tree | cb5fd5f1c83e93a4df5a10803b85a8c48197b3bc /components/script/dom/domimplementation.rs | |
parent | bd43b7873587f9682ec8de53065d0049e3cd88ae (diff) | |
download | servo-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/domimplementation.rs')
-rw-r--r-- | components/script/dom/domimplementation.rs | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/components/script/dom/domimplementation.rs b/components/script/dom/domimplementation.rs index 4adae2f4229..2d0e8534e79 100644 --- a/components/script/dom/domimplementation.rs +++ b/components/script/dom/domimplementation.rs @@ -138,12 +138,12 @@ impl DOMImplementationMethods<crate::DomTypeHolder> for DOMImplementation { // Step 4. if let Some(doc_type) = maybe_doctype { - doc_node.AppendChild(doc_type.upcast()).unwrap(); + doc_node.AppendChild(doc_type.upcast(), can_gc).unwrap(); } // Step 5. if let Some(ref elem) = maybe_elem { - doc_node.AppendChild(elem.upcast()).unwrap(); + doc_node.AppendChild(elem.upcast(), can_gc).unwrap(); } } @@ -185,7 +185,7 @@ impl DOMImplementationMethods<crate::DomTypeHolder> for DOMImplementation { // Step 3. let doc_node = doc.upcast::<Node>(); let doc_type = DocumentType::new(DOMString::from("html"), None, None, &doc, can_gc); - doc_node.AppendChild(doc_type.upcast()).unwrap(); + doc_node.AppendChild(doc_type.upcast(), can_gc).unwrap(); } { @@ -198,7 +198,9 @@ impl DOMImplementationMethods<crate::DomTypeHolder> for DOMImplementation { None, can_gc, )); - doc_node.AppendChild(&doc_html).expect("Appending failed"); + doc_node + .AppendChild(&doc_html, can_gc) + .expect("Appending failed"); { // Step 5. @@ -209,7 +211,7 @@ impl DOMImplementationMethods<crate::DomTypeHolder> for DOMImplementation { None, can_gc, )); - doc_html.AppendChild(&doc_head).unwrap(); + doc_html.AppendChild(&doc_head, can_gc).unwrap(); // Step 6. if let Some(title_str) = title { @@ -221,17 +223,17 @@ impl DOMImplementationMethods<crate::DomTypeHolder> for DOMImplementation { None, can_gc, )); - doc_head.AppendChild(&doc_title).unwrap(); + doc_head.AppendChild(&doc_title, can_gc).unwrap(); // Step 6.2. let title_text = Text::new(title_str, &doc, can_gc); - doc_title.AppendChild(title_text.upcast()).unwrap(); + doc_title.AppendChild(title_text.upcast(), can_gc).unwrap(); } } // Step 7. let doc_body = HTMLBodyElement::new(local_name!("body"), None, &doc, None, can_gc); - doc_html.AppendChild(doc_body.upcast()).unwrap(); + doc_html.AppendChild(doc_body.upcast(), can_gc).unwrap(); } // Step 8. |