mirror of
https://github.com/servo/servo.git
synced 2025-08-04 21:20:23 +01:00
parent
45c0d0e17d
commit
9b691611ff
10 changed files with 123 additions and 20 deletions
|
@ -242,8 +242,11 @@ impl<View> TreeNodeRef<Node<View>> for AbstractNode<View> {
|
|||
}
|
||||
}
|
||||
|
||||
fn is_root(&self) -> bool {
|
||||
self.parent_node().is_none()
|
||||
fn is_document(&self) -> bool {
|
||||
match self.type_id() {
|
||||
DocumentNodeTypeId(*) => true,
|
||||
_ => false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -327,11 +330,6 @@ impl<'self, View> AbstractNode<View> {
|
|||
self.node().next_sibling
|
||||
}
|
||||
|
||||
/// Is this node a root?
|
||||
pub fn is_root(self) -> bool {
|
||||
self.parent_node().is_none()
|
||||
}
|
||||
|
||||
//
|
||||
// Downcasting borrows
|
||||
//
|
||||
|
@ -434,13 +432,6 @@ impl<'self, View> AbstractNode<View> {
|
|||
self.transmute_mut(f)
|
||||
}
|
||||
|
||||
pub fn is_document(self) -> bool {
|
||||
match self.type_id() {
|
||||
DocumentNodeTypeId(*) => 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() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue