diff --git a/gfx/layers/composite/AsyncCompositionManager.cpp b/gfx/layers/composite/AsyncCompositionManager.cpp index f1c2ebed0f4a..8f8b8f6ad6ae 100644 --- a/gfx/layers/composite/AsyncCompositionManager.cpp +++ b/gfx/layers/composite/AsyncCompositionManager.cpp @@ -441,7 +441,8 @@ SampleAnimations(Layer* aLayer, TimeStamp aPoint) MOZ_ASSERT(!animation.startTime().IsNull(), "Failed to resolve start time of pending animations"); - TimeDuration elapsedDuration = aPoint - animation.startTime(); + TimeDuration elapsedDuration = + (aPoint - animation.startTime()).MultDouble(animation.playbackRate()); // Skip animations that are yet to start. // // Currently, this should only happen when the refresh driver is under test diff --git a/gfx/layers/ipc/LayersMessages.ipdlh b/gfx/layers/ipc/LayersMessages.ipdlh index 857b155c43e2..6559570452a7 100644 --- a/gfx/layers/ipc/LayersMessages.ipdlh +++ b/gfx/layers/ipc/LayersMessages.ipdlh @@ -198,6 +198,7 @@ struct Animation { int32_t direction; nsCSSProperty property; AnimationData data; + float playbackRate; }; // Change a layer's attributes diff --git a/layout/base/nsDisplayList.cpp b/layout/base/nsDisplayList.cpp index 9c17dd61808f..66eca9a1ae74 100644 --- a/layout/base/nsDisplayList.cpp +++ b/layout/base/nsDisplayList.cpp @@ -385,6 +385,7 @@ AddAnimationForProperty(nsIFrame* aFrame, const AnimationProperty& aProperty, animation->iterationCount() = timing.mIterationCount; animation->direction() = timing.mDirection; animation->property() = aProperty.mProperty; + animation->playbackRate() = aAnimation->PlaybackRate(); animation->data() = aData; for (uint32_t segIdx = 0; segIdx < aProperty.mSegments.Length(); segIdx++) { diff --git a/layout/style/test/file_animations_playbackrate.html b/layout/style/test/file_animations_playbackrate.html new file mode 100644 index 000000000000..c921b254d98b --- /dev/null +++ b/layout/style/test/file_animations_playbackrate.html @@ -0,0 +1,55 @@ + + + + + + + + + +
+ + + diff --git a/layout/style/test/mochitest.ini b/layout/style/test/mochitest.ini index 0763b8336c4f..c2d80b363c86 100644 --- a/layout/style/test/mochitest.ini +++ b/layout/style/test/mochitest.ini @@ -42,6 +42,8 @@ skip-if = toolkit == 'android' skip-if = (buildapp == 'b2g' && toolkit != 'gonk') # bug 1041017 [test_animations_pausing.html] support-files = file_animations_pausing.html +[test_animations_playbackrate.html] +support-files = file_animations_playbackrate.html [test_any_dynamic.html] [test_at_rule_parse_serialize.html] [test_bug73586.html] diff --git a/layout/style/test/test_animations_playbackrate.html b/layout/style/test/test_animations_playbackrate.html new file mode 100644 index 000000000000..16deca02c1f6 --- /dev/null +++ b/layout/style/test/test_animations_playbackrate.html @@ -0,0 +1,28 @@ + + + + + Test for Animation.playbackRate on compositor animations (Bug 1175751) + + + + +Mozilla Bug 1175751 +
+
+
+
+ +