mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Rename Root<T> to DomRoot<T>
In a later PR, DomRoot<T> will become a type alias of Root<Dom<T>>, where Root<T> will be able to handle all the things that need to be rooted that have a stable traceable address that doesn't move for the whole lifetime of the root. Stay tuned.
This commit is contained in:
parent
577370746e
commit
f87c2a8d76
291 changed files with 1774 additions and 1770 deletions
|
@ -5,7 +5,7 @@
|
|||
use dom::bindings::codegen::Bindings::FileListBinding;
|
||||
use dom::bindings::codegen::Bindings::FileListBinding::FileListMethods;
|
||||
use dom::bindings::reflector::{Reflector, reflect_dom_object};
|
||||
use dom::bindings::root::{Dom, Root};
|
||||
use dom::bindings::root::{Dom, DomRoot};
|
||||
use dom::file::File;
|
||||
use dom::window::Window;
|
||||
use dom_struct::dom_struct;
|
||||
|
@ -28,7 +28,7 @@ impl FileList {
|
|||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(window: &Window, files: Vec<Root<File>>) -> Root<FileList> {
|
||||
pub fn new(window: &Window, files: Vec<DomRoot<File>>) -> DomRoot<FileList> {
|
||||
reflect_dom_object(box FileList::new_inherited(files.iter().map(|r| Dom::from_ref(&**r)).collect()),
|
||||
window,
|
||||
FileListBinding::Wrap)
|
||||
|
@ -46,16 +46,16 @@ impl FileListMethods for FileList {
|
|||
}
|
||||
|
||||
// https://w3c.github.io/FileAPI/#dfn-item
|
||||
fn Item(&self, index: u32) -> Option<Root<File>> {
|
||||
fn Item(&self, index: u32) -> Option<DomRoot<File>> {
|
||||
if (index as usize) < self.list.len() {
|
||||
Some(Root::from_ref(&*(self.list[index as usize])))
|
||||
Some(DomRoot::from_ref(&*(self.list[index as usize])))
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
// check-tidy: no specs after this line
|
||||
fn IndexedGetter(&self, index: u32) -> Option<Root<File>> {
|
||||
fn IndexedGetter(&self, index: u32) -> Option<DomRoot<File>> {
|
||||
self.Item(index)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue