mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
script: Simplify DOMImplementation::CreateHTMLDocument.
This commit is contained in:
parent
d33ee4594d
commit
d1b175d145
1 changed files with 10 additions and 13 deletions
|
@ -155,20 +155,17 @@ impl DOMImplementationMethods for DOMImplementation {
|
||||||
doc_html.AppendChild(&doc_head).unwrap();
|
doc_html.AppendChild(&doc_head).unwrap();
|
||||||
|
|
||||||
// Step 6.
|
// Step 6.
|
||||||
match title {
|
if let Some(title_str) = title {
|
||||||
None => (),
|
// Step 6.1.
|
||||||
Some(title_str) => {
|
let doc_title =
|
||||||
// Step 6.1.
|
Root::upcast::<Node>(HTMLTitleElement::new(local_name!("title"),
|
||||||
let doc_title =
|
None,
|
||||||
Root::upcast::<Node>(HTMLTitleElement::new(local_name!("title"),
|
&doc));
|
||||||
None,
|
doc_head.AppendChild(&doc_title).unwrap();
|
||||||
&doc));
|
|
||||||
doc_head.AppendChild(&doc_title).unwrap();
|
|
||||||
|
|
||||||
// Step 6.2.
|
// Step 6.2.
|
||||||
let title_text = Text::new(title_str, &doc);
|
let title_text = Text::new(title_str, &doc);
|
||||||
doc_title.AppendChild(title_text.upcast()).unwrap();
|
doc_title.AppendChild(title_text.upcast()).unwrap();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue