Bug 1374881 - Implement nsDOMWindowUtils::GetUnanimatedComputedStyle for servo. r=birtles,heycam
authorBrad Werth <bwerth@mozilla.com>
Tue, 18 Jul 2017 17:34:45 -0700
changeset 419380 33ecd88b5adbd17d97ce8e9cfcd004949f9963cd
parent 419379 225827d9f375cb452b8e2865150695217f355153
child 419381 bbdf222b017729592f09eda27408ed90db0d3c48
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbirtles, heycam
bugs1374881
milestone56.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 1374881 - Implement nsDOMWindowUtils::GetUnanimatedComputedStyle for servo. r=birtles,heycam MozReview-Commit-ID: 7tXAAbvWvU8
dom/base/nsDOMWindowUtils.cpp
--- a/dom/base/nsDOMWindowUtils.cpp
+++ b/dom/base/nsDOMWindowUtils.cpp
@@ -2921,19 +2921,25 @@ nsDOMWindowUtils::GetUnanimatedComputedS
     return NS_ERROR_FAILURE;
   }
 
   nsIAtom* pseudo = nsCSSPseudoElements::GetPseudoAtom(aPseudoElement);
   RefPtr<nsStyleContext> styleContext =
     nsComputedDOMStyle::GetUnanimatedStyleContextNoFlush(element,
                                                          pseudo, shell);
 
-  // We will support Servo in bug 1311257.
-  if (shell->StyleSet()->IsServo()) {
-    return NS_ERROR_NOT_IMPLEMENTED;
+  if (styleContext->IsServo()) {
+    RefPtr<RawServoAnimationValue> value =
+      Servo_ComputedValues_ExtractAnimationValue(styleContext->AsServo(),
+                                                 propertyID).Consume();
+    if (!value) {
+      return NS_ERROR_FAILURE;
+    }
+    Servo_AnimationValue_Serialize(value, propertyID, &aResult);
+    return NS_OK;
   }
 
   StyleAnimationValue computedValue;
   if (!StyleAnimationValue::ExtractComputedValue(propertyID,
                                                  styleContext->AsGecko(),
                                                  computedValue)) {
     return NS_ERROR_FAILURE;
   }