Bug 1277456 part 8 - Add test that when changing target element, the computed values are re-computed; r?hiro draft
authorBrian Birtles <birtles@gmail.com>
Wed, 13 Jul 2016 13:24:20 +0900
changeset 388494 a6c8a6268a230a649f99f429eac0690f40dc1753
parent 388493 94fff51558e890bea83e60a442bf763ae4c451f4
child 525565 652ccf5dc27395bb5d29076c4dbe6f1e2bec4177
push id23192
push userbbirtles@mozilla.com
push dateSat, 16 Jul 2016 04:09:50 +0000
reviewershiro
bugs1277456
milestone50.0a1
Bug 1277456 part 8 - Add test that when changing target element, the computed values are re-computed; r?hiro MozReview-Commit-ID: 4UQFAKFT2uG
testing/web-platform/tests/web-animations/animation-model/keyframe-effects/effect-value-context.html
--- a/testing/web-platform/tests/web-animations/animation-model/keyframe-effects/effect-value-context.html
+++ b/testing/web-platform/tests/web-animations/animation-model/keyframe-effects/effect-value-context.html
@@ -77,10 +77,28 @@ promise_test(function(t) {
     assert_equals(getComputedStyle(div).marginLeft, '150px',
                   'Effect value after attaching to font-size:10px parent');
     divWith20pxFontSize.appendChild(div);
     assert_equals(getComputedStyle(div).marginLeft, '300px',
                   'Effect value after attaching to font-size:20px parent');
   });
 }, 'Effect values reflect changes to font-size from reparenting');
 
+test(function(t) {
+  var divA = createDiv(t);
+  divA.style.fontSize = '10px';
+
+  var divB = createDiv(t);
+  divB.style.fontSize = '20px';
+
+  var animation = divA.animate([ { marginLeft: '10em' },
+                                 { marginLeft: '20em' } ], 1000);
+  animation.currentTime = 500;
+  assert_equals(getComputedStyle(divA).marginLeft, '150px',
+                'Effect value before updating target element');
+
+  animation.effect.target = divB;
+  assert_equals(getComputedStyle(divB).marginLeft, '300px',
+                'Effect value after updating target element');
+}, 'Effect values reflect changes to target element');
+
 </script>
 </body>