Bug 1344966 - Post eRestyle_CSSAnimations instead of eRestyle_Self and eRestyle_Subtree. r?heycam draft
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Mon, 27 Mar 2017 06:17:08 +0900
changeset 551506 7449996a6c02c1fd24deedc1f6bada982f66e00f
parent 551505 edb0eda46b0d95bed08f7c79e8260655eab51879
child 621558 7cc734f398a74f150bcf63e1d34257c2af455bf7
push id51067
push userhikezoe@mozilla.com
push dateSun, 26 Mar 2017 21:19:47 +0000
reviewersheycam
bugs1344966
milestone55.0a1
Bug 1344966 - Post eRestyle_CSSAnimations instead of eRestyle_Self and eRestyle_Subtree. r?heycam MozReview-Commit-ID: 7azwzIPc45X
dom/animation/EffectCompositor.cpp
--- a/dom/animation/EffectCompositor.cpp
+++ b/dom/animation/EffectCompositor.cpp
@@ -327,22 +327,18 @@ EffectCompositor::PostRestyleForAnimatio
       // allow us mutate ElementData of the |aElement| in SequentialTask.
       // Instead we call Servo_NoteExplicitHints for the element in PreTraverse() right
       // which will be called right before the second traversal that we do for
       // updating CSS animations.
       // In that case PreTraverse() will return true so that we know to do the
       // second traversal so we don't need to post any restyle requests to the
       // PresShell.
       return;
-    } else if (!mPresContext->RestyleManager()->IsInStyleRefresh()) {
-      // FIXME: stylo only supports Self and Subtree hints now, so we override
-      // it for stylo if we are not in process of restyling.
-      hint = eRestyle_Self | eRestyle_Subtree;
     } else {
-      MOZ_ASSERT_UNREACHABLE("Should not request restyle");
+      MOZ_ASSERT(!mPresContext->RestyleManager()->IsInStyleRefresh());
     }
   }
   mPresContext->PresShell()->RestyleForAnimation(element, hint);
 }
 
 void
 EffectCompositor::PostRestyleForThrottledAnimations()
 {
@@ -978,18 +974,18 @@ EffectCompositor::PreTraverse()
 
       NonOwningAnimationTarget target = iter.Key();
 
       // We need to post restyle hints even if the target is not in EffectSet to
       // ensure the final restyling for removed animations.
       // We can't call PostRestyleEvent directly here since we are still in the
       // middle of the servo traversal.
       mPresContext->RestyleManager()->AsServo()->
-        PostRestyleEventForAnimations(target.mElement,
-                                      eRestyle_Self | eRestyle_Subtree);
+        PostRestyleEventForAnimations(target.mElement, eRestyle_CSSAnimations);
+
       foundElementsNeedingRestyle = true;
 
       EffectSet* effects =
         EffectSet::GetEffectSet(target.mElement, target.mPseudoType);
       if (!effects) {
         // Drop EffectSets that have been destroyed.
         iter.Remove();
         continue;
@@ -1030,17 +1026,17 @@ EffectCompositor::PreTraverse(dom::Eleme
 
   for (auto& elementsToRestyle : mElementsToRestyle) {
     if (!elementsToRestyle.Get(key)) {
       // Ignore throttled restyle and no restyle request.
       continue;
     }
 
     mPresContext->RestyleManager()->AsServo()->
-      PostRestyleEventForAnimations(aElement, eRestyle_Self);
+      PostRestyleEventForAnimations(aElement, eRestyle_CSSAnimations);
 
     EffectSet* effects = EffectSet::GetEffectSet(aElement, pseudoType);
     if (effects) {
       MaybeUpdateCascadeResults(aElement, pseudoType);
 
       for (KeyframeEffectReadOnly* effect : *effects) {
         effect->GetAnimation()->WillComposeStyle();
       }