Bug 1304922 - Part 8: Add a test case to check we don't request restyle for layer when cascading result for the property not running on the compositor is changed r?birtles draft
authorHiroyuki Ikezoe <hiikezoe@mozilla-japan.org>
Wed, 05 Oct 2016 14:53:54 +0900
changeset 421033 5a81fd0dd57c6d2165c2cfae6a371d4d924a05a5
parent 421032 10a08d2fba99c7f98e1ee00d70ee8f3b14e74d53
child 421034 b11c0e6479bfa90700343655306d2f48805e7fea
push id31361
push userbmo:hiikezoe@mozilla-japan.org
push dateWed, 05 Oct 2016 06:56:42 +0000
reviewersbirtles
bugs1304922
milestone52.0a1
Bug 1304922 - Part 8: Add a test case to check we don't request restyle for layer when cascading result for the property not running on the compositor is changed r?birtles Actually this test case does not pass for now, since we don't throttle animation properties running on the main thread overridden by important rules. But after part 6, we don't request restyle layer in the case when the cascading result of the property which is not running on the compositor is changed, so this test case is meaningful. MozReview-Commit-ID: eraPs9WAe9
dom/animation/test/chrome/test_restyles.html
--- a/dom/animation/test/chrome/test_restyles.html
+++ b/dom/animation/test/chrome/test_restyles.html
@@ -715,12 +715,35 @@ waitForAllPaints(function() {
     var animation = div.getAnimations()[0];
     var markers = yield observeStyling(5);
     is(markers.length, 5,
        'Applying animation style with different duration '  +
        'should cause restyles on every frame.');
     yield ensureElementRemoval(div);
   });
 
+  add_task_if_omta_enabled(
+    function* changing_cascading_result_for_main_thread_animation() {
+      var div = addDiv(null, { style: 'background-color: blue' });
+      var animation = div.animate({ opacity: [0, 1],
+                                    backgroundColor: ['green', 'red'] },
+                                  100 * MS_PER_SEC);
+      yield animation.ready;
+      ok(animation.isRunningOnCompositor,
+         'The opacity animation is running on the compositor');
+      // Make the background-color style as !important to cause an update
+      // to the cascade.
+      // Bug 1300982: The background-color animation should be no longer
+      // running on the main thread.
+      div.style.setProperty('background-color', '1', 'important');
+      var markers = yield observeStyling(5);
+      todo_is(markers.length, 0,
+         'Changing cascading result for the property running on the main ' +
+         'thread does not cause synchronization layer of opacity animation ' +
+         'running on the compositor');
+      yield ensureElementRemoval(div);
+    }
+  );
+
 });
 
 </script>
 </body>