mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +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
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue