Bug 1285407 - Part 4: Drop EffectCompositor::MaybeUpdateCascadeResults(Element*, CSSPseudoElementType) because it's essentially the same as another one. r?birtles draft
authorHiroyuki Ikezoe <hiikezoe@mozilla-japan.org>
Mon, 11 Jul 2016 17:28:19 +0900
changeset 386116 fe1e8e81f012f9bbdf9dc7a38136ddfae1eedcf2
parent 386115 0ee0933779dd6089853b4a430c5db269a9d749ea
child 525038 b60f0da44629c548c9c554a728bc2509af016e29
push id22626
push userhiikezoe@mozilla-japan.org
push dateMon, 11 Jul 2016 08:29:02 +0000
reviewersbirtles
bugs1285407
milestone50.0a1
Bug 1285407 - Part 4: Drop EffectCompositor::MaybeUpdateCascadeResults(Element*, CSSPseudoElementType) because it's essentially the same as another one. r?birtles MozReview-Commit-ID: 2Locox5zmP4
dom/animation/EffectCompositor.cpp
dom/animation/EffectCompositor.h
--- a/dom/animation/EffectCompositor.cpp
+++ b/dom/animation/EffectCompositor.cpp
@@ -387,17 +387,19 @@ EffectCompositor::AddStyleUpdatesTo(Rest
     // if we are iterating over the hashtable at the same time.
     nsTArray<PseudoElementHashEntry::KeyType> elementsToRestyle(
       elementSet.Count());
     for (auto iter = elementSet.Iter(); !iter.Done(); iter.Next()) {
       elementsToRestyle.AppendElement(iter.Key());
     }
 
     for (auto& pseudoElem : elementsToRestyle) {
-      MaybeUpdateCascadeResults(pseudoElem.mElement, pseudoElem.mPseudoType);
+      MaybeUpdateCascadeResults(pseudoElem.mElement,
+                                pseudoElem.mPseudoType,
+                                nullptr);
 
       ComposeAnimationRule(pseudoElem.mElement,
                            pseudoElem.mPseudoType,
                            cascadeLevel,
                            mPresContext->RefreshDriver()->MostRecentRefresh());
 
       dom::Element* elementToRestyle =
         GetElementToRestyle(pseudoElem.mElement, pseudoElem.mPseudoType);
@@ -471,34 +473,16 @@ EffectCompositor::MaybeUpdateCascadeResu
       }
     }
   }
   UpdateCascadeResults(*effects, aElement, aPseudoType, styleContext);
 
   MOZ_ASSERT(!effects->CascadeNeedsUpdate(), "Failed to update cascade state");
 }
 
-/* static */ void
-EffectCompositor::MaybeUpdateCascadeResults(Element* aElement,
-                                            CSSPseudoElementType aPseudoType)
-{
-  nsStyleContext* styleContext = nullptr;
-  {
-    dom::Element* elementToRestyle = GetElementToRestyle(aElement, aPseudoType);
-    if (elementToRestyle) {
-      nsIFrame* frame = elementToRestyle->GetPrimaryFrame();
-      if (frame) {
-        styleContext = frame->StyleContext();
-      }
-    }
-  }
-
-  MaybeUpdateCascadeResults(aElement, aPseudoType, styleContext);
-}
-
 namespace {
   class EffectCompositeOrderComparator {
   public:
     bool Equals(const KeyframeEffectReadOnly* a,
                 const KeyframeEffectReadOnly* b) const
     {
       return a == b;
     }
--- a/dom/animation/EffectCompositor.h
+++ b/dom/animation/EffectCompositor.h
@@ -180,22 +180,16 @@ public:
   //
   // This method does NOT detect if other styles that apply above the
   // animation level of the cascade have changed.
   static void
   MaybeUpdateCascadeResults(dom::Element* aElement,
                             CSSPseudoElementType aPseudoType,
                             nsStyleContext* aStyleContext);
 
-  // An overload of MaybeUpdateCascadeResults that uses the style context
-  // of the primary frame of the specified (pseudo-)element, when available.
-  static void
-  MaybeUpdateCascadeResults(dom::Element* aElement,
-                            CSSPseudoElementType aPseudoType);
-
   // Update the mWinsInCascade member for each property in effects targetting
   // the specified (pseudo-)element.
   //
   // This can be expensive so we should only call it if styles that apply
   // above the animation level of the cascade might have changed. For all
   // other cases we should call MaybeUpdateCascadeResults.
   static void
   UpdateCascadeResults(dom::Element* aElement,