mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
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>
This commit is contained in:
parent
bd43b78735
commit
6898eae61e
20 changed files with 137 additions and 111 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue