Bug 1367293 - Don't get parent style for ComputeAnimationValue. r=birtles
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Fri, 02 Jun 2017 09:38:46 +0900
changeset 361956 a3470fcc5cc4c32081a49563f0fc60f83a8c30d3
parent 361955 10c6f7837bbddcf060316a5ac9c8f89dff4e56f1
child 361957 c66f819cf5e355d72bc69f241697d00973da4896
push id31952
push usercbook@mozilla.com
push dateFri, 02 Jun 2017 12:17:25 +0000
treeherdermozilla-central@194c009d6295 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbirtles
bugs1367293
milestone55.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 1367293 - Don't get parent style for ComputeAnimationValue. r=birtles MozReview-Commit-ID: 4TskjmoKchD
layout/style/ServoStyleSet.cpp
layout/style/ServoStyleSet.h
layout/style/StyleAnimationValue.cpp
--- a/layout/style/ServoStyleSet.cpp
+++ b/layout/style/ServoStyleSet.cpp
@@ -1045,21 +1045,21 @@ ServoStyleSet::GetBaseComputedValuesForE
                                                         &Snapshots(),
                                                         aPseudoType).Consume();
 }
 
 already_AddRefed<RawServoAnimationValue>
 ServoStyleSet::ComputeAnimationValue(
   Element* aElement,
   RawServoDeclarationBlock* aDeclarations,
-  const ServoComputedValuesWithParent& aComputedValues)
+  ServoComputedValuesBorrowed aComputedValues)
 {
   return Servo_AnimationValue_Compute(aElement,
                                       aDeclarations,
-                                      aComputedValues.mCurrentStyle,
+                                      aComputedValues,
                                       mRawSet.get()).Consume();
 }
 
 bool
 ServoStyleSet::EnsureUniqueInnerOnCSSSheets()
 {
   AutoTArray<StyleSheet*, 32> queue;
   for (auto& entryArray : mSheets) {
--- a/layout/style/ServoStyleSet.h
+++ b/layout/style/ServoStyleSet.h
@@ -375,17 +375,17 @@ public:
    */
   already_AddRefed<ServoComputedValues>
   ResolveForDeclarations(ServoComputedValuesBorrowedOrNull aParentOrNull,
                          RawServoDeclarationBlockBorrowed aDeclarations);
 
   already_AddRefed<RawServoAnimationValue>
   ComputeAnimationValue(dom::Element* aElement,
                         RawServoDeclarationBlock* aDeclaration,
-                        const ServoComputedValuesWithParent& aComputedValues);
+                        ServoComputedValuesBorrowed aComputedValues);
 
   void AppendTask(PostTraversalTask aTask)
   {
     MOZ_ASSERT(IsInServoTraversal());
 
     // We currently only use PostTraversalTasks while the Servo font metrics
     // mutex is locked.  If we need to use them in other situations during
     // a traversal, we should assert that we've taken appropriate
--- a/layout/style/StyleAnimationValue.cpp
+++ b/layout/style/StyleAnimationValue.cpp
@@ -25,17 +25,16 @@
 #include "nsStyleSet.h"
 #include "nsComputedDOMStyle.h"
 #include "nsContentUtils.h"
 #include "nsCSSParser.h"
 #include "nsCSSPseudoElements.h"
 #include "mozilla/css/Declaration.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/FloatingPoint.h"
-#include "mozilla/ServoComputedValuesWithParent.h"
 #include "mozilla/KeyframeUtils.h" // KeyframeUtils::ParseProperty
 #include "mozilla/Likely.h"
 #include "mozilla/ServoBindings.h" // RawServoDeclarationBlock
 #include "gfxMatrix.h"
 #include "gfxQuaternion.h"
 #include "nsIDocument.h"
 #include "nsIFrame.h"
 #include "gfx2DGlue.h"
@@ -5370,32 +5369,23 @@ AnimationValue::FromString(nsCSSProperty
 
     RefPtr<RawServoDeclarationBlock> declarations =
       KeyframeUtils::ParseProperty(aProperty, aValue, doc);
 
     if (!declarations) {
       return result;
     }
 
-    // We use the current ServoComputeValues and its parent ServoComputeValues
-    // to reconstruct the Context and then compute the AnimationValue. However,
-    // nsStyleContext::GetParentAllowServo() is going away, so if possible, we
-    // should find another way to get the parent ServoComputedValues.
-    RefPtr<nsStyleContext> parentContext = styleContext->GetParentAllowServo();
-    const ServoComputedValuesWithParent styles = {
-      styleContext->StyleSource().AsServoComputedValues(),
-      parentContext ? parentContext->StyleSource().AsServoComputedValues()
-                    : nullptr
-    };
-
+    const ServoComputedValues* computedValues =
+      styleContext->StyleSource().AsServoComputedValues();
     result.mServo = presContext->StyleSet()
                                ->AsServo()
                                ->ComputeAnimationValue(aElement,
                                                        declarations,
-                                                       styles);
+                                                       computedValues);
     return result;
   }
 
   if (!StyleAnimationValue::ComputeValue(aProperty, aElement, styleContext,
                                          aValue, false /* |aUseSVGMode| */,
                                          result.mGecko)) {
     MOZ_ASSERT(result.IsNull());
   }