aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/layout_wrapper.rs
diff options
context:
space:
mode:
authorBobby Holley <bobbyholley@gmail.com>2016-09-20 17:36:17 -0700
committerBobby Holley <bobbyholley@gmail.com>2016-09-21 11:43:52 -0700
commit63124bab66b945dea16ece366a790a693c38a452 (patch)
tree3f29505b62f62fdaebf3800f0056f1a3bd5244c3 /components/script/layout_wrapper.rs
parent4aa3e589c047f006fa37c25e5bf1ba1e1b69b8e4 (diff)
downloadservo-63124bab66b945dea16ece366a790a693c38a452.tar.gz
servo-63124bab66b945dea16ece366a790a693c38a452.zip
Filter non-element / non-text nodes in LayoutIterator.
Diffstat (limited to 'components/script/layout_wrapper.rs')
-rw-r--r--components/script/layout_wrapper.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/components/script/layout_wrapper.rs b/components/script/layout_wrapper.rs
index ea22a85c5c5..19e6c7c4e79 100644
--- a/components/script/layout_wrapper.rs
+++ b/components/script/layout_wrapper.rs
@@ -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> {