aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/layout_wrapper.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/layout_wrapper.rs')
-rw-r--r--components/script/layout_wrapper.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/components/script/layout_wrapper.rs b/components/script/layout_wrapper.rs
index 4d615d2a50e..cad48e36a64 100644
--- a/components/script/layout_wrapper.rs
+++ b/components/script/layout_wrapper.rs
@@ -783,15 +783,16 @@ impl<'ln> ServoThreadSafeLayoutNode<'ln> {
impl<'ln> NodeInfo for ServoThreadSafeLayoutNode<'ln> {
fn is_element(&self) -> bool {
- if let Some(LayoutNodeType::Element(_)) = self.type_id() { true } else { false }
+ self.pseudo == PseudoElementType::Normal && self.node.is_element()
}
fn is_text_node(&self) -> bool {
- if let Some(LayoutNodeType::Text) = self.type_id() { true } else { false }
+ self.pseudo == PseudoElementType::Normal && self.node.is_text_node()
}
fn needs_layout(&self) -> bool {
- self.pseudo != PseudoElementType::Normal || self.is_element() || self.is_text_node()
+ self.pseudo != PseudoElementType::Normal ||
+ self.node.is_element() || self.node.is_text_node()
}
}