diff options
author | Alan Jeffrey <ajeffrey@mozilla.com> | 2015-11-11 16:26:53 -0600 |
---|---|---|
committer | Alan Jeffrey <ajeffrey@mozilla.com> | 2015-11-12 17:52:59 -0600 |
commit | 84bde75b420e7035cee891781a3805d5c8c4cdeb (patch) | |
tree | 061040f39149d530b059a998be832c7f9b0a8134 /components/script/parse/html.rs | |
parent | 736323a7796594a5b966ab6ae690e5cc51225a14 (diff) | |
download | servo-84bde75b420e7035cee891781a3805d5c8c4cdeb.tar.gz servo-84bde75b420e7035cee891781a3805d5c8c4cdeb.zip |
Replaced DOMString constructor by conversion functions.
Replaced DOMString(...) by DOMString::from(...).
Replaced ....0 by String::from(...).
Removed any uses of .to_owner() in DOMString::from("...").
Diffstat (limited to 'components/script/parse/html.rs')
-rw-r--r-- | components/script/parse/html.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/components/script/parse/html.rs b/components/script/parse/html.rs index 10115b9a235..0f0b6a00f87 100644 --- a/components/script/parse/html.rs +++ b/components/script/parse/html.rs @@ -71,14 +71,14 @@ impl<'a> TreeSink for servohtmlparser::Sink { ElementCreator::ParserCreated); for attr in attrs { - elem.set_attribute_from_parser(attr.name, DOMString(attr.value.into()), None); + elem.set_attribute_from_parser(attr.name, DOMString::from(String::from(attr.value)), None); } JS::from_ref(elem.upcast()) } fn create_comment(&mut self, text: StrTendril) -> JS<Node> { - let comment = Comment::new(DOMString(text.into()), &*self.document); + let comment = Comment::new(DOMString::from(String::from(text)), &*self.document); JS::from_ref(comment.upcast()) } @@ -115,8 +115,8 @@ impl<'a> TreeSink for servohtmlparser::Sink { system_id: StrTendril) { let doc = &*self.document; let doctype = DocumentType::new( - DOMString(name.into()), Some(DOMString(public_id.into())), - Some(DOMString(system_id.into())), doc); + DOMString::from(String::from(name)), Some(DOMString::from(String::from(public_id))), + Some(DOMString::from(String::from(system_id))), doc); doc.upcast::<Node>().AppendChild(doctype.upcast()).expect("Appending failed"); } @@ -124,7 +124,7 @@ impl<'a> TreeSink for servohtmlparser::Sink { let elem = target.downcast::<Element>() .expect("tried to set attrs on non-Element in HTML parsing"); for attr in attrs { - elem.set_attribute_from_parser(attr.name, DOMString(attr.value.into()), None); + elem.set_attribute_from_parser(attr.name, DOMString::from(String::from(attr.value)), None); } } @@ -247,7 +247,7 @@ pub fn parse_html(document: &Document, ParseContext::Fragment(fc) => ServoHTMLParser::new_for_fragment(Some(url), document, fc), }; - parser.parse_chunk(input.0.into()); + parser.parse_chunk(String::from(input)); } // https://html.spec.whatwg.org/multipage/#parsing-html-fragments |