Bug 1418867 - Drop pseudo type argument from KeyframeEffectReadOnly::EnsureBaseStyle(). r?birtles draft
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Wed, 22 Nov 2017 09:56:56 +0900
changeset 701683 c08a7543af12b6420b78a19e58cc197dcf2d7224
parent 701610 b96f009478987d44a68a8d7cad40c6a3d6626235
child 701684 c9ad8a02b9e28baf321c3a707a1c9d7479a3914d
push id90239
push userhikezoe@mozilla.com
push dateWed, 22 Nov 2017 04:18:13 +0000
reviewersbirtles
bugs1418867
milestone59.0a1
Bug 1418867 - Drop pseudo type argument from KeyframeEffectReadOnly::EnsureBaseStyle(). r?birtles We have the pseudo type in mTarget. MozReview-Commit-ID: GoXzoavnwpL
dom/animation/KeyframeEffectReadOnly.cpp
dom/animation/KeyframeEffectReadOnly.h
--- a/dom/animation/KeyframeEffectReadOnly.cpp
+++ b/dom/animation/KeyframeEffectReadOnly.cpp
@@ -528,27 +528,25 @@ KeyframeEffectReadOnly::EnsureBaseStyles
   MOZ_ASSERT(presContext,
              "nsPresContext should not be nullptr since this EnsureBaseStyles "
              "supposed to be called right after getting computed values with "
              "a valid nsPresContext");
 
   RefPtr<ServoStyleContext> baseStyleContext;
   for (const AnimationProperty& property : aProperties) {
     EnsureBaseStyle(property,
-                    mTarget->mPseudoType,
                     presContext,
                     aComputedValues,
                     baseStyleContext);
   }
 }
 
 void
 KeyframeEffectReadOnly::EnsureBaseStyle(
   const AnimationProperty& aProperty,
-  CSSPseudoElementType aPseudoType,
   nsPresContext* aPresContext,
   const ServoStyleContext* aComputedStyle,
  RefPtr<ServoStyleContext>& aBaseStyleContext)
 {
   bool hasAdditiveValues = false;
 
   for (const AnimationPropertySegment& segment : aProperty.mSegments) {
     if (!segment.HasReplaceableValues()) {
@@ -561,17 +559,17 @@ KeyframeEffectReadOnly::EnsureBaseStyle(
     return;
   }
 
   if (!aBaseStyleContext) {
     aBaseStyleContext =
       aPresContext->StyleSet()->AsServo()->GetBaseContextForElement(
           mTarget->mElement,
           aPresContext,
-          aPseudoType,
+          mTarget->mPseudoType,
           aComputedStyle);
   }
   RefPtr<RawServoAnimationValue> baseValue =
     Servo_ComputedValues_ExtractAnimationValue(aBaseStyleContext,
                                                aProperty.mProperty).Consume();
   mBaseStyleValuesForServo.Put(aProperty.mProperty, baseValue);
 }
 
--- a/dom/animation/KeyframeEffectReadOnly.h
+++ b/dom/animation/KeyframeEffectReadOnly.h
@@ -377,17 +377,16 @@ protected:
   // base style context will be resolved and stored in
   // |aCachedBaseStyleContext|.
   void EnsureBaseStyle(nsCSSPropertyID aProperty,
                        GeckoStyleContext* aStyleContext,
                        RefPtr<GeckoStyleContext>& aCachedBaseStyleContext);
   // Stylo version of the above function that also first checks for an additive
   // value in |aProperty|'s list of segments.
   void EnsureBaseStyle(const AnimationProperty& aProperty,
-                       CSSPseudoElementType aPseudoType,
                        nsPresContext* aPresContext,
                        const ServoStyleContext* aComputedValues,
                        RefPtr<mozilla::ServoStyleContext>& aBaseComputedValues);
 
   Maybe<OwningAnimationTarget> mTarget;
 
   KeyframeEffectParams mEffectOptions;