Filter non-element / non-text nodes in LayoutIterator.

This commit is contained in:
Bobby Holley 2016-09-20 17:36:17 -07:00
parent 4aa3e589c0
commit 63124bab66
2 changed files with 15 additions and 1 deletions

View file

@ -734,9 +734,14 @@ impl<'ln> NodeInfo for ServoThreadSafeLayoutNode<'ln> {
fn is_element(&self) -> bool {
if let Some(LayoutNodeType::Element(_)) = self.type_id() { true } else { false }
}
fn is_text_node(&self) -> bool {
if let Some(LayoutNodeType::Text) = self.type_id() { true } else { false }
}
fn needs_layout(&self) -> bool {
self.pseudo != PseudoElementType::Normal || self.is_element() || self.is_text_node()
}
}
impl<'ln> ThreadSafeLayoutNode for ServoThreadSafeLayoutNode<'ln> {