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

@ -7,7 +7,7 @@ use dom::bindings::codegen::Bindings::HTMLTemplateElementBinding;
use dom::bindings::codegen::Bindings::HTMLTemplateElementBinding::HTMLTemplateElementMethods;
use dom::bindings::codegen::Bindings::NodeBinding::NodeMethods;
use dom::bindings::inheritance::Castable;
use dom::bindings::root::{MutNullableDom, Root};
use dom::bindings::root::{DomRoot, MutNullableDom};
use dom::document::Document;
use dom::documentfragment::DocumentFragment;
use dom::htmlelement::HTMLElement;
@ -38,7 +38,7 @@ impl HTMLTemplateElement {
#[allow(unrooted_must_root)]
pub fn new(local_name: LocalName,
prefix: Option<Prefix>,
document: &Document) -> Root<HTMLTemplateElement> {
document: &Document) -> DomRoot<HTMLTemplateElement> {
Node::reflect_node(box HTMLTemplateElement::new_inherited(local_name, prefix, document),
document,
HTMLTemplateElementBinding::Wrap)
@ -47,7 +47,7 @@ impl HTMLTemplateElement {
impl HTMLTemplateElementMethods for HTMLTemplateElement {
/// https://html.spec.whatwg.org/multipage/#dom-template-content
fn Content(&self) -> Root<DocumentFragment> {
fn Content(&self) -> DomRoot<DocumentFragment> {
self.contents.or_init(|| {
let doc = document_from_node(self);
doc.appropriate_template_contents_owner_document().CreateDocumentFragment()
@ -79,7 +79,7 @@ impl VirtualMethods for HTMLTemplateElement {
}
let copy = copy.downcast::<HTMLTemplateElement>().unwrap();
// Steps 2-3.
let copy_contents = Root::upcast::<Node>(copy.Content());
let copy_contents = DomRoot::upcast::<Node>(copy.Content());
let copy_contents_doc = copy_contents.owner_doc();
for child in self.Content().upcast::<Node>().children() {
let copy_child = Node::clone(