diff --git a/components/style/dom.rs b/components/style/dom.rs index 4b69a8e2c8a..58050757b30 100644 --- a/components/style/dom.rs +++ b/components/style/dom.rs @@ -492,7 +492,7 @@ pub trait TElement : Eq + PartialEq + Debug + Hash + Sized + Copy + Clone + return false; } - data.has_styles() && !data.restyle.hint.has_non_animation_hint() + data.has_styles() && !data.restyle.hint.has_non_animation_invalidations() } /// Flags an element and its ancestors with a given `DescendantsBit`. diff --git a/components/style/invalidation/element/restyle_hints.rs b/components/style/invalidation/element/restyle_hints.rs index c9171d368cc..d846afa5e51 100644 --- a/components/style/invalidation/element/restyle_hints.rs +++ b/components/style/invalidation/element/restyle_hints.rs @@ -65,8 +65,12 @@ impl RestyleHint { } /// Returns whether we need to restyle this element. - pub fn has_self_invalidations(&self) -> bool { - self.intersects(RESTYLE_SELF | RECASCADE_SELF | Self::replacements()) + pub fn has_non_animation_invalidations(&self) -> bool { + self.intersects( + RESTYLE_SELF | + RECASCADE_SELF | + (Self::replacements() & !Self::for_animations()) + ) } /// Propagates this restyle hint to a child element.