aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/htmlcollection.rs
diff options
context:
space:
mode:
authorAnthony Ramine <n.oxyde@gmail.com>2015-08-28 00:51:15 +0200
committerAnthony Ramine <n.oxyde@gmail.com>2015-08-30 15:30:00 +0200
commit105d99084508f72e7ff61a499df5d340e3752f14 (patch)
treee4e61295ee5e1f5ba459946b37140c0bfef321c6 /components/script/dom/htmlcollection.rs
parent67cbda4be35a63222553ca806d475581030bea4e (diff)
downloadservo-105d99084508f72e7ff61a499df5d340e3752f14.tar.gz
servo-105d99084508f72e7ff61a499df5d340e3752f14.zip
Replace many uses of to_ascii_lowercase() by make_ascii_lowercase()
Diffstat (limited to 'components/script/dom/htmlcollection.rs')
-rw-r--r--components/script/dom/htmlcollection.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/components/script/dom/htmlcollection.rs b/components/script/dom/htmlcollection.rs
index 6aee8645ad8..83458ee0338 100644
--- a/components/script/dom/htmlcollection.rs
+++ b/components/script/dom/htmlcollection.rs
@@ -68,7 +68,7 @@ impl HTMLCollection {
HTMLCollection::create(window, root, box filter)
}
- pub fn by_tag_name(window: &Window, root: &Node, tag: DOMString)
+ pub fn by_tag_name(window: &Window, root: &Node, mut tag: DOMString)
-> Root<HTMLCollection> {
if tag == "*" {
return HTMLCollection::all_elements(window, root, None);
@@ -88,9 +88,12 @@ impl HTMLCollection {
}
}
}
+ let tag_atom = Atom::from_slice(&tag);
+ tag.make_ascii_lowercase();
+ let ascii_lower_tag = Atom::from_slice(&tag);
let filter = TagNameFilter {
- tag: Atom::from_slice(&tag),
- ascii_lower_tag: Atom::from_slice(&tag.to_ascii_lowercase()),
+ tag: tag_atom,
+ ascii_lower_tag: ascii_lower_tag,
};
HTMLCollection::create(window, root, box filter)
}