Bug 1353202 - Add support for iteration composite modes
MozReview-Commit-ID: qB2AqcIij2
--- a/dom/animation/KeyframeEffectReadOnly.cpp
+++ b/dom/animation/KeyframeEffectReadOnly.cpp
@@ -650,33 +650,30 @@ KeyframeEffectReadOnly::ComposeStyleRule
aStyleRule->AddValue(aProperty.mProperty, Move(val));
} else if (valuePosition < 0.5) {
aStyleRule->AddValue(aProperty.mProperty, Move(fromValue));
} else {
aStyleRule->AddValue(aProperty.mProperty, Move(toValue));
}
}
-// Bug 1333311 - We use two branches for Gecko and Stylo. However, it's
-// better to remove the duplicated code.
void
KeyframeEffectReadOnly::ComposeStyleRule(
RawServoAnimationValueMap& aAnimationValues,
const AnimationProperty& aProperty,
const AnimationPropertySegment& aSegment,
const ComputedTiming& aComputedTiming)
{
- // Bug 1329878 - Stylo: Implement accumulate and addition on Servo
- // AnimationValue.
-
Servo_AnimationCompose(&aAnimationValues,
&mBaseStyleValuesForServo,
aProperty.mProperty,
&aSegment,
- &aComputedTiming);
+ &aProperty.mSegments.LastElement(),
+ &aComputedTiming,
+ mEffectOptions.mIterationComposite);
}
template<typename ComposeAnimationResult>
void
KeyframeEffectReadOnly::ComposeStyle(
ComposeAnimationResult&& aComposeResult,
const nsCSSPropertyIDSet& aPropertiesToSkip)
{
--- a/layout/reftests/web-animations/reftest.list
+++ b/layout/reftests/web-animations/reftest.list
@@ -13,10 +13,10 @@ test-pref(dom.animations-api.core.enable
test-pref(dom.animations-api.core.enabled,true) == stacking-context-transform-changing-keyframe-in-delay.html stacking-context-animation-ref.html
test-pref(dom.animations-api.core.enabled,true) == stacking-context-transform-changing-target.html stacking-context-animation-changing-target-ref.html
test-pref(dom.animations-api.core.enabled,true) == stacking-context-transform-changing-target-in-delay.html stacking-context-animation-changing-target-ref.html
test-pref(dom.animations-api.core.enabled,true) == stacking-context-transform-changing-effect.html stacking-context-animation-ref.html
test-pref(dom.animations-api.core.enabled,true) == stacking-context-transform-changing-display-property.html stacking-context-animation-ref.html
test-pref(dom.animations-api.core.enabled,true) == stacking-context-transform-losing-css-animation-in-delay.html stacking-context-animation-ref.html
test-pref(dom.animations-api.core.enabled,true) == style-updates-on-iteration-composition-changed-from-accumulate-to-replace.html style-updates-for-iteration-composite-ref.html
-test-pref(dom.animations-api.core.enabled,true) fails-if(stylo) == style-updates-on-iteration-composition-changed-from-replace-to-accumulate.html style-updates-for-iteration-composite-ref.html
-test-pref(dom.animations-api.core.enabled,true) fails-if(stylo) == style-updates-on-current-iteration-changed.html style-updates-for-iteration-composite-ref.html
+test-pref(dom.animations-api.core.enabled,true) == style-updates-on-iteration-composition-changed-from-replace-to-accumulate.html style-updates-for-iteration-composite-ref.html
+test-pref(dom.animations-api.core.enabled,true) == style-updates-on-current-iteration-changed.html style-updates-for-iteration-composite-ref.html
--- a/layout/style/ServoBindingList.h
+++ b/layout/style/ServoBindingList.h
@@ -311,17 +311,19 @@ SERVO_BINDING_FUNC(Servo_DeclarationBloc
// Compose animation value for a given property.
// |base_values| is nsRefPtrHashtable<nsUint32HashKey, RawServoAnimationValue>.
// We use void* to avoid exposing nsRefPtrHashtable in FFI.
SERVO_BINDING_FUNC(Servo_AnimationCompose, void,
RawServoAnimationValueMapBorrowedMut animation_values,
void* base_values,
nsCSSPropertyID property,
RawGeckoAnimationPropertySegmentBorrowed animation_segment,
- RawGeckoComputedTimingBorrowed computed_timing)
+ RawGeckoAnimationPropertySegmentBorrowed last_segment,
+ RawGeckoComputedTimingBorrowed computed_timing,
+ mozilla::dom::IterationCompositeOperation iteration_composite)
// presentation attributes
SERVO_BINDING_FUNC(Servo_DeclarationBlock_PropertyIsSet, bool,
RawServoDeclarationBlockBorrowed declarations,
nsCSSPropertyID property)
SERVO_BINDING_FUNC(Servo_DeclarationBlock_SetIdentStringValue, void,
RawServoDeclarationBlockBorrowed declarations,
nsCSSPropertyID property,
--- a/layout/style/ServoBindings.h
+++ b/layout/style/ServoBindings.h
@@ -38,16 +38,19 @@ namespace mozilla {
enum class CSSPseudoElementType : uint8_t;
struct Keyframe;
enum Side;
struct StyleTransition;
namespace css {
struct URLValue;
struct ImageValue;
};
+ namespace dom {
+ enum class IterationCompositeOperation : uint8_t;
+ };
enum class UpdateAnimationsTasks : uint8_t;
struct LangGroupFontPrefs;
class ServoStyleSheet;
class ServoElementSnapshotTable;
}
using mozilla::FontFamilyList;
using mozilla::FontFamilyType;
using mozilla::ServoElementSnapshot;
--- a/layout/style/ServoBindings.toml
+++ b/layout/style/ServoBindings.toml
@@ -43,16 +43,17 @@ args = [
[structs]
headers = [
"nsStyleStruct.h",
"mozilla/ServoPropPrefList.h",
"mozilla/StyleAnimationValue.h",
"gfxFontConstants.h",
"nsThemeConstants.h",
"mozilla/dom/AnimationEffectReadOnlyBinding.h",
+ "mozilla/dom/KeyframeEffectBinding.h",
"mozilla/AnimationPropertySegment.h",
"mozilla/ComputedTiming.h",
"mozilla/ComputedTimingFunction.h",
"mozilla/Keyframe.h",
"mozilla/ServoElementSnapshot.h",
"mozilla/ServoElementSnapshotTable.h",
"mozilla/dom/Element.h",
"mozilla/dom/NameSpaceConstants.h",
@@ -113,16 +114,17 @@ whitelist-types = [
"mozilla::ComputedTiming",
"mozilla::ComputedTimingFunction",
"mozilla::ComputedTimingFunction::BeforeFlag",
"mozilla::ServoStyleSheet",
"mozilla::ServoElementSnapshot.*",
"mozilla::CSSPseudoClassType",
"mozilla::css::SheetParsingMode",
"mozilla::css::URLMatchingFunction",
+ "mozilla::dom::IterationCompositeOperation",
"mozilla::HalfCorner",
"mozilla::PropertyStyleAnimationValuePair",
"mozilla::TraversalRestyleBehavior",
"mozilla::TraversalRootBehavior",
"mozilla::StyleShapeRadius",
"mozilla::StyleGrid.*",
"mozilla::UpdateAnimationsTasks",
"mozilla::LookAndFeel",
@@ -337,16 +339,17 @@ structs-types = [
"CSSPseudoElementType",
"TraversalRestyleBehavior",
"TraversalRootBehavior",
"ComputedTimingFunction_BeforeFlag",
"FontFamilyList",
"FontFamilyType",
"FontSizePrefs",
"GeckoFontMetrics",
+ "IterationCompositeOperation",
"Keyframe",
"ServoBundledURI",
"ServoElementSnapshot",
"ServoElementSnapshotTable",
"SheetParsingMode",
"StyleBasicShape",
"StyleBasicShapeType",
"StyleShapeSource",