diff --git a/components/style/gecko/pseudo_element.rs b/components/style/gecko/pseudo_element.rs index 0a3d4647e00..8da1c2832ca 100644 --- a/components/style/gecko/pseudo_element.rs +++ b/components/style/gecko/pseudo_element.rs @@ -160,12 +160,11 @@ impl PseudoElement { /// Whether this pseudo-element should actually exist if it has /// the given styles. - pub fn should_exist(&self, style: &ComputedValues) -> bool - { - let display = style.get_box().clone_display(); - if display == display::T::none { + pub fn should_exist(&self, style: &ComputedValues) -> bool { + if style.get_box().clone_display() == display::T::none { return false; } + if self.is_before_or_after() && style.ineffective_content_property() { return false; } diff --git a/components/style/matching.rs b/components/style/matching.rs index 5f140b54ca0..848fd77f9b2 100644 --- a/components/style/matching.rs +++ b/components/style/matching.rs @@ -340,12 +340,7 @@ trait PrivateMatchMethods: TElement { pseudo: Option<&PseudoElement>, ) -> ChildCascadeRequirement { debug!("accumulate_damage_for: {:?}", self); - - // Don't accumulate damage if we're in a forgetful traversal. - if shared_context.traversal_flags.contains(TraversalFlags::Forgetful) { - debug!(" > forgetful traversal"); - return ChildCascadeRequirement::MustCascadeChildren; - } + debug_assert!(!shared_context.traversal_flags.contains(TraversalFlags::Forgetful)); let difference = self.compute_style_difference(old_values, new_values, pseudo);