Bug 1311257 - getKeyframes() returns base computed values in missing keyframes. r=birtles

MozReview-Commit-ID: K8btLtALEfK

--HG--
extra : rebase_source : 1709e9a153790f90e26da7170273474a4a1d2dfd
This commit is contained in:
Hiroyuki Ikezoe 2017-04-06 10:34:51 +09:00
Родитель 2614ef2eac
Коммит e432173483
1 изменённых файлов: 17 добавлений и 4 удалений

Просмотреть файл

@ -1248,6 +1248,8 @@ KeyframeEffectReadOnly::GetKeyframes(JSContext*& aCx,
return;
}
bool isServo = mDocument->IsStyledByServo();
for (const Keyframe& keyframe : mKeyframes) {
// Set up a dictionary object for the explicit members
BaseComputedKeyframe keyframeDict;
@ -1275,10 +1277,21 @@ KeyframeEffectReadOnly::GetKeyframes(JSContext*& aCx,
JS::Rooted<JSObject*> keyframeObject(aCx, &keyframeJSValue.toObject());
for (const PropertyValuePair& propertyValue : keyframe.mPropertyValues) {
nsAutoString stringValue;
if (propertyValue.mServoDeclarationBlock) {
Servo_DeclarationBlock_SerializeOneValue(
propertyValue.mServoDeclarationBlock,
propertyValue.mProperty, &stringValue);
if (isServo) {
if (propertyValue.mServoDeclarationBlock) {
Servo_DeclarationBlock_SerializeOneValue(
propertyValue.mServoDeclarationBlock,
propertyValue.mProperty, &stringValue);
} else {
RawServoAnimationValue* value =
mBaseStyleValuesForServo.GetWeak(propertyValue.mProperty);
if (value) {
Servo_AnimationValue_Serialize(value,
propertyValue.mProperty,
&stringValue);
}
}
} else if (nsCSSProps::IsShorthand(propertyValue.mProperty)) {
// nsCSSValue::AppendToString does not accept shorthands properties but
// works with token stream values if we pass eCSSProperty_UNKNOWN as