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
--- a/layout/style/ServoBindingList.h
+++ b/layout/style/ServoBindingList.h
@@ -223,16 +223,18 @@ SERVO_BINDING_FUNC(Servo_GetComputedKeyf
RawServoStyleSetBorrowed set,
RawGeckoComputedKeyframeValuesListBorrowedMut result)
SERVO_BINDING_FUNC(Servo_ComputedValues_ExtractAnimationValue,
RawServoAnimationValueStrong,
ServoComputedValuesBorrowed computed_values,
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,
RawGeckoElementBorrowed,
RawGeckoCSSPropertyIDListBorrowed,
nsCSSPropertyIDSetBorrowedMut)
SERVO_BINDING_FUNC(Servo_MatrixTransform_Operate, void,
nsStyleTransformMatrix::MatrixTransformOperator
--- a/layout/style/nsTransitionManager.cpp
+++ b/layout/style/nsTransitionManager.cpp
@@ -823,22 +823,23 @@ GetTransitionKeyframes(nsCSSPropertyID a
}
AppendKeyframe(1.0, aProperty, Move(aEndValue), keyframes);
return keyframes;
}
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;
}
template<typename StyleType>
void
nsTransitionManager::ConsiderInitiatingTransition(
nsCSSPropertyID aProperty,
const StyleTransition& aTransition,
@@ -866,17 +867,17 @@ nsTransitionManager::ConsiderInitiatingT
if (aWhichStarted->HasProperty(aProperty)) {
// A later item in transition-property already started a
// transition for this property, so we ignore this one.
// See comment above and
// http://lists.w3.org/Archives/Public/www-style/2009Aug/0109.html .
return;
}
- if (!IsAnimatable(aProperty, aElement->IsStyledByServo())) {
+ if (!IsTransitionable(aProperty, aElement->IsStyledByServo())) {
return;
}
dom::DocumentTimeline* timeline = aElement->OwnerDoc()->Timeline();
AnimationValue startValue, endValue;
bool haveValues =
ExtractNonDiscreteComputedValue(aProperty, aOldStyle, startValue) &&