Bug 1361234 - Fix start time calculation for pending animations on layers; r?hiro
In
bug 1223658 we separated out the delay from the start time but we failed to
remove it from this calculation. As a result, when a pending animation begins it
will have the delay applied twice (once here, and once when it is sampled on the
compositor). This will happen until the layer is next updated.
This bug was not exposed by any existing tests since we don't use this code path
when the refresh driver is under test control. Furthermore, the one test that
was supposed to cover this was refactored in such a way that it stopped testing
this code path. That test is restored earlier in this patch series and enabled
in this patch.
MozReview-Commit-ID: B2KR7YaPsMK
--- a/dom/animation/test/mochitest.ini
+++ b/dom/animation/test/mochitest.ini
@@ -96,17 +96,16 @@ support-files =
[css-transitions/test_event-dispatch.html]
[css-transitions/test_keyframeeffect-getkeyframes.html]
[css-transitions/test_pseudoElement-get-animations.html]
[css-transitions/test_setting-effect.html]
[document-timeline/test_document-timeline.html]
[document-timeline/test_request_animation_frame.html]
[mozilla/test_cubic_bezier_limits.html]
[mozilla/test_deferred_start.html]
-skip-if = true # Bug 1361234 (mostly fails)
[mozilla/test_disable_animations_api_core.html]
[mozilla/test_disabled_properties.html]
[mozilla/test_discrete-animations.html]
[mozilla/test_document-timeline-origin-time-range.html]
[mozilla/test_hide_and_show.html]
[mozilla/test_set-easing.html]
[mozilla/test_spacing_property_order.html]
[mozilla/test_transform_limits.html]
--- a/gfx/layers/Layers.cpp
+++ b/gfx/layers/Layers.cpp
@@ -288,17 +288,17 @@ Layer::StartPendingAnimations(const Time
{
bool updated = false;
for (size_t animIdx = 0, animEnd = layer->mAnimations.Length();
animIdx < animEnd; animIdx++) {
Animation& anim = layer->mAnimations[animIdx];
// If the animation is play-pending, resolve the start time.
if (anim.startTime().IsNull() && !anim.isNotPlaying()) {
- anim.startTime() = aReadyTime - anim.holdTime() + anim.delay();
+ anim.startTime() = aReadyTime - anim.holdTime();
updated = true;
}
}
if (updated) {
layer->Mutated();
}
});
}