mirror of
https://github.com/servo/servo.git
synced 2025-08-04 21:20:23 +01:00
Replace uint/int by usize/isize in various places.
This commit is contained in:
parent
9c863a6bd4
commit
6d30ec77c8
14 changed files with 36 additions and 34 deletions
|
@ -189,16 +189,17 @@ impl<'a> HTMLCollectionMethods for JSRef<'a, HTMLCollection> {
|
|||
|
||||
// http://dom.spec.whatwg.org/#dom-htmlcollection-item
|
||||
fn Item(self, index: u32) -> Option<Temporary<Element>> {
|
||||
let index = index as usize;
|
||||
match self.collection {
|
||||
CollectionTypeId::Static(ref elems) => elems
|
||||
.as_slice()
|
||||
.get(index as uint)
|
||||
.get(index)
|
||||
.map(|elem| Temporary::new(elem.clone())),
|
||||
CollectionTypeId::Live(ref root, ref filter) => {
|
||||
let root = root.root();
|
||||
HTMLCollection::traverse(root.r())
|
||||
.filter(|element| filter.filter(*element, root.r()))
|
||||
.nth(index as uint)
|
||||
.nth(index)
|
||||
.clone()
|
||||
.map(Temporary::from_rooted)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue