diff options
Diffstat (limited to 'components/script/dom/element.rs')
-rw-r--r-- | components/script/dom/element.rs | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/components/script/dom/element.rs b/components/script/dom/element.rs index a81c515aef8..b317974569e 100644 --- a/components/script/dom/element.rs +++ b/components/script/dom/element.rs @@ -854,16 +854,7 @@ impl<'a> ElementMethods for JSRef<'a, Element> { // http://dom.spec.whatwg.org/#dom-element-hasattribute fn HasAttribute(self, name: DOMString) -> bool { - // Step 1. - if self.html_element_in_html_document() { - // TODO(pcwalton): Small string optimization here. - return self.has_attribute(&Atom::from_slice(name.as_slice() - .to_ascii_lower() - .as_slice())) - } - - // Step 2. - self.has_attribute(&Atom::from_slice(name.as_slice())) + self.GetAttribute(name).is_some() } // http://dom.spec.whatwg.org/#dom-element-hasattributens |