зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1317178 - Pass the property name to Servo_DeclarationBlock_SerializeOneValue. r=birtles
In order to use single_value_to_css() in Servo_DeclarationBlock_SerializeOneValue(), we need to pass the property name and a flag for custom properties. MozReview-Commit-ID: 5HfI2qOmPwP --HG-- extra : rebase_source : 968468b3c9313c4ec3007ee9883075c8fc4ab769
This commit is contained in:
Родитель
8565b864ed
Коммит
f045a91867
|
@ -915,26 +915,27 @@ KeyframeEffectReadOnly::GetKeyframes(JSContext*& aCx,
|
|||
|
||||
JS::Rooted<JSObject*> keyframeObject(aCx, &keyframeJSValue.toObject());
|
||||
for (const PropertyValuePair& propertyValue : keyframe.mPropertyValues) {
|
||||
|
||||
const char* name = nsCSSProps::PropertyIDLName(propertyValue.mProperty);
|
||||
|
||||
// nsCSSValue::AppendToString does not accept shorthands properties but
|
||||
// works with token stream values if we pass eCSSProperty_UNKNOWN as
|
||||
// the property.
|
||||
nsCSSPropertyID propertyForSerializing =
|
||||
nsCSSProps::IsShorthand(propertyValue.mProperty)
|
||||
? eCSSProperty_UNKNOWN
|
||||
: propertyValue.mProperty;
|
||||
|
||||
nsAutoString stringValue;
|
||||
if (propertyValue.mServoDeclarationBlock) {
|
||||
// FIXME: When we support animations for custom properties on servo, we
|
||||
// should pass the flag to Servo_DeclarationBlock_SerializeOneValue.
|
||||
// Now, we pass false to simplify it.
|
||||
nsIAtom* atom = nsCSSProps::AtomForProperty(propertyValue.mProperty);
|
||||
Servo_DeclarationBlock_SerializeOneValue(
|
||||
propertyValue.mServoDeclarationBlock, &stringValue);
|
||||
propertyValue.mServoDeclarationBlock, atom, false, &stringValue);
|
||||
} else {
|
||||
// nsCSSValue::AppendToString does not accept shorthands properties but
|
||||
// works with token stream values if we pass eCSSProperty_UNKNOWN as
|
||||
// the property.
|
||||
nsCSSPropertyID propertyForSerializing =
|
||||
nsCSSProps::IsShorthand(propertyValue.mProperty)
|
||||
? eCSSProperty_UNKNOWN
|
||||
: propertyValue.mProperty;
|
||||
propertyValue.mValue.AppendToString(
|
||||
propertyForSerializing, stringValue, nsCSSValue::eNormalized);
|
||||
}
|
||||
|
||||
const char* name = nsCSSProps::PropertyIDLName(propertyValue.mProperty);
|
||||
JS::Rooted<JS::Value> value(aCx);
|
||||
if (!ToJSValue(aCx, stringValue, &value) ||
|
||||
!JS_DefineProperty(aCx, keyframeObject, name, value,
|
||||
|
|
|
@ -108,7 +108,7 @@ SERVO_BINDING_FUNC(Servo_DeclarationBlock_GetCssText, void,
|
|||
nsAString* result)
|
||||
SERVO_BINDING_FUNC(Servo_DeclarationBlock_SerializeOneValue, void,
|
||||
RawServoDeclarationBlockBorrowed declarations,
|
||||
nsString* buffer)
|
||||
const nsIAtom* property, bool is_custom, nsString* buffer)
|
||||
SERVO_BINDING_FUNC(Servo_DeclarationBlock_Count, uint32_t,
|
||||
RawServoDeclarationBlockBorrowed declarations)
|
||||
SERVO_BINDING_FUNC(Servo_DeclarationBlock_GetNthProperty, bool,
|
||||
|
|
Загрузка…
Ссылка в новой задаче