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/servoparser/html.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/servoparser/html.rs')
-rw-r--r-- | components/script/dom/servoparser/html.rs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/components/script/dom/servoparser/html.rs b/components/script/dom/servoparser/html.rs index 54635c15bb0..86c2b551940 100644 --- a/components/script/dom/servoparser/html.rs +++ b/components/script/dom/servoparser/html.rs @@ -6,7 +6,7 @@ use dom::bindings::codegen::Bindings::HTMLTemplateElementBinding::HTMLTemplateElementMethods; use dom::bindings::inheritance::{Castable, CharacterDataTypeId, NodeTypeId}; -use dom::bindings::root::{Dom, Root}; +use dom::bindings::root::{Dom, DomRoot}; use dom::bindings::trace::JSTraceable; use dom::characterdata::CharacterData; use dom::document::Document; @@ -75,10 +75,10 @@ impl Tokenizer { } } - pub fn feed(&mut self, input: &mut BufferQueue) -> Result<(), Root<HTMLScriptElement>> { + pub fn feed(&mut self, input: &mut BufferQueue) -> Result<(), DomRoot<HTMLScriptElement>> { match self.inner.feed(input) { TokenizerResult::Done => Ok(()), - TokenizerResult::Script(script) => Err(Root::from_ref(script.downcast().unwrap())), + TokenizerResult::Script(script) => Err(DomRoot::from_ref(script.downcast().unwrap())), } } @@ -140,16 +140,16 @@ fn end_element<S: Serializer>(node: &Element, serializer: &mut S) -> io::Result< enum SerializationCommand { - OpenElement(Root<Element>), - CloseElement(Root<Element>), - SerializeNonelement(Root<Node>), + OpenElement(DomRoot<Element>), + CloseElement(DomRoot<Element>), + SerializeNonelement(DomRoot<Node>), } struct SerializationIterator { stack: Vec<SerializationCommand>, } -fn rev_children_iter(n: &Node) -> impl Iterator<Item=Root<Node>>{ +fn rev_children_iter(n: &Node) -> impl Iterator<Item=DomRoot<Node>>{ match n.downcast::<HTMLTemplateElement>() { Some(t) => t.Content().upcast::<Node>().rev_children(), None => n.rev_children(), @@ -173,8 +173,8 @@ impl SerializationIterator { fn push_node(&mut self, n: &Node) { match n.downcast::<Element>() { - Some(e) => self.stack.push(SerializationCommand::OpenElement(Root::from_ref(e))), - None => self.stack.push(SerializationCommand::SerializeNonelement(Root::from_ref(n))), + Some(e) => self.stack.push(SerializationCommand::OpenElement(DomRoot::from_ref(e))), + None => self.stack.push(SerializationCommand::SerializeNonelement(DomRoot::from_ref(n))), } } } |