Implementation of pseudo class 'first-child'.

This commit is contained in:
Jaeman Park 2013-10-25 15:01:01 +09:00 committed by Simon Sapin
parent 572ba98ac9
commit 6dba191efe
4 changed files with 64 additions and 25 deletions

View file

@ -164,6 +164,10 @@ impl<View> TreeNodeRef<Node<View>> for AbstractNode<View> {
_ => false
}
}
fn is_root(&self) -> bool {
self.parent_node().is_none()
}
}
impl<View> TreeNodeRefAsElement<Node<View>, Element> for AbstractNode<View> {
@ -611,7 +615,7 @@ impl Node<ScriptView> {
}
pub fn GetPreviousSibling(&self) -> Option<AbstractNode<ScriptView>> {
self.prev_sibling
self.prev_sibling
}
pub fn GetNextSibling(&self) -> Option<AbstractNode<ScriptView>> {
@ -621,7 +625,7 @@ impl Node<ScriptView> {
pub fn GetNodeValue(&self, abstract_self: AbstractNode<ScriptView>) -> DOMString {
match self.type_id {
// ProcessingInstruction
CommentNodeTypeId | TextNodeTypeId => {
CommentNodeTypeId | TextNodeTypeId => {
do abstract_self.with_imm_characterdata() |characterdata| {
characterdata.Data()
}