diff options
author | bors-servo <metajack+bors@gmail.com> | 2014-12-17 18:45:49 -0700 |
---|---|---|
committer | bors-servo <metajack+bors@gmail.com> | 2014-12-17 18:45:49 -0700 |
commit | fbf42c951b2f53d91e2f32f8035484a07ea83493 (patch) | |
tree | 1d7bfb30cbddebba633fe1f2c8844cf4133aabc1 /components/script/dom/htmlcollection.rs | |
parent | b8900782b0fcb409f37189bdc08eb7f8b3564a5f (diff) | |
parent | 1a9be88a1d1f9138287f5b1ee04300b7e1bd7025 (diff) | |
download | servo-fbf42c951b2f53d91e2f32f8035484a07ea83493.tar.gz servo-fbf42c951b2f53d91e2f32f8035484a07ea83493.zip |
auto merge of #4405 : servo/servo/rustup_20141124, r=jdm
Diffstat (limited to 'components/script/dom/htmlcollection.rs')
-rw-r--r-- | components/script/dom/htmlcollection.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/components/script/dom/htmlcollection.rs b/components/script/dom/htmlcollection.rs index 86f977c843a..647b5ee66af 100644 --- a/components/script/dom/htmlcollection.rs +++ b/components/script/dom/htmlcollection.rs @@ -53,7 +53,7 @@ impl HTMLCollection { impl HTMLCollection { pub fn create(window: JSRef<Window>, root: JSRef<Node>, filter: Box<CollectionFilter+'static>) -> Temporary<HTMLCollection> { - HTMLCollection::new(window, Live(JS::from_rooted(root), filter)) + HTMLCollection::new(window, CollectionTypeId::Live(JS::from_rooted(root), filter)) } fn all_elements(window: JSRef<Window>, root: JSRef<Node>, @@ -178,8 +178,8 @@ impl<'a> HTMLCollectionMethods for JSRef<'a, HTMLCollection> { // http://dom.spec.whatwg.org/#dom-htmlcollection-length fn Length(self) -> u32 { match self.collection { - Static(ref elems) => elems.len() as u32, - Live(ref root, ref filter) => { + CollectionTypeId::Static(ref elems) => elems.len() as u32, + CollectionTypeId::Live(ref root, ref filter) => { let root = root.root(); HTMLCollection::traverse(*root) .filter(|element| filter.filter(*element, *root)) @@ -191,11 +191,11 @@ impl<'a> HTMLCollectionMethods for JSRef<'a, HTMLCollection> { // http://dom.spec.whatwg.org/#dom-htmlcollection-item fn Item(self, index: u32) -> Option<Temporary<Element>> { match self.collection { - Static(ref elems) => elems + CollectionTypeId::Static(ref elems) => elems .as_slice() .get(index as uint) .map(|elem| Temporary::new(elem.clone())), - Live(ref root, ref filter) => { + CollectionTypeId::Live(ref root, ref filter) => { let root = root.root(); HTMLCollection::traverse(*root) .filter(|element| filter.filter(*element, *root)) @@ -215,13 +215,13 @@ impl<'a> HTMLCollectionMethods for JSRef<'a, HTMLCollection> { // Step 2. match self.collection { - Static(ref elems) => elems.iter() + CollectionTypeId::Static(ref elems) => elems.iter() .map(|elem| elem.root()) .find(|elem| { elem.get_string_attribute(&atom!("name")) == key || elem.get_string_attribute(&atom!("id")) == key }) .map(|maybe_elem| Temporary::from_rooted(*maybe_elem)), - Live(ref root, ref filter) => { + CollectionTypeId::Live(ref root, ref filter) => { let root = root.root(); HTMLCollection::traverse(*root) .filter(|element| filter.filter(*element, *root)) |