mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Move to to_owned rather than into_string.
into_string has been removed from Rust.
This commit is contained in:
parent
2d5b0e0855
commit
01ed338746
67 changed files with 473 additions and 383 deletions
|
@ -25,6 +25,8 @@ use dom::node::Node;
|
|||
use dom::text::Text;
|
||||
use servo_util::str::DOMString;
|
||||
|
||||
use std::borrow::ToOwned;
|
||||
|
||||
#[dom_struct]
|
||||
pub struct DOMImplementation {
|
||||
reflector_: Reflector,
|
||||
|
@ -123,18 +125,18 @@ impl<'a> DOMImplementationMethods for JSRef<'a, DOMImplementation> {
|
|||
|
||||
{
|
||||
// Step 3.
|
||||
let doc_type = DocumentType::new("html".into_string(), None, None, doc.r()).root();
|
||||
let doc_type = DocumentType::new("html".to_owned(), None, None, doc.r()).root();
|
||||
assert!(doc_node.AppendChild(NodeCast::from_ref(doc_type.r())).is_ok());
|
||||
}
|
||||
|
||||
{
|
||||
// Step 4.
|
||||
let doc_html: Root<Node> = NodeCast::from_temporary(HTMLHtmlElement::new("html".into_string(), None, doc.r())).root();
|
||||
let doc_html: Root<Node> = NodeCast::from_temporary(HTMLHtmlElement::new("html".to_owned(), None, doc.r())).root();
|
||||
assert!(doc_node.AppendChild(doc_html.r()).is_ok());
|
||||
|
||||
{
|
||||
// Step 5.
|
||||
let doc_head: Root<Node> = NodeCast::from_temporary(HTMLHeadElement::new("head".into_string(), None, doc.r())).root();
|
||||
let doc_head: Root<Node> = NodeCast::from_temporary(HTMLHeadElement::new("head".to_owned(), None, doc.r())).root();
|
||||
assert!(doc_html.r().AppendChild(doc_head.r()).is_ok());
|
||||
|
||||
// Step 6.
|
||||
|
@ -142,7 +144,7 @@ impl<'a> DOMImplementationMethods for JSRef<'a, DOMImplementation> {
|
|||
None => (),
|
||||
Some(title_str) => {
|
||||
// Step 6.1.
|
||||
let doc_title: Root<Node> = NodeCast::from_temporary(HTMLTitleElement::new("title".into_string(), None, doc.r())).root();
|
||||
let doc_title: Root<Node> = NodeCast::from_temporary(HTMLTitleElement::new("title".to_owned(), None, doc.r())).root();
|
||||
assert!(doc_head.r().AppendChild(doc_title.r()).is_ok());
|
||||
|
||||
// Step 6.2.
|
||||
|
@ -153,7 +155,7 @@ impl<'a> DOMImplementationMethods for JSRef<'a, DOMImplementation> {
|
|||
}
|
||||
|
||||
// Step 7.
|
||||
let doc_body: Root<HTMLBodyElement> = HTMLBodyElement::new("body".into_string(), None, doc.r()).root();
|
||||
let doc_body: Root<HTMLBodyElement> = HTMLBodyElement::new("body".to_owned(), None, doc.r()).root();
|
||||
assert!(doc_html.r().AppendChild(NodeCast::from_ref(doc_body.r())).is_ok());
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue