aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/htmlcollection.rs
diff options
context:
space:
mode:
authorJosh Matthews <josh@joshmatthews.net>2014-09-18 09:20:19 -0400
committerJosh Matthews <josh@joshmatthews.net>2014-09-18 09:20:19 -0400
commit9607b468bc50496c0de3706d22efaa6fdc68b089 (patch)
tree85615a722eb65681ebccee8d98dc47c7895573c9 /components/script/dom/htmlcollection.rs
parent7158cac2dcaabacede36924f52167b8e7b402e7a (diff)
downloadservo-9607b468bc50496c0de3706d22efaa6fdc68b089.tar.gz
servo-9607b468bc50496c0de3706d22efaa6fdc68b089.zip
Revert "script: Use atom comparison in more places, especially for attributes." for persistent test failures.
This reverts commit 874db261046d6155b1942efa106d2e0014295d6d.
Diffstat (limited to 'components/script/dom/htmlcollection.rs')
-rw-r--r--components/script/dom/htmlcollection.rs16
1 files changed, 7 insertions, 9 deletions
diff --git a/components/script/dom/htmlcollection.rs b/components/script/dom/htmlcollection.rs
index 78dd03d9859..bd07b82e53e 100644
--- a/components/script/dom/htmlcollection.rs
+++ b/components/script/dom/htmlcollection.rs
@@ -146,17 +146,15 @@ impl HTMLCollection {
pub fn by_class_name(window: &JSRef<Window>, root: &JSRef<Node>, classes: DOMString)
-> Temporary<HTMLCollection> {
struct ClassNameFilter {
- classes: Vec<Atom>
+ classes: Vec<DOMString>
}
impl CollectionFilter for ClassNameFilter {
fn filter(&self, elem: &JSRef<Element>, _root: &JSRef<Node>) -> bool {
- self.classes.iter().all(|class| elem.has_class(class))
+ self.classes.iter().all(|class| elem.has_class(class.as_slice()))
}
}
let filter = ClassNameFilter {
- classes: split_html_space_chars(classes.as_slice()).map(|class| {
- Atom::from_slice(class)
- }).collect()
+ classes: split_html_space_chars(classes.as_slice()).map(|class| class.to_string()).collect()
};
HTMLCollection::create(window, root, box filter)
}
@@ -222,8 +220,8 @@ impl<'a> HTMLCollectionMethods for JSRef<'a, HTMLCollection> {
Static(ref elems) => elems.iter()
.map(|elem| elem.root())
.find(|elem| {
- elem.get_string_attribute(&satom!("name")) == key ||
- elem.get_string_attribute(&satom!("id")) == key })
+ elem.get_string_attribute("name") == key ||
+ elem.get_string_attribute("id") == key })
.map(|maybe_elem| Temporary::from_rooted(&*maybe_elem)),
Live(ref root, ref filter) => {
let root = root.root();
@@ -234,8 +232,8 @@ impl<'a> HTMLCollectionMethods for JSRef<'a, HTMLCollection> {
.map(|elem| elem.clone())
})
.find(|elem| {
- elem.get_string_attribute(&satom!("name")) == key ||
- elem.get_string_attribute(&satom!("id")) == key })
+ elem.get_string_attribute("name") == key ||
+ elem.get_string_attribute("id") == key })
.map(|maybe_elem| Temporary::from_rooted(&maybe_elem))
}
}