diff --git a/components/style/traversal.rs b/components/style/traversal.rs index a5c624eb374..7a24ccd8178 100644 --- a/components/style/traversal.rs +++ b/components/style/traversal.rs @@ -666,6 +666,9 @@ where } else { element.has_dirty_descendants() }; + if context.shared.traversal_flags.for_animation_only() { + unsafe { element.unset_animation_only_dirty_descendants(); } + } // Preprocess children, propagating restyle hints and handling sibling // relationships. @@ -695,10 +698,6 @@ where data.clear_restyle_state(); } - if context.shared.traversal_flags.for_animation_only() { - unsafe { element.unset_animation_only_dirty_descendants(); } - } - // There are two cases when we want to clear the dity descendants bit here // after styling this element. //