Bug 1302007 part 2 - Add the test of cancelling the transition when setting display='none'. r=birtles
authorMantaroh Yoshinaga <mantaroh@gmail.com>
Tue, 13 Sep 2016 16:59:52 +0900
changeset 313852 ce71dd457ebe603861dbf1101802623460cb8f81
parent 313851 278a03e949e6ec40d5bbc4347504557cf3e15313
child 313853 de68ac5bf9e4f75b4116d41ec4992edf4391163c
push id30698
push usercbook@mozilla.com
push dateWed, 14 Sep 2016 10:07:43 +0000
treeherdermozilla-central@501e27643a52 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbirtles
bugs1302007
milestone51.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1302007 part 2 - Add the test of cancelling the transition when setting display='none'. r=birtles MozReview-Commit-ID: B6avXxpEpDw
dom/animation/test/css-transitions/file_animation-cancel.html
--- a/dom/animation/test/css-transitions/file_animation-cancel.html
+++ b/dom/animation/test/css-transitions/file_animation-cancel.html
@@ -113,11 +113,25 @@ test(function(t) {
   assert_equals(getComputedStyle(div).marginLeft, '1000px',
                 'margin-left style is still not animated after updating'
                 + ' transition-duration');
   assert_equals(animation.playState, 'idle',
                 'Transition is still idle after updating transition-duration');
 }, 'After cancelling a transition, updating transition properties doesn\'t make'
    + ' it live again');
 
+test(function(t) {
+  var div = addDiv(t, { style: 'margin-left: 0px' });
+  flushComputedStyle(div);
+
+  div.style.transition = 'margin-left 100s';
+  div.style.marginLeft = '1000px';
+  flushComputedStyle(div);
+
+  var animation = div.getAnimations()[0];
+  div.style.display = 'none';
+  assert_equals(animation.playState, 'idle');
+  assert_equals(getComputedStyle(div).marginLeft, '1000px');
+}, 'Setting display:none on an element cancels its transitions');
+
 done();
 </script>
 </body>