diff options
author | Ms2ger <ms2ger@gmail.com> | 2014-10-29 23:36:24 +0100 |
---|---|---|
committer | Ms2ger <ms2ger@gmail.com> | 2014-10-30 18:03:19 +0100 |
commit | 82216fd5c0b188d237a972e83cd7bd2ee03bb316 (patch) | |
tree | 4049383832b009cfc7717f650afb5cb947d23bd7 /components/script/dom/document.rs | |
parent | f9b84fd8704e249682cc12dfeb2da61b39a88d92 (diff) | |
download | servo-82216fd5c0b188d237a972e83cd7bd2ee03bb316.tar.gz servo-82216fd5c0b188d237a972e83cd7bd2ee03bb316.zip |
Move build_element_from_tag out of the HTML parser.
This function is not particular to the parser, so should live in the DOM.
Diffstat (limited to 'components/script/dom/document.rs')
-rw-r--r-- | components/script/dom/document.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs index 76505df7148..cae7132a14d 100644 --- a/components/script/dom/document.rs +++ b/components/script/dom/document.rs @@ -33,7 +33,7 @@ use dom::customevent::CustomEvent; use dom::documentfragment::DocumentFragment; use dom::documenttype::DocumentType; use dom::domimplementation::DOMImplementation; -use dom::element::{Element, AttributeHandlers, get_attribute_parts}; +use dom::element::{Element, ScriptCreated, AttributeHandlers, get_attribute_parts}; use dom::element::{HTMLHeadElementTypeId, HTMLTitleElementTypeId}; use dom::element::{HTMLBodyElementTypeId, HTMLFrameSetElementTypeId}; use dom::event::{Event, DoesNotBubble, NotCancelable}; @@ -55,7 +55,6 @@ use dom::range::Range; use dom::treewalker::TreeWalker; use dom::uievent::UIEvent; use dom::window::{Window, WindowHelpers}; -use parse::html::{build_element_from_tag, ScriptCreated}; use servo_util::namespace; use servo_util::str::{DOMString, split_html_space_chars}; @@ -529,7 +528,7 @@ impl<'a> DocumentMethods for JSRef<'a, Document> { } let local_name = local_name.as_slice().to_ascii_lower(); let name = QualName::new(ns!(HTML), Atom::from_slice(local_name.as_slice())); - Ok(build_element_from_tag(name, None, self, ScriptCreated)) + Ok(Element::create(name, None, self, ScriptCreated)) } // http://dom.spec.whatwg.org/#dom-document-createelementns @@ -574,8 +573,8 @@ impl<'a> DocumentMethods for JSRef<'a, Document> { if ns == ns!(HTML) { let name = QualName::new(ns!(HTML), Atom::from_slice(local_name_from_qname)); - Ok(build_element_from_tag(name, prefix_from_qname.map(|s| s.to_string()), self, - ScriptCreated)) + Ok(Element::create(name, prefix_from_qname.map(|s| s.to_string()), self, + ScriptCreated)) } else { Ok(Element::new(local_name_from_qname.to_string(), ns, prefix_from_qname.map(|s| s.to_string()), self)) |