Format Element#tagName correctly when there's a prefix.

format!("{}", atom) yields strings like "Atom('span' type=Inline)", which is
not intended here.
This commit is contained in:
Ms2ger 2014-10-30 11:51:24 +01:00
parent f9b84fd870
commit 671a487145
4 changed files with 5 additions and 24 deletions

View file

@ -656,7 +656,11 @@ impl<'a> ElementMethods for JSRef<'a, Element> {
// http://dom.spec.whatwg.org/#dom-element-tagname
fn TagName(self) -> DOMString {
let qualified_name = match self.prefix {
Some(ref prefix) => format!("{}:{}", prefix, self.local_name).into_maybe_owned(),
Some(ref prefix) => {
(format!("{:s}:{:s}",
prefix.as_slice(),
self.local_name.as_slice())).into_maybe_owned()
},
None => self.local_name.as_slice().into_maybe_owned()
};
if self.html_element_in_html_document() {