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:
Anthony Ramine 2017-09-26 01:53:40 +02:00
parent 577370746e
commit f87c2a8d76
291 changed files with 1774 additions and 1770 deletions

View file

@ -12,7 +12,7 @@ use dom::bindings::codegen::UnionTypes::{HTMLOptionElementOrHTMLOptGroupElement,
use dom::bindings::error::{Error, ErrorResult};
use dom::bindings::inheritance::Castable;
use dom::bindings::reflector::reflect_dom_object;
use dom::bindings::root::{Root, RootedReference};
use dom::bindings::root::{DomRoot, RootedReference};
use dom::bindings::str::DOMString;
use dom::element::Element;
use dom::htmlcollection::{CollectionFilter, HTMLCollection};
@ -35,7 +35,7 @@ impl HTMLOptionsCollection {
}
pub fn new(window: &Window, select: &HTMLSelectElement, filter: Box<CollectionFilter + 'static>)
-> Root<HTMLOptionsCollection>
-> DomRoot<HTMLOptionsCollection>
{
reflect_dom_object(box HTMLOptionsCollection::new_inherited(select, filter),
window,
@ -61,7 +61,7 @@ impl HTMLOptionsCollectionMethods for HTMLOptionsCollection {
// https://github.com/servo/servo/issues/5875
//
// https://dom.spec.whatwg.org/#dom-htmlcollection-nameditem
fn NamedGetter(&self, name: DOMString) -> Option<Root<Element>> {
fn NamedGetter(&self, name: DOMString) -> Option<DomRoot<Element>> {
self.upcast().NamedItem(name)
}
@ -75,7 +75,7 @@ impl HTMLOptionsCollectionMethods for HTMLOptionsCollection {
// https://github.com/servo/servo/issues/5875
//
// https://dom.spec.whatwg.org/#dom-htmlcollection-item
fn IndexedGetter(&self, index: u32) -> Option<Root<Element>> {
fn IndexedGetter(&self, index: u32) -> Option<DomRoot<Element>> {
self.upcast().IndexedGetter(index)
}
@ -161,9 +161,9 @@ impl HTMLOptionsCollectionMethods for HTMLOptionsCollection {
// Step 4
let reference_node = before.and_then(|before| {
match before {
HTMLElementOrLong::HTMLElement(element) => Some(Root::upcast::<Node>(element)),
HTMLElementOrLong::HTMLElement(element) => Some(DomRoot::upcast::<Node>(element)),
HTMLElementOrLong::Long(index) => {
self.upcast().IndexedGetter(index as u32).map(Root::upcast::<Node>)
self.upcast().IndexedGetter(index as u32).map(DomRoot::upcast::<Node>)
}
}
});