diff options
author | Glenn Watson <gw@intuitionlibrary.com> | 2014-07-14 13:40:53 +1000 |
---|---|---|
committer | Glenn Watson <gw@intuitionlibrary.com> | 2014-07-16 07:33:29 +1000 |
commit | dddd3346a68d4a29b3751fe1d9b38d196350acbd (patch) | |
tree | eb0a1647997c8b37bb3a58b629dafd51f25eaeaf /src/components/script/dom/htmlcollection.rs | |
parent | d97ec6995773ee79fbde053520bc580e7b33d15d (diff) | |
download | servo-dddd3346a68d4a29b3751fe1d9b38d196350acbd.tar.gz servo-dddd3346a68d4a29b3751fe1d9b38d196350acbd.zip |
Convert element name to be stored as atom instead of string.
Diffstat (limited to 'src/components/script/dom/htmlcollection.rs')
-rw-r--r-- | src/components/script/dom/htmlcollection.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/components/script/dom/htmlcollection.rs b/src/components/script/dom/htmlcollection.rs index ed47802324b..a1d37700af6 100644 --- a/src/components/script/dom/htmlcollection.rs +++ b/src/components/script/dom/htmlcollection.rs @@ -10,6 +10,7 @@ use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object}; use dom::element::{Element, AttributeHandlers}; use dom::node::{Node, NodeHelpers}; use dom::window::Window; +use servo_util::atom::Atom; use servo_util::namespace::Namespace; use servo_util::str::{DOMString, split_html_space_chars}; @@ -60,7 +61,7 @@ impl HTMLCollection { pub fn by_tag_name(window: &JSRef<Window>, root: &JSRef<Node>, tag: DOMString) -> Temporary<HTMLCollection> { struct TagNameFilter { - tag: DOMString + tag: Atom } impl CollectionFilter for TagNameFilter { fn filter(&self, elem: &JSRef<Element>, _root: &JSRef<Node>) -> bool { @@ -68,7 +69,7 @@ impl HTMLCollection { } } let filter = TagNameFilter { - tag: tag + tag: Atom::from_slice(tag.as_slice()) }; HTMLCollection::create(window, root, box filter) } @@ -76,7 +77,7 @@ impl HTMLCollection { pub fn by_tag_name_ns(window: &JSRef<Window>, root: &JSRef<Node>, tag: DOMString, namespace: Namespace) -> Temporary<HTMLCollection> { struct TagNameNSFilter { - tag: DOMString, + tag: Atom, namespace: Namespace } impl CollectionFilter for TagNameNSFilter { @@ -85,7 +86,7 @@ impl HTMLCollection { } } let filter = TagNameNSFilter { - tag: tag, + tag: Atom::from_slice(tag.as_slice()), namespace: namespace }; HTMLCollection::create(window, root, box filter) |