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

@ -21,7 +21,7 @@ use dom::bindings::error::{Error, ErrorResult, Fallible};
use dom::bindings::inheritance::Castable;
use dom::bindings::refcounted::Trusted;
use dom::bindings::reflector::DomObject;
use dom::bindings::root::{LayoutDom, MutNullableDom, Root};
use dom::bindings::root::{LayoutDom, DomRoot, MutNullableDom};
use dom::bindings::str::DOMString;
use dom::customevent::CustomEvent;
use dom::document::Document;
@ -337,7 +337,7 @@ impl HTMLIFrameElement {
#[allow(unrooted_must_root)]
pub fn new(local_name: LocalName,
prefix: Option<Prefix>,
document: &Document) -> Root<HTMLIFrameElement> {
document: &Document) -> DomRoot<HTMLIFrameElement> {
Node::reflect_node(box HTMLIFrameElement::new_inherited(local_name, prefix, document),
document,
HTMLIFrameElementBinding::Wrap)
@ -461,7 +461,7 @@ impl HTMLIFrameElementLayoutMethods for LayoutDom<HTMLIFrameElement> {
}
#[allow(unsafe_code)]
pub fn build_mozbrowser_custom_event(window: &Window, event: MozBrowserEvent) -> Root<CustomEvent> {
pub fn build_mozbrowser_custom_event(window: &Window, event: MozBrowserEvent) -> DomRoot<CustomEvent> {
// TODO(gw): Support mozbrowser event types that have detail which is not a string.
// See https://developer.mozilla.org/en-US/docs/Web/API/Using_the_Browser_API
// for a list of mozbrowser events.
@ -583,19 +583,19 @@ impl HTMLIFrameElementMethods for HTMLIFrameElement {
}
// https://html.spec.whatwg.org/multipage/#dom-iframe-sandbox
fn Sandbox(&self) -> Root<DOMTokenList> {
fn Sandbox(&self) -> DomRoot<DOMTokenList> {
self.sandbox.or_init(|| DOMTokenList::new(self.upcast::<Element>(), &local_name!("sandbox")))
}
// https://html.spec.whatwg.org/multipage/#dom-iframe-contentwindow
fn GetContentWindow(&self) -> Option<Root<WindowProxy>> {
fn GetContentWindow(&self) -> Option<DomRoot<WindowProxy>> {
self.browsing_context_id.get()
.and_then(|browsing_context_id| ScriptThread::find_window_proxy(browsing_context_id))
}
// https://html.spec.whatwg.org/multipage/#dom-iframe-contentdocument
// https://html.spec.whatwg.org/multipage/#concept-bcc-content-document
fn GetContentDocument(&self) -> Option<Root<Document>> {
fn GetContentDocument(&self) -> Option<DomRoot<Document>> {
// Step 1.
let pipeline_id = match self.pipeline_id.get() {
None => return None,