Bug 1371518 - Use Servo backend to determine if a property is transitionable; r=hiro

This allows Gecko to use the same criteria as Servo for evaluating if a property
should be transitioned and will cause Gecko to exclude discretely animated
properties, including, in future, the 'display' property.

MozReview-Commit-ID: H2wWVo5isKS

--HG--
extra : rebase_source : 34798306aa5f485b0583d3640caf24d123922584
This commit is contained in:
Brian Birtles 2017-06-15 09:54:06 +09:00
parent 7a76319c9a
commit f94eed9781
2 changed files with 6 additions and 3 deletions

View File

@ -228,6 +228,8 @@ SERVO_BINDING_FUNC(Servo_ComputedValues_ExtractAnimationValue,
nsCSSPropertyID property)
SERVO_BINDING_FUNC(Servo_Property_IsAnimatable, bool,
nsCSSPropertyID property)
SERVO_BINDING_FUNC(Servo_Property_IsTransitionable, bool,
nsCSSPropertyID property)
SERVO_BINDING_FUNC(Servo_Property_IsDiscreteAnimatable, bool,
nsCSSPropertyID property)
SERVO_BINDING_FUNC(Servo_GetProperties_Overriding_Animation, void,

View File

@ -828,12 +828,13 @@ GetTransitionKeyframes(nsCSSPropertyID aProperty,
}
static bool
IsAnimatable(nsCSSPropertyID aProperty, bool aIsServo)
IsTransitionable(nsCSSPropertyID aProperty, bool aIsServo)
{
if (aIsServo) {
return Servo_Property_IsAnimatable(aProperty);
return Servo_Property_IsTransitionable(aProperty);
}
// FIXME: This should also exclude discretely-animated properties.
return nsCSSProps::kAnimTypeTable[aProperty] != eStyleAnimType_None;
}
@ -871,7 +872,7 @@ nsTransitionManager::ConsiderInitiatingTransition(
return;
}
if (!IsAnimatable(aProperty, aElement->IsStyledByServo())) {
if (!IsTransitionable(aProperty, aElement->IsStyledByServo())) {
return;
}