diff options
author | Anthony Ramine <n.oxyde@gmail.com> | 2017-09-26 01:53:40 +0200 |
---|---|---|
committer | Anthony Ramine <n.oxyde@gmail.com> | 2017-09-26 09:49:10 +0200 |
commit | f87c2a8d7616112ca924e30292db2d244cf87eec (patch) | |
tree | 7344afe7ec0ec1ac7d1d13f5385111ee9c4be332 /components/script/dom/characterdata.rs | |
parent | 577370746e2ce3da7fa25a20b8e1bbeed319df65 (diff) | |
download | servo-f87c2a8d7616112ca924e30292db2d244cf87eec.tar.gz servo-f87c2a8d7616112ca924e30292db2d244cf87eec.zip |
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.
Diffstat (limited to 'components/script/dom/characterdata.rs')
-rw-r--r-- | components/script/dom/characterdata.rs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/components/script/dom/characterdata.rs b/components/script/dom/characterdata.rs index 4d6c3a8f011..65c84f1e2c0 100644 --- a/components/script/dom/characterdata.rs +++ b/components/script/dom/characterdata.rs @@ -12,7 +12,7 @@ use dom::bindings::codegen::InheritTypes::{CharacterDataTypeId, NodeTypeId}; use dom::bindings::codegen::UnionTypes::NodeOrString; use dom::bindings::error::{Error, ErrorResult, Fallible}; use dom::bindings::inheritance::Castable; -use dom::bindings::root::{LayoutDom, Root}; +use dom::bindings::root::{DomRoot, LayoutDom}; use dom::bindings::str::DOMString; use dom::comment::Comment; use dom::document::Document; @@ -40,17 +40,17 @@ impl CharacterData { } } - pub fn clone_with_data(&self, data: DOMString, document: &Document) -> Root<Node> { + pub fn clone_with_data(&self, data: DOMString, document: &Document) -> DomRoot<Node> { match self.upcast::<Node>().type_id() { NodeTypeId::CharacterData(CharacterDataTypeId::Comment) => { - Root::upcast(Comment::new(data, &document)) + DomRoot::upcast(Comment::new(data, &document)) } NodeTypeId::CharacterData(CharacterDataTypeId::ProcessingInstruction) => { let pi = self.downcast::<ProcessingInstruction>().unwrap(); - Root::upcast(ProcessingInstruction::new(pi.Target(), data, &document)) + DomRoot::upcast(ProcessingInstruction::new(pi.Target(), data, &document)) }, NodeTypeId::CharacterData(CharacterDataTypeId::Text) => { - Root::upcast(Text::new(data, &document)) + DomRoot::upcast(Text::new(data, &document)) }, _ => unreachable!(), } @@ -237,13 +237,13 @@ impl CharacterDataMethods for CharacterData { } // https://dom.spec.whatwg.org/#dom-nondocumenttypechildnode-previouselementsibling - fn GetPreviousElementSibling(&self) -> Option<Root<Element>> { - self.upcast::<Node>().preceding_siblings().filter_map(Root::downcast).next() + fn GetPreviousElementSibling(&self) -> Option<DomRoot<Element>> { + self.upcast::<Node>().preceding_siblings().filter_map(DomRoot::downcast).next() } // https://dom.spec.whatwg.org/#dom-nondocumenttypechildnode-nextelementsibling - fn GetNextElementSibling(&self) -> Option<Root<Element>> { - self.upcast::<Node>().following_siblings().filter_map(Root::downcast).next() + fn GetNextElementSibling(&self) -> Option<DomRoot<Element>> { + self.upcast::<Node>().following_siblings().filter_map(DomRoot::downcast).next() } } |