diff options
-rw-r--r-- | components/script/dom/element.rs | 5 | ||||
-rw-r--r-- | components/script/dom/node.rs | 6 | ||||
-rw-r--r-- | components/script/parse/html.rs | 5 |
3 files changed, 8 insertions, 8 deletions
diff --git a/components/script/dom/element.rs b/components/script/dom/element.rs index b67014f5676..0aa5f9327b4 100644 --- a/components/script/dom/element.rs +++ b/components/script/dom/element.rs @@ -55,7 +55,6 @@ use dom::node::{window_from_node}; use dom::nodelist::NodeList; use dom::virtualmethods::{VirtualMethods, vtable_for}; use devtools_traits::AttrInfo; -use parse::html::HTMLInput; use style::legacy::{SimpleColorAttribute, UnsignedIntegerAttribute, IntegerAttribute, LengthAttribute}; use selectors::matching::matches; use style::properties::{PropertyDeclarationBlock, PropertyDeclaration, parse_style_attribute}; @@ -1177,7 +1176,7 @@ impl<'a> ElementMethods for JSRef<'a, Element> { // with the new value as markup, and the context object as the context element. // 2. Replace all with fragment within the context object. let context_node: JSRef<Node> = NodeCast::from_ref(self); - context_node.parse_fragment(HTMLInput::InputString(value)) + context_node.parse_fragment(value) .and_then(|frag| Ok(Node::replace_all(Some(NodeCast::from_ref(frag.root().r())), context_node))) } @@ -1218,7 +1217,7 @@ impl<'a> ElementMethods for JSRef<'a, Element> { // 5. Let fragment be the result of invoking the fragment parsing algorithm with // the new value as markup, and parent as the context element. // 6. Replace the context object with fragment within the context object's parent. - parent.r().parse_fragment(HTMLInput::InputString(value)) + parent.r().parse_fragment(value) .and_then(|frag| { let frag = frag.root(); let frag_node: JSRef<Node> = NodeCast::from_ref(frag.r()); diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs index 9bc8e9879a4..53a3e1792b7 100644 --- a/components/script/dom/node.rs +++ b/components/script/dom/node.rs @@ -46,7 +46,7 @@ use dom::window::{Window, WindowHelpers}; use geom::rect::Rect; use layout_interface::{LayoutChan, Msg}; use devtools_traits::NodeInfo; -use parse::html::{HTMLInput, parse_html_fragment}; +use parse::html::parse_html_fragment; use script_traits::UntrustedNodeAddress; use util::geometry::Au; use util::str::{DOMString, null_str_as_empty}; @@ -504,7 +504,7 @@ pub trait NodeHelpers<'a> { fn teardown(self); - fn parse_fragment(self, markup: HTMLInput) -> Fallible<Temporary<DocumentFragment>>; + fn parse_fragment(self, markup: DOMString) -> Fallible<Temporary<DocumentFragment>>; } impl<'a> NodeHelpers<'a> for JSRef<'a, Node> { @@ -933,7 +933,7 @@ impl<'a> NodeHelpers<'a> for JSRef<'a, Node> { } // https://dvcs.w3.org/hg/innerhtml/raw-file/tip/index.html#dfn-concept-parse-fragment - fn parse_fragment(self, markup: HTMLInput) -> Fallible<Temporary<DocumentFragment>> { + fn parse_fragment(self, markup: DOMString) -> Fallible<Temporary<DocumentFragment>> { let context_node: JSRef<Node> = NodeCast::from_ref(self); let context_document = document_from_node(self).root(); let new_children = diff --git a/components/script/parse/html.rs b/components/script/parse/html.rs index 1667afe288d..ad8c56ba613 100644 --- a/components/script/parse/html.rs +++ b/components/script/parse/html.rs @@ -31,6 +31,7 @@ use encoding::all::UTF_8; use encoding::types::{Encoding, DecoderTrap}; use net_traits::{ProgressMsg, LoadResponse}; +use util::str::DOMString; use util::task_state; use util::task_state::IN_HTML_PARSER; use std::ascii::AsciiExt; @@ -330,7 +331,7 @@ pub fn parse_html(document: JSRef<Document>, } // https://html.spec.whatwg.org/multipage/syntax.html#parsing-html-fragments -pub fn parse_html_fragment(context_node: JSRef<Node>, input: HTMLInput) -> Vec<Temporary<Node>> { +pub fn parse_html_fragment(context_node: JSRef<Node>, input: DOMString) -> Vec<Temporary<Node>> { let window = window_from_node(context_node).root(); let context_document = document_from_node(context_node).root(); let url = context_document.r().url(); @@ -359,7 +360,7 @@ pub fn parse_html_fragment(context_node: JSRef<Node>, input: HTMLInput) -> Vec<T context_elem: context_node, form_elem: form, }; - parse_html(document.r(), input, &url, Some(fragment_context)); + parse_html(document.r(), HTMLInput::InputString(input), &url, Some(fragment_context)); // "14. Return the child nodes of root, in tree order." let root_element = document.r().GetDocumentElement().expect("no document element").root(); |