diff options
author | Simon Sapin <simon.sapin@exyr.org> | 2013-10-16 19:22:44 +0100 |
---|---|---|
committer | Simon Sapin <simon.sapin@exyr.org> | 2013-10-16 19:22:44 +0100 |
commit | 6d808fbdd0b1f1ed383752c85653ceb8370fe22d (patch) | |
tree | 2fcd010ded977bba3bd546909a4523a061dcac5b /src/components/script/dom/node.rs | |
parent | 6c41be9c13ef3c82fdc5a88cfbbcc0719c988cb8 (diff) | |
download | servo-6d808fbdd0b1f1ed383752c85653ceb8370fe22d.tar.gz servo-6d808fbdd0b1f1ed383752c85653ceb8370fe22d.zip |
Move AbastractNode::is_element to the TreeNodeRef trait.
Diffstat (limited to 'src/components/script/dom/node.rs')
-rw-r--r-- | src/components/script/dom/node.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/components/script/dom/node.rs b/src/components/script/dom/node.rs index d661e9d53d1..db5ff6c88da 100644 --- a/src/components/script/dom/node.rs +++ b/src/components/script/dom/node.rs @@ -154,6 +154,13 @@ impl<View> TreeNodeRef<Node<View>> for AbstractNode<View> { fn with_mut_base<R>(&self, callback: &fn(&mut Node<View>) -> R) -> R { self.transmute_mut(callback) } + + fn is_element(self) -> bool { + match self.type_id() { + ElementNodeTypeId(*) => true, + _ => false + } + } } impl<View> TreeNodeRefAsElement<Node<View>, Element> for AbstractNode<View> { @@ -317,13 +324,6 @@ impl<'self, View> AbstractNode<View> { self.transmute_mut(f) } - pub fn is_element(self) -> bool { - match self.type_id() { - ElementNodeTypeId(*) => true, - _ => false - } - } - // FIXME: This should be doing dynamic borrow checking for safety. pub fn with_imm_element<R>(self, f: &fn(&Element) -> R) -> R { if !self.is_element() { |