diff options
author | Michael Wu <mwu@mozilla.com> | 2015-07-15 17:08:21 -0400 |
---|---|---|
committer | Michael Wu <mwu@mozilla.com> | 2015-07-15 17:09:26 -0400 |
commit | 2752d3398e3a22232ac4acc39f635012b7d581cd (patch) | |
tree | 6dbccd920d44f9565403a4ae0a513efbedc162dd /components/script/parse | |
parent | b6b95085fbb18496d8104e350f85b6617c19862e (diff) | |
download | servo-2752d3398e3a22232ac4acc39f635012b7d581cd.tar.gz servo-2752d3398e3a22232ac4acc39f635012b7d581cd.zip |
Directly append children to output node in parse_html_fragment
Diffstat (limited to 'components/script/parse')
-rw-r--r-- | components/script/parse/html.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/components/script/parse/html.rs b/components/script/parse/html.rs index 3401239382f..6ea2dc443f8 100644 --- a/components/script/parse/html.rs +++ b/components/script/parse/html.rs @@ -14,7 +14,6 @@ use dom::bindings::codegen::InheritTypes::{HTMLFormElementDerived, NodeCast}; use dom::bindings::codegen::InheritTypes::ProcessingInstructionCast; use dom::bindings::js::{JS, Root}; use dom::bindings::js::{RootedReference}; -use dom::bindings::trace::RootedVec; use dom::characterdata::{CharacterDataHelpers, CharacterDataTypeId}; use dom::comment::Comment; use dom::document::{Document, DocumentHelpers}; @@ -284,7 +283,7 @@ pub fn parse_html(document: &Document, // https://html.spec.whatwg.org/multipage/#parsing-html-fragments pub fn parse_html_fragment(context_node: &Node, input: DOMString, - output: &mut RootedVec<JS<Node>>) { + output: &Node) { let window = window_from_node(context_node); let context_document = document_from_node(context_node); let context_document = context_document.r(); @@ -314,6 +313,6 @@ pub fn parse_html_fragment(context_node: &Node, let root_element = document.r().GetDocumentElement().expect("no document element"); let root_node = NodeCast::from_ref(root_element.r()); for child in root_node.children() { - output.push(JS::from_rooted(&child)); + output.AppendChild(child.r()).unwrap(); } } |