Bug 960465 patch 22 - Remove implementation of nsRestyleHint_ChangeAnimationPhase. r=birtles
authorL. David Baron <dbaron@dbaron.org>
Tue, 17 Feb 2015 11:15:06 +1300
changeset 256513 a9dd7c71cc682b097535a5c4fc4390e276a946e4
parent 256512 5be0a9b53dc2f8bd8308b508f68baf15a884d618
child 256514 e4a219d27fd95bd60c85e41fa0dc05c59f200500
push id4610
push userjlund@mozilla.com
push dateMon, 30 Mar 2015 18:32:55 +0000
treeherdermozilla-beta@4df54044d9ef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbirtles
bugs960465
milestone38.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 960465 patch 22 - Remove implementation of nsRestyleHint_ChangeAnimationPhase. r=birtles
layout/base/RestyleManager.cpp
layout/base/nsChangeHint.h
layout/style/nsStyleSet.cpp
--- a/layout/base/RestyleManager.cpp
+++ b/layout/base/RestyleManager.cpp
@@ -1800,17 +1800,16 @@ RestyleManager::PostRestyleEvent(Element
   // Set mHavePendingNonAnimationRestyles for any restyle that could
   // possibly contain non-animation styles.  Unfortunately there's one
   // level of the cascade and associated change hint
   // (eRestyle_StyleAttribute) where we don't fully distinguish.
   // FIXME (bug 1133439): We could at least distinguish by having two
   // separate eRestyle_StyleAttribute hints, one for animations and one
   // for other things.
   if (aRestyleHint & ~(eRestyle_CSSTransitions | eRestyle_CSSAnimations |
-                       eRestyle_ChangeAnimationPhase |
                        eRestyle_SVGAttrAnimations)) {
     mHavePendingNonAnimationRestyles = true;
   }
 
   PostRestyleEventInternal(false);
 }
 
 void
@@ -2719,21 +2718,19 @@ ElementRestyler::Restyle(nsRestyleHint a
       hintToRestore = restyleData->mRestyleHint;
       aRestyleHint = nsRestyleHint(aRestyleHint | restyleData->mRestyleHint);
       descendants.SwapElements(restyleData->mDescendants);
     }
   }
 
   // If we are restyling this frame with eRestyle_Self or weaker hints,
   // we restyle children with nsRestyleHint(0).  But we pass the
-  // eRestyle_ChangeAnimationPhaseDescendants and eRestyle_ForceDescendants
-  // flags down too.
+  // eRestyle_ForceDescendants flag down too.
   nsRestyleHint childRestyleHint =
     nsRestyleHint(aRestyleHint & (eRestyle_Subtree |
-                                  eRestyle_ChangeAnimationPhaseDescendants |
                                   eRestyle_ForceDescendants));
 
   nsRefPtr<nsStyleContext> oldContext = mFrame->StyleContext();
 
   // TEMPORARY (until bug 918064):  Call RestyleSelf for each
   // continuation or block-in-inline sibling.
 
   // We must make a single decision on how to process this frame and
@@ -4091,18 +4088,16 @@ RestyleManager::StructsToLog()
 #ifdef DEBUG
 /* static */ nsCString
 RestyleManager::RestyleHintToString(nsRestyleHint aHint)
 {
   nsCString result;
   bool any = false;
   const char* names[] = { "Self", "Subtree", "LaterSiblings", "CSSTransitions",
                           "CSSAnimations", "SVGAttrAnimations", "StyleAttribute",
-                          "ChangeAnimationPhase",
-                          "ChangeAnimationPhaseDescendants",
                           "Force", "ForceDescendants" };
   uint32_t hint = aHint & ((1 << ArrayLength(names)) - 1);
   uint32_t rest = aHint & ~((1 << ArrayLength(names)) - 1);
   for (uint32_t i = 0; i < ArrayLength(names); i++) {
     if (hint & (1 << i)) {
       if (any) {
         result.AppendLiteral(" | ");
       }
--- a/layout/base/nsChangeHint.h
+++ b/layout/base/nsChangeHint.h
@@ -345,40 +345,26 @@ enum nsRestyleHint {
   // any other style data.  If a new style context results, update style
   // contexts on the descendants.  (Irrelevant if eRestyle_Self or
   // eRestyle_Subtree is also set, since those imply a superset of the
   // work.)  Supported only for element style contexts and not for
   // pseudo-elements or anonymous boxes, on which it converts to
   // eRestyle_Self.
   eRestyle_StyleAttribute = (1<<6),
 
-  // Additional restyle hint to be used along with CSSTransitions,
-  // CSSAnimations, SVGAttrAnimations, or StyleAttribute.  This
-  // indicates that along with the replacement given, appropriate
-  // switching between the style with animation and style without
-  // animation should be performed by adding or removing rules that
-  // should be present only in the style with animation.
-  // This is implied by eRestyle_Self or eRestyle_Subtree.
-  // FIXME: Remove this as part of bug 960465.
-  eRestyle_ChangeAnimationPhase = (1 << 7),
-
-  // Same as the previous, except this applies to the entire subtree.
-  // FIXME: Remove this as part of bug 960465.
-  eRestyle_ChangeAnimationPhaseDescendants = (1 << 8),
-
   // Continue the restyling process to the current frame's children even
   // if this frame's restyling resulted in no style changes.
-  eRestyle_Force = (1<<9),
+  eRestyle_Force = (1<<7),
 
   // Continue the restyling process to all of the current frame's
   // descendants, even if any frame's restyling resulted in no style
   // changes.  (Implies eRestyle_Force.)  Note that this is weaker than
   // eRestyle_Subtree, which makes us rerun selector matching on all
   // descendants rather than just continuing the restyling process.
-  eRestyle_ForceDescendants = (1<<10),
+  eRestyle_ForceDescendants = (1<<8),
 
   // Useful unions:
   eRestyle_AllHintsWithAnimations = eRestyle_CSSTransitions |
                                     eRestyle_CSSAnimations |
                                     eRestyle_SVGAttrAnimations |
                                     eRestyle_StyleAttribute,
 };
 
--- a/layout/style/nsStyleSet.cpp
+++ b/layout/style/nsStyleSet.cpp
@@ -1404,32 +1404,23 @@ nsStyleSet::RuleNodeWithReplacement(Elem
               !(nsCSSPseudoElements::PseudoElementSupportsStyleAttribute(aPseudoType) ||
                 nsCSSPseudoElements::PseudoElementSupportsUserActionState(aPseudoType))),
              "should have aPseudoElement only for certain pseudo elements");
 
   NS_ABORT_IF_FALSE(!(aReplacements & ~(eRestyle_CSSTransitions |
                                         eRestyle_CSSAnimations |
                                         eRestyle_SVGAttrAnimations |
                                         eRestyle_StyleAttribute |
-                                        eRestyle_ChangeAnimationPhase |
-                                        eRestyle_ChangeAnimationPhaseDescendants |
                                         eRestyle_Force |
                                         eRestyle_ForceDescendants)),
                     // FIXME: Once bug 979133 lands we'll have a better
                     // way to print these.
                     nsPrintfCString("unexpected replacement bits 0x%" PRIX32,
                                     uint32_t(aReplacements)).get());
 
-  // If we're changing animation phase, we have to reconsider what rules
-  // are in these four levels.
-  if (aReplacements & (eRestyle_ChangeAnimationPhase |
-                       eRestyle_ChangeAnimationPhaseDescendants)) {
-    aReplacements |= eRestyle_AllHintsWithAnimations;
-  }
-
   // FIXME (perf): This should probably not rebuild the whole path, but
   // only the path from the last change in the rule tree, like
   // ReplaceAnimationRule in nsStyleSet.cpp does.  (That could then
   // perhaps share this code, too?)
   // But if we do that, we'll need to pass whether we are rebuilding the
   // rule tree from ElementRestyler::RestyleSelf to avoid taking that
   // path when we're rebuilding the rule tree.
 
@@ -1482,34 +1473,26 @@ nsStyleSet::RuleNodeWithReplacement(Elem
               GetAnimationRule(aElement, aPseudoType);
             if (rule) {
               ruleWalker.ForwardOnPossiblyCSSRule(rule);
             }
           }
           break;
         }
         case eRestyle_SVGAttrAnimations: {
-          MOZ_ASSERT(aReplacements & (eRestyle_ChangeAnimationPhase |
-                                      eRestyle_ChangeAnimationPhaseDescendants),
-                     "don't know how to do this level without phase change");
-
           SVGAttrAnimationRuleProcessor* ruleProcessor =
             static_cast<SVGAttrAnimationRuleProcessor*>(
               mRuleProcessors[eSVGAttrAnimationSheet].get());
           if (ruleProcessor &&
               aPseudoType == nsCSSPseudoElements::ePseudo_NotPseudoElement) {
             ruleProcessor->ElementRulesMatching(aElement, &ruleWalker);
           }
           break;
         }
         case eRestyle_StyleAttribute: {
-          MOZ_ASSERT(aReplacements & (eRestyle_ChangeAnimationPhase |
-                                      eRestyle_ChangeAnimationPhaseDescendants),
-                     "don't know how to do this level without phase change");
-
           if (!level->mIsImportant) {
             // First time through, we handle the non-!important rule.
             nsHTMLCSSStyleSheet* ruleProcessor =
               static_cast<nsHTMLCSSStyleSheet*>(
                 mRuleProcessors[eStyleAttrSheet].get());
             if (ruleProcessor) {
               lastScopedRN = ruleWalker.CurrentNode();
               if (aPseudoType ==