Bug 1343753 - Part 9: Early return for non-animatable properties for transitions.
MozReview-Commit-ID: HtNavkzyHvt
--- a/layout/style/ServoBindingList.h
+++ b/layout/style/ServoBindingList.h
@@ -138,16 +138,18 @@ SERVO_BINDING_FUNC(Servo_GetComputedKeyf
SERVO_BINDING_FUNC(Servo_AnimationValueMap_Push, void,
RawServoAnimationValueMapBorrowed,
nsCSSPropertyID property,
RawServoAnimationValueBorrowed value)
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_IsDiscreteAnimatable, bool,
nsCSSPropertyID property)
// AnimationValues handling
SERVO_BINDING_FUNC(Servo_AnimationValues_Interpolate,
RawServoAnimationValueStrong,
RawServoAnimationValueBorrowed from,
RawServoAnimationValueBorrowed to,
--- a/layout/style/nsTransitionManager.cpp
+++ b/layout/style/nsTransitionManager.cpp
@@ -822,16 +822,26 @@ GetTransitionKeyframes(nsCSSPropertyID a
fromFrame.mTimingFunction->Init(aTimingFunction);
}
AppendKeyframe(1.0, aProperty, Move(aEndValue), keyframes);
return keyframes;
}
+static bool
+IsAnimatable(nsCSSPropertyID aProperty, bool aIsServo)
+{
+ if (aIsServo) {
+ return Servo_Property_IsAnimatable(aProperty);
+ }
+
+ return nsCSSProps::kAnimTypeTable[aProperty] != eStyleAnimType_None;
+}
+
template<typename StyleType>
void
nsTransitionManager::ConsiderInitiatingTransition(
nsCSSPropertyID aProperty,
const StyleTransition& aTransition,
dom::Element* aElement,
CSSPseudoElementType aPseudoType,
CSSTransitionCollection*& aElementTransitions,
@@ -856,17 +866,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 (nsCSSProps::kAnimTypeTable[aProperty] == eStyleAnimType_None) {
+ if (!IsAnimatable(aProperty, aElement->IsStyledByServo())) {
return;
}
dom::DocumentTimeline* timeline = aElement->OwnerDoc()->Timeline();
AnimationValue startValue, endValue;
bool haveValues =
ExtractNonDiscreteComputedValue(aProperty, aOldStyle, startValue) &&