Bug 1361234 - Fix start time calculation for pending animations on layers; r?hiro draft
authorBrian Birtles <birtles@gmail.com>
Tue, 02 May 2017 16:41:13 +0900
changeset 571193 ad9c46175dccade97d6f5972ed75b0ddc8811c4c
parent 571192 53004104bef1359537fb1e9813353f8ce1e9b995
child 571195 7a395d2cdfeb1c8e45f2df6edcd72b8cbaf7a6ad
child 571259 3fb74baac33e09c242d422668fc12e33046b4b68
push id56720
push userbbirtles@mozilla.com
push dateTue, 02 May 2017 08:35:19 +0000
reviewershiro
bugs1361234, 1223658
milestone55.0a1
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
dom/animation/test/mochitest.ini
gfx/layers/Layers.cpp
--- 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();
         }
       });
 }