Bug 1374881 Part 1: Implement nsDOMWindowUtils::GetUnanimatedComputedStyle for servo.
MozReview-Commit-ID: 7tXAAbvWvU8
--- a/dom/base/nsDOMWindowUtils.cpp
+++ b/dom/base/nsDOMWindowUtils.cpp
@@ -2895,24 +2895,28 @@ 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();
+ Servo_AnimationValue_Serialize(value, propertyID, &aResult);
+ return NS_OK;
}
StyleAnimationValue computedValue;
if (!StyleAnimationValue::ExtractComputedValue(propertyID,
- styleContext, computedValue)) {
+ styleContext,
+ computedValue)) {
return NS_ERROR_FAILURE;
}
// Note: ExtractComputedValue can return 'unset', 'initial', or 'inherit' in
// its "computedValue" outparam, even though these technically aren't valid
// computed values. (It has this behavior for discretely-animatable
// properties, e.g. 'align-content', when these keywords are explicitly
// specified or when there is no specified value.) But we need to return a