Bug 1335942 - Part 6: Implement GetScaleValue for RawServoAnimationValue. draft
authorBoris Chiou <boris.chiou@gmail.com>
Mon, 06 Feb 2017 17:54:49 +0800
changeset 479853 3d3286b8b79b29e059bb47c7d7ae04454e6846e3
parent 479852 c6de34941f482c1cb487293c8dac7ebc34a2be8d
child 544810 26346b6163a437d361bd50b42f962f06d8cde00e
push id44388
push userbmo:boris.chiou@gmail.com
push dateTue, 07 Feb 2017 12:43:05 +0000
bugs1335942
milestone54.0a1
Bug 1335942 - Part 6: Implement GetScaleValue for RawServoAnimationValue. MozReview-Commit-ID: GnaS44gWmm2
layout/style/StyleAnimationValue.cpp
layout/style/StyleAnimationValue.h
--- a/layout/style/StyleAnimationValue.cpp
+++ b/layout/style/StyleAnimationValue.cpp
@@ -9,17 +9,16 @@
 #include "mozilla/ArrayUtils.h"
 #include "mozilla/MathAlgorithms.h"
 #include "mozilla/RuleNodeCacheConditions.h"
 #include "mozilla/StyleAnimationValue.h"
 #include "mozilla/StyleSetHandle.h"
 #include "mozilla/StyleSetHandleInlines.h"
 #include "mozilla/Tuple.h"
 #include "mozilla/UniquePtr.h"
-#include "nsStyleTransformMatrix.h"
 #include "nsAutoPtr.h"
 #include "nsCOMArray.h"
 #include "nsIStyleRule.h"
 #include "mozilla/css/StyleRule.h"
 #include "nsString.h"
 #include "nsStyleContext.h"
 #include "nsStyleSet.h"
 #include "nsComputedDOMStyle.h"
--- a/layout/style/StyleAnimationValue.h
+++ b/layout/style/StyleAnimationValue.h
@@ -13,16 +13,17 @@
 #include "mozilla/UniquePtr.h"
 #include "nsStringFwd.h"
 #include "nsStringBuffer.h"
 #include "nsCoord.h"
 #include "nsColor.h"
 #include "nsCSSProps.h"
 #include "nsCSSValue.h"
 #include "nsStyleCoord.h"
+#include "nsStyleTransformMatrix.h"
 #include "ServoBindings.h"
 
 class nsIFrame;
 class nsStyleContext;
 class gfx3DMatrix;
 struct RawServoDeclarationBlock;
 
 namespace mozilla {
@@ -598,17 +599,21 @@ struct AnimationValue
   float GetOpacity() const {
     return mServo ? Servo_AnimationValues_GetOpacity(mServo)
                   : mGecko.GetFloatValue();
   }
 
   // Returns the scale for mGecko or mServo, which are calculated with
   // reference to aFrame.
   gfxSize GetScaleValue(const nsIFrame* aFrame) const {
-    // TODO: GetScaleValue for mServo.
+    if (mServo) {
+      RefPtr<nsCSSValueSharedList> list;
+      Servo_AnimationValues_GetTransform(mServo, &list);
+      return nsStyleTransformMatrix::GetScaleValue(list, aFrame);
+    }
     return mGecko.GetScaleValue(aFrame);
   }
 };
 
 struct PropertyStyleAnimationValuePair
 {
   nsCSSPropertyID mProperty;
   AnimationValue mValue;