Bug 1398038 - Merge property-indexed and sequence keyframe lists; r?hiro draft
authorBrian Birtles <birtles@gmail.com>
Wed, 18 Oct 2017 14:12:16 +0900
changeset 683757 97cf7c531cc16e6876ee2257c324b028609c28f1
parent 683756 804155ee15bb1b94bd0381c15c7fe92685d42e17
child 683758 d4511953876de02c104ee65bc36320e1fa62f2d1
push id85456
push userbmo:bbirtles@mozilla.com
push dateFri, 20 Oct 2017 06:31:55 +0000
reviewershiro
bugs1398038
milestone58.0a1
Bug 1398038 - Merge property-indexed and sequence keyframe lists; r?hiro There doesn't seem to be any need to separate these and it only leads to duplicated code. MozReview-Commit-ID: IWXTPMHMls0
testing/web-platform/tests/web-animations/interfaces/Animatable/animate.html
testing/web-platform/tests/web-animations/interfaces/KeyframeEffect/constructor.html
testing/web-platform/tests/web-animations/interfaces/KeyframeEffect/setKeyframes.html
testing/web-platform/tests/web-animations/resources/keyframe-tests.js
--- a/testing/web-platform/tests/web-animations/interfaces/Animatable/animate.html
+++ b/testing/web-platform/tests/web-animations/interfaces/Animatable/animate.html
@@ -77,25 +77,17 @@ gEmptyKeyframeListTests.forEach(function
   test(function(t) {
     var div = createDiv(t);
     var anim = div.animate(subTest, 2000);
     assert_not_equals(anim, null);
   }, 'Element.animate() accepts empty keyframe lists ' +
      `(input: ${JSON.stringify(subTest)})`);
 });
 
-gPropertyIndexedKeyframesTests.forEach(function(subtest) {
-  test(function(t) {
-    var div = createDiv(t);
-    var anim = div.animate(subtest.input, 2000);
-    assert_frame_lists_equal(anim.effect.getKeyframes(), subtest.output);
-  }, 'Element.animate() accepts ' + subtest.desc);
-});
-
-gKeyframeSequenceTests.forEach(function(subtest) {
+gKeyframesTests.forEach(function(subtest) {
   test(function(t) {
     var div = createDiv(t);
     var anim = div.animate(subtest.input, 2000);
     assert_frame_lists_equal(anim.effect.getKeyframes(), subtest.output);
   }, 'Element.animate() accepts ' + subtest.desc);
 });
 
 gInvalidKeyframesTests.forEach(function(subtest) {
--- a/testing/web-platform/tests/web-animations/interfaces/KeyframeEffect/constructor.html
+++ b/testing/web-platform/tests/web-animations/interfaces/KeyframeEffect/constructor.html
@@ -101,33 +101,17 @@ test(function(t) {
       new KeyframeEffectReadOnly(target, {
         left: ["10px", "20px"]
       }, { composite: composite });
     });
   });
 }, "composite value is absent if the composite operation specified on the " +
    "keyframe effect is being used");
 
-gPropertyIndexedKeyframesTests.forEach(function(subtest) {
-  test(function(t) {
-    var effect = new KeyframeEffectReadOnly(target, subtest.input);
-    assert_frame_lists_equal(effect.getKeyframes(), subtest.output);
-  }, "a KeyframeEffectReadOnly can be constructed with " + subtest.desc);
-
-  test(function(t) {
-    var effect = new KeyframeEffectReadOnly(target, subtest.input);
-    var secondEffect =
-      new KeyframeEffectReadOnly(target, effect.getKeyframes());
-    assert_frame_lists_equal(secondEffect.getKeyframes(),
-                             effect.getKeyframes());
-  }, "a KeyframeEffectReadOnly constructed with " + subtest.desc +
-     " roundtrips");
-});
-
-gKeyframeSequenceTests.forEach(function(subtest) {
+gKeyframesTests.forEach(function(subtest) {
   test(function(t) {
     var effect = new KeyframeEffectReadOnly(target, subtest.input);
     assert_frame_lists_equal(effect.getKeyframes(), subtest.output);
   }, "a KeyframeEffectReadOnly can be constructed with " + subtest.desc);
 
   test(function(t) {
     var effect = new KeyframeEffectReadOnly(target, subtest.input);
     var secondEffect =
--- a/testing/web-platform/tests/web-animations/interfaces/KeyframeEffect/setKeyframes.html
+++ b/testing/web-platform/tests/web-animations/interfaces/KeyframeEffect/setKeyframes.html
@@ -18,25 +18,17 @@ var target = document.getElementById('ta
 test(function(t) {
   gEmptyKeyframeListTests.forEach(function(frame) {
     var effect = new KeyframeEffect(target, {});
     effect.setKeyframes(frame);
     assert_frame_lists_equal(effect.getKeyframes(), []);
   });
 }, 'Keyframes can be replaced with an empty keyframe');
 
-gPropertyIndexedKeyframesTests.forEach(function(subtest) {
-  test(function(t) {
-    var effect = new KeyframeEffect(target, {});
-    effect.setKeyframes(subtest.input);
-    assert_frame_lists_equal(effect.getKeyframes(), subtest.output);
-  }, 'Keyframes can be replaced with ' + subtest.desc);
-});
-
-gKeyframeSequenceTests.forEach(function(subtest) {
+gKeyframesTests.forEach(function(subtest) {
   test(function(t) {
     var effect = new KeyframeEffect(target, {});
     effect.setKeyframes(subtest.input);
     assert_frame_lists_equal(effect.getKeyframes(), subtest.output);
   }, 'Keyframes can be replaced with ' + subtest.desc);
 });
 
 gInvalidKeyframesTests.forEach(function(subtest) {
--- a/testing/web-platform/tests/web-animations/resources/keyframe-tests.js
+++ b/testing/web-platform/tests/web-animations/resources/keyframe-tests.js
@@ -28,17 +28,17 @@ const gBadCompositeValueTests = [
 // ------------------------------
 
 const gEmptyKeyframeListTests = [
   [],
   null,
   undefined,
 ];
 
-const gPropertyIndexedKeyframesTests = [
+const gKeyframesTests = [
   { desc:   'a one property two value property-indexed keyframes specification',
     input:  { left: ['10px', '20px'] },
     output: [{ offset: null, computedOffset: 0, easing: 'linear',
                left: '10px' },
              { offset: null, computedOffset: 1, easing: 'linear',
                left: '20px' }] },
   { desc:   'a one shorthand property two value property-indexed keyframes'
             + ' specification',
@@ -122,19 +122,16 @@ const gPropertyIndexedKeyframesTests = [
              { offset: null, computedOffset: 1, easing: 'linear',
                left: '10px' }] },
   { desc:   'a one property two value property-indexed keyframes specification'
             + ' where the second value is invalid',
     input:  { left: ['10px', 'invalid'] },
     output: [{ offset: null, computedOffset: 0, easing: 'linear',
                left: '10px' },
              { offset: null, computedOffset: 1, easing: 'linear' }] },
-];
-
-const gKeyframeSequenceTests = [
   { desc:   'a one property one keyframe sequence',
     input:  [{ offset: 1, left: '10px' }],
     output: [{ offset: 1, computedOffset: 1, easing: 'linear',
                left: '10px' }] },
   { desc:   'a one property two keyframe sequence',
     input:  [{ offset: 0, left: '10px' },
              { offset: 1, left: '20px' }],
     output: [{ offset: 0, computedOffset: 0, easing: 'linear', left: '10px' },