mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Filter non-element / non-text nodes in LayoutIterator.
This commit is contained in:
parent
4aa3e589c0
commit
63124bab66
2 changed files with 15 additions and 1 deletions
|
@ -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> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue