Bug 1402219 - Check the length of returned keyframes of getKeyframes(). r?birtles draft
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Mon, 25 Sep 2017 17:08:03 +0900
changeset 669704 33dbf9b5444fc121a25481c2e4b2d955ea8ddd01
parent 669703 1942972c6b53d5d1858fc63508edbc3057b0cefa
child 669705 0b3f4a604b6674d9a934223aac6f117b8641869a
push id81398
push userhikezoe@mozilla.com
push dateMon, 25 Sep 2017 08:14:31 +0000
reviewersbirtles
bugs1402219
milestone58.0a1
Bug 1402219 - Check the length of returned keyframes of getKeyframes(). r?birtles Otherwise, if getKeyframes() returns an empty array, we don't check each keyframes at all. MozReview-Commit-ID: LSBIgetZq2G
dom/animation/test/css-animations/file_keyframeeffect-getkeyframes.html
--- a/dom/animation/test/css-animations/file_keyframeeffect-getkeyframes.html
+++ b/dom/animation/test/css-animations/file_keyframeeffect-getkeyframes.html
@@ -655,16 +655,18 @@ test(function(t) {
    'animations with background-size properties and missing keyframes');
 
 test(function(t) {
   var div = addDiv(t);
   div.style.animation = 'anim-variables 100s';
 
   var frames = getKeyframes(div);
 
+  assert_equals(frames.length, 2, "number of frames");
+
   var expected = [
     { offset: 0, computedOffset: 0, easing: "ease",
       transform: "none" },
     { offset: 1, computedOffset: 1, easing: "ease",
       transform: "translate(100px, 0px)" },
   ];
   for (var i = 0; i < frames.length; i++) {
     assert_frames_equal(frames[i], expected[i], "ComputedKeyframe #" + i);
@@ -673,16 +675,18 @@ test(function(t) {
    'animations with CSS variables as keyframe values');
 
 test(function(t) {
   var div = addDiv(t);
   div.style.animation = 'anim-variables-shorthand 100s';
 
   var frames = getKeyframes(div);
 
+  assert_equals(frames.length, 2, "number of frames");
+
   var expected = [
     { offset: 0, computedOffset: 0, easing: "ease",
       marginBottom: "0px",
       marginLeft: "0px",
       marginRight: "0px",
       marginTop: "0px" },
     { offset: 1, computedOffset: 1, easing: "ease",
       marginBottom: "100px",