Bug 1338927 - Part 8: Drop Servo_AnimationValues_Populate. r?birtles
MozReview-Commit-ID: 83WCbKL35h
--- a/dom/animation/KeyframeUtils.cpp
+++ b/dom/animation/KeyframeUtils.cpp
@@ -619,91 +619,55 @@ KeyframeUtils::GetComputedKeyframeValues
/* static */ nsTArray<ComputedKeyframeValues>
KeyframeUtils::GetComputedKeyframeValues(const nsTArray<Keyframe>& aKeyframes,
dom::Element* aElement,
nsStyleContext* aStyleContext)
{
MOZ_ASSERT(aStyleContext);
MOZ_ASSERT(aElement);
- StyleBackendType styleBackend = aElement->OwnerDoc()->GetStyleBackendType();
-
const size_t len = aKeyframes.Length();
nsTArray<ComputedKeyframeValues> result(len);
- const ServoComputedValues* currentStyle = nullptr;
- const ServoComputedValues* parentStyle = nullptr;
-
- if (styleBackend == StyleBackendType::Servo) {
- currentStyle = aStyleContext->StyleSource().AsServoComputedValues();
- if (aStyleContext->GetParent()) {
- parentStyle = aStyleContext->GetParent()->StyleSource().AsServoComputedValues();
- }
- }
-
for (const Keyframe& frame : aKeyframes) {
nsCSSPropertyIDSet propertiesOnThisKeyframe;
ComputedKeyframeValues* computedValues = result.AppendElement();
for (const PropertyValuePair& pair :
PropertyPriorityIterator(frame.mPropertyValues)) {
- MOZ_ASSERT(!pair.mServoDeclarationBlock ||
- styleBackend == StyleBackendType::Servo,
+ MOZ_ASSERT(!pair.mServoDeclarationBlock,
"Animation values were parsed using Servo backend but target"
" element is not using Servo backend?");
- if (IsInvalidValuePair(pair, styleBackend)) {
+ if (IsInvalidValuePair(pair, StyleBackendType::Gecko)) {
continue;
}
// Expand each value into the set of longhands and produce
// a KeyframeValueEntry for each value.
nsTArray<PropertyStyleAnimationValuePair> values;
- if (styleBackend == StyleBackendType::Servo) {
- if (nsCSSProps::IsShorthand(pair.mProperty)) {
- CSSPROPS_FOR_SHORTHAND_SUBPROPERTIES(p, pair.mProperty,
- CSSEnabledState::eForAllContent) {
- if (nsCSSProps::kAnimTypeTable[*p] == eStyleAnimType_None) {
- // Skip non-animatable component longhands.
- continue;
- }
- PropertyStyleAnimationValuePair* valuePair = values.AppendElement();
- valuePair->mProperty = *p;
- }
- } else {
- PropertyStyleAnimationValuePair* valuePair = values.AppendElement();
- valuePair->mProperty = pair.mProperty;
+ // For shorthands, we store the string as a token stream so we need to
+ // extract that first.
+ if (nsCSSProps::IsShorthand(pair.mProperty)) {
+ nsCSSValueTokenStream* tokenStream = pair.mValue.GetTokenStreamValue();
+ if (!StyleAnimationValue::ComputeValues(pair.mProperty,
+ CSSEnabledState::eForAllContent, aElement, aStyleContext,
+ tokenStream->mTokenStream, /* aUseSVGMode */ false, values) ||
+ IsComputeValuesFailureKey(pair)) {
+ continue;
}
-
- Servo_AnimationValues_Populate(&values,
- pair.mServoDeclarationBlock,
- currentStyle,
- parentStyle,
- aStyleContext->PresContext());
} else {
- // For shorthands, we store the string as a token stream so we need to
- // extract that first.
- if (nsCSSProps::IsShorthand(pair.mProperty)) {
- nsCSSValueTokenStream* tokenStream = pair.mValue.GetTokenStreamValue();
- if (!StyleAnimationValue::ComputeValues(pair.mProperty,
- CSSEnabledState::eForAllContent, aElement, aStyleContext,
- tokenStream->mTokenStream, /* aUseSVGMode */ false, values) ||
- IsComputeValuesFailureKey(pair)) {
- continue;
- }
- } else {
- if (!StyleAnimationValue::ComputeValues(pair.mProperty,
- CSSEnabledState::eForAllContent, aElement, aStyleContext,
- pair.mValue, /* aUseSVGMode */ false, values)) {
- continue;
- }
- MOZ_ASSERT(values.Length() == 1,
- "Longhand properties should produce a single"
- " StyleAnimationValue");
+ if (!StyleAnimationValue::ComputeValues(pair.mProperty,
+ CSSEnabledState::eForAllContent, aElement, aStyleContext,
+ pair.mValue, /* aUseSVGMode */ false, values)) {
+ continue;
}
+ MOZ_ASSERT(values.Length() == 1,
+ "Longhand properties should produce a single"
+ " StyleAnimationValue");
}
for (auto& value : values) {
// If we already got a value for this property on the keyframe,
// skip this one.
if (propertiesOnThisKeyframe.HasProperty(value.mProperty)) {
continue;
}
--- a/layout/style/ServoBindingList.h
+++ b/layout/style/ServoBindingList.h
@@ -108,22 +108,16 @@ SERVO_BINDING_FUNC(Servo_ParseProperty,
SERVO_BINDING_FUNC(Servo_GetComputedKeyframeValues, void,
RawGeckoKeyframeListBorrowed keyframes,
ServoComputedValuesBorrowed style,
ServoComputedValuesBorrowedOrNull parent_style,
RawGeckoPresContextBorrowed pres_context,
RawGeckoComputedKeyframeValuesListBorrowedMut result)
// AnimationValues handling
-SERVO_BINDING_FUNC(Servo_AnimationValues_Populate, void,
- RawGeckoAnimationValueListBorrowedMut,
- RawServoDeclarationBlockBorrowed,
- ServoComputedValuesBorrowed,
- ServoComputedValuesBorrowedOrNull,
- RawGeckoPresContextBorrowed)
SERVO_BINDING_FUNC(Servo_AnimationValues_Interpolate,
RawServoAnimationValueStrong,
RawServoAnimationValueBorrowed from,
RawServoAnimationValueBorrowed to,
double progress)
SERVO_BINDING_FUNC(Servo_AnimationValues_Uncompute,
RawServoDeclarationBlockStrong,
RawServoAnimationValueBorrowedListBorrowed value)