diff --git a/components/style/gecko/pseudo_element.rs b/components/style/gecko/pseudo_element.rs index d989380c02e..3ca06eea37e 100644 --- a/components/style/gecko/pseudo_element.rs +++ b/components/style/gecko/pseudo_element.rs @@ -92,6 +92,12 @@ impl PseudoElement { EAGER_PSEUDOS[i].clone() } + /// Whether the current pseudo element is animatable. + #[inline] + pub fn is_animatable(&self) -> bool { + matches!(*self, Self::Before | Self::After | Self::Marker) + } + /// Whether the current pseudo element is ::before or ::after. #[inline] pub fn is_before_or_after(&self) -> bool { diff --git a/components/style/gecko/wrapper.rs b/components/style/gecko/wrapper.rs index a5472fadd66..af3173f92d1 100644 --- a/components/style/gecko/wrapper.rs +++ b/components/style/gecko/wrapper.rs @@ -1446,7 +1446,7 @@ impl<'le> TElement for GeckoElement<'le> { #[inline] fn may_have_animations(&self) -> bool { if let Some(pseudo) = self.implemented_pseudo_element() { - if !pseudo.is_before_or_after() { + if !pseudo.is_animatable() { return false; } // FIXME(emilio): When would the parent of a ::before / ::after