diff options
author | Ms2ger <ms2ger@gmail.com> | 2013-11-02 21:13:37 +0100 |
---|---|---|
committer | Ms2ger <ms2ger@gmail.com> | 2013-11-02 21:13:37 +0100 |
commit | 7700a892fcae8f153885f38a81bbc44d4d4b7510 (patch) | |
tree | 35bb9ad5b6931652629e00bac3bdcaa742165c2b /src/components/script/html/hubbub_html_parser.rs | |
parent | b4559334bbd744a63c403478946bb7636dbc2552 (diff) | |
download | servo-7700a892fcae8f153885f38a81bbc44d4d4b7510.tar.gz servo-7700a892fcae8f153885f38a81bbc44d4d4b7510.zip |
Cleanup build_element_from_tag's signature.
Diffstat (limited to 'src/components/script/html/hubbub_html_parser.rs')
-rw-r--r-- | src/components/script/html/hubbub_html_parser.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/components/script/html/hubbub_html_parser.rs b/src/components/script/html/hubbub_html_parser.rs index 21b18b69577..de87a13134e 100644 --- a/src/components/script/html/hubbub_html_parser.rs +++ b/src/components/script/html/hubbub_html_parser.rs @@ -39,7 +39,7 @@ macro_rules! handle_newable_element( $ctor: ident $(, $arg:expr )*) => ( if eq_slice($localName, $string) { - return $ctor::new(($localName).to_str(), $document $(, $arg)*); + return $ctor::new($localName, $document $(, $arg)*); } ) ) @@ -162,7 +162,7 @@ fn js_script_listener(to_parent: SharedChan<HtmlDiscoveryMessage>, // Silly macros to handle constructing DOM nodes. This produces bad code and should be optimized // via atomization (issue #85). -pub fn build_element_from_tag(_cx: *JSContext, tag: &str, document: AbstractDocument) -> AbstractNode<ScriptView> { +pub fn build_element_from_tag(tag: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> { // TODO (Issue #85): use atoms handle_newable_element!(document, tag, "a", HTMLAnchorElement); handle_newable_element!(document, tag, "applet", HTMLAppletElement); @@ -242,7 +242,7 @@ pub fn build_element_from_tag(_cx: *JSContext, tag: &str, document: AbstractDocu handle_newable_element!(document, tag, "ul", HTMLUListElement); handle_newable_element!(document, tag, "video", HTMLVideoElement); - return HTMLUnknownElement::new(tag.to_str(), document); + return HTMLUnknownElement::new(tag, document); } pub fn parse_html(cx: *JSContext, @@ -336,7 +336,7 @@ pub fn parse_html(cx: *JSContext, }, create_element: |tag: ~hubbub::Tag| { debug!("create element"); - let node = build_element_from_tag(cx, tag.name, document); + let node = build_element_from_tag(tag.name.clone(), document); debug!("-- attach attrs"); do node.as_mut_element |element| { |