diff options
Diffstat (limited to 'src/components/script')
-rw-r--r-- | src/components/script/dom/document.rs | 2 | ||||
-rw-r--r-- | src/components/script/dom/htmldocument.rs | 2 | ||||
-rw-r--r-- | src/components/script/dom/node.rs | 48 | ||||
-rw-r--r-- | src/components/script/html/hubbub_html_parser.rs | 2 |
4 files changed, 27 insertions, 27 deletions
diff --git a/src/components/script/dom/document.rs b/src/components/script/dom/document.rs index 043eec3646a..5ba1b10a90d 100644 --- a/src/components/script/dom/document.rs +++ b/src/components/script/dom/document.rs @@ -18,7 +18,7 @@ use dom::htmltitleelement::HTMLTitleElement; use js::jsapi::{JS_AddObjectRoot, JS_RemoveObjectRoot, JSObject, JSContext, JSVal}; use js::glue::RUST_OBJECT_TO_JSVAL; -use servo_util::tree::{TreeNodeRef, TreeUtils}; +use servo_util::tree::TreeNodeRef; use std::cast; use std::ptr; diff --git a/src/components/script/dom/htmldocument.rs b/src/components/script/dom/htmldocument.rs index 52c15fc36cf..b839f0c4960 100644 --- a/src/components/script/dom/htmldocument.rs +++ b/src/components/script/dom/htmldocument.rs @@ -13,7 +13,7 @@ use dom::window::Window; use js::jsapi::{JSObject, JSContext}; -use servo_util::tree::TreeUtils; +use servo_util::tree::TreeNodeRef; use std::libc; use std::ptr; diff --git a/src/components/script/dom/node.rs b/src/components/script/dom/node.rs index bee3dac63d7..1f53bb2ac09 100644 --- a/src/components/script/dom/node.rs +++ b/src/components/script/dom/node.rs @@ -24,7 +24,7 @@ use std::uint; use js::jsapi::{JSObject, JSContext}; use js::rust::Compartment; use netsurfcss::util::VoidPtrLike; -use servo_util::tree::{TreeNode, TreeNodeRef, TreeUtils}; +use servo_util::tree::{TreeNode, TreeNodeRef}; // // The basic Node structure @@ -177,41 +177,39 @@ impl<View> Clone for AbstractNode<View> { } } -impl<View> TreeNode<AbstractNode<View>> for Node<View> { - fn parent_node(&self) -> Option<AbstractNode<View>> { - self.parent_node +impl<View> TreeNodeRef<Node<View>> for AbstractNode<View> { + fn parent_node(node: &Node<View>) -> Option<AbstractNode<View>> { + node.parent_node } - fn first_child(&self) -> Option<AbstractNode<View>> { - self.first_child + fn first_child(node: &Node<View>) -> Option<AbstractNode<View>> { + node.first_child } - fn last_child(&self) -> Option<AbstractNode<View>> { - self.last_child + fn last_child(node: &Node<View>) -> Option<AbstractNode<View>> { + node.last_child } - fn prev_sibling(&self) -> Option<AbstractNode<View>> { - self.prev_sibling + fn prev_sibling(node: &Node<View>) -> Option<AbstractNode<View>> { + node.prev_sibling } - fn next_sibling(&self) -> Option<AbstractNode<View>> { - self.next_sibling + fn next_sibling(node: &Node<View>) -> Option<AbstractNode<View>> { + node.next_sibling } - fn set_parent_node(&mut self, new_parent_node: Option<AbstractNode<View>>) { - self.parent_node = new_parent_node + fn set_parent_node(node: &mut Node<View>, new_parent_node: Option<AbstractNode<View>>) { + node.parent_node = new_parent_node } - fn set_first_child(&mut self, new_first_child: Option<AbstractNode<View>>) { - self.first_child = new_first_child + fn set_first_child(node: &mut Node<View>, new_first_child: Option<AbstractNode<View>>) { + node.first_child = new_first_child } - fn set_last_child(&mut self, new_last_child: Option<AbstractNode<View>>) { - self.last_child = new_last_child + fn set_last_child(node: &mut Node<View>, new_last_child: Option<AbstractNode<View>>) { + node.last_child = new_last_child } - fn set_prev_sibling(&mut self, new_prev_sibling: Option<AbstractNode<View>>) { - self.prev_sibling = new_prev_sibling + fn set_prev_sibling(node: &mut Node<View>, new_prev_sibling: Option<AbstractNode<View>>) { + node.prev_sibling = new_prev_sibling } - fn set_next_sibling(&mut self, new_next_sibling: Option<AbstractNode<View>>) { - self.next_sibling = new_next_sibling + fn set_next_sibling(node: &mut Node<View>, new_next_sibling: Option<AbstractNode<View>>) { + node.next_sibling = new_next_sibling } -} -impl<View> TreeNodeRef<Node<View>> for AbstractNode<View> { // FIXME: The duplication between `with_base` and `with_mut_base` is ugly. fn with_base<R>(&self, callback: &fn(&Node<View>) -> R) -> R { self.transmute(callback) @@ -222,6 +220,8 @@ impl<View> TreeNodeRef<Node<View>> for AbstractNode<View> { } } +impl<View> TreeNode<AbstractNode<View>> for Node<View> { } + impl<'self, View> AbstractNode<View> { // Unsafe accessors diff --git a/src/components/script/html/hubbub_html_parser.rs b/src/components/script/html/hubbub_html_parser.rs index 2409d4c0a6a..005f6d6dbbd 100644 --- a/src/components/script/html/hubbub_html_parser.rs +++ b/src/components/script/html/hubbub_html_parser.rs @@ -63,7 +63,7 @@ use servo_msg::constellation_msg::SubpageId; use servo_net::image_cache_task::ImageCacheTask; use servo_net::image_cache_task; use servo_net::resource_task::{Done, Load, Payload, ResourceTask}; -use servo_util::tree::TreeUtils; +use servo_util::tree::TreeNodeRef; use servo_util::url::make_url; use extra::url::Url; use extra::future::{Future, from_port}; |