From 0d0c2701ffe5a0d94aa7468284e7d5c4369b3f6a Mon Sep 17 00:00:00 2001 From: Brian Birtles Date: Wed, 26 Apr 2017 14:14:30 +0900 Subject: [PATCH] Clear animation-only dirty descendants bit on display:none descendants When an element has a display:none ancestor we don't traverse it during restyle. However, at the end of restyling we expect the tree to be free of dirty bits. We currently take special care to clear the regular (non-animation) dirty bit on nodes in display:none subtrees in order to preserve this invariant. This patch applies the same handling to the animation-only dirty descendants bit. --- components/style/traversal.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/components/style/traversal.rs b/components/style/traversal.rs index 3a5c649f9fc..e9f4e7c2775 100644 --- a/components/style/traversal.rs +++ b/components/style/traversal.rs @@ -537,7 +537,10 @@ pub fn resolve_style(context: &mut StyleContext, element: E, if !in_doc || display_none_root.is_some() { let mut curr = element; loop { - unsafe { curr.unset_dirty_descendants(); } + unsafe { + curr.unset_dirty_descendants(); + curr.unset_animation_only_dirty_descendants(); + } if in_doc && curr == display_none_root.unwrap() { break; } @@ -789,5 +792,8 @@ pub fn clear_descendant_data(el: E, clear_data: &F) { } } - unsafe { el.unset_dirty_descendants(); } + unsafe { + el.unset_dirty_descendants(); + el.unset_animation_only_dirty_descendants(); + } }