mirror of
https://github.com/servo/servo.git
synced 2025-09-30 00:29:14 +01:00
Fixes related to file input and File API
This commit is contained in:
parent
e65009f317
commit
e0f3cdafe1
3 changed files with 15 additions and 6 deletions
|
@ -40,7 +40,11 @@ impl FileListMethods for FileList {
|
|||
|
||||
// https://w3c.github.io/FileAPI/#dfn-item
|
||||
fn Item(&self, index: u32) -> Option<Root<File>> {
|
||||
Some(Root::from_ref(&*(self.list[index as usize])))
|
||||
if (index as usize) < self.list.len() {
|
||||
Some(Root::from_ref(&*(self.list[index as usize])))
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
// check-tidy: no specs after this line
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue