Bug 1374564 - Add drop-shadow's serialization test. r?hiro draft
authorMantaroh Yoshinaga <mantaroh@gmail.com>
Fri, 30 Jun 2017 13:06:25 -0700
changeset 602819 95b87c735bd800aa4954ecf13bc4c836a7ad9c85
parent 602818 26acf0b725f179d8000e166e8d91b3ad3dfb8b57
child 635728 cb77293f272e31e5640d60e85240f5e8df090e9b
push id66566
push userbmo:mantaroh@gmail.com
push dateFri, 30 Jun 2017 20:12:56 +0000
reviewershiro
bugs1374564
milestone56.0a1
Bug 1374564 - Add drop-shadow's serialization test. r?hiro MozReview-Commit-ID: Cf3Zhvwmklv
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
@@ -116,16 +116,21 @@
   85.1%         { padding-top: 60px } /* wins: 85.1% */
   85%           { padding-top: 30px } /* wins: 85% */
 }
 
 @keyframes anim-filter {
   to { filter: blur(5px) sepia(60%) saturate(30%); }
 }
 
+@keyframes anim-filter-drop-shadow {
+  from { filter: drop-shadow(10px 10px 10px rgb(0, 255, 0)); }
+  to { filter: drop-shadow(50px 30px 10px rgb(255, 0, 0)); }
+}
+
 @keyframes anim-text-shadow {
   to { text-shadow: none; }
 }
 
 @keyframes anim-background-size {
   to { background-size: 50%, 6px, contain }
 }
 
@@ -558,21 +563,50 @@ test(function(t) {
   ];
 
   for (var i = 0; i < frames.length; i++) {
     assert_frames_equal(frames[i], expected[i], "ComputedKeyframe #" + i);
   }
 }, 'KeyframeEffectReadOnly.getKeyframes() returns expected values for ' +
    'animations with filter properties and missing keyframes');
 
+test(function(t) {
+  if (isServoEnabled()) {
+    // FIXME : Bug 1374564 : Serialization animation value of shadow is wrong.
+    return;
+  }
+  var div = addDiv(t);
+
+  div.style.animation = 'anim-filter-drop-shadow 100s';
+  var frames = getKeyframes(div);
+
+  assert_equals(frames.length, 2, "number of frames");
+
+  var expected = [
+    { offset: 0, computedOffset: 0, easing: "ease",
+      filter: "drop-shadow(10px 10px 10px rgb(0, 255, 0))" },
+    { offset: 1, computedOffset: 1, easing: "ease",
+      filter: "drop-shadow(50px 30px 10px rgb(255, 0, 0))" },
+  ];
+
+  for (var i = 0; i < frames.length; i++) {
+    assert_frames_equal(frames[i], expected[i], "ComputedKeyframe #" + i);
+  }
+}, 'KeyframeEffectReadOnly.getKeyframes() returns expected values for ' +
+   'animation with drop-shadow of filter property');
+
 // Gecko-specific test case: We are specifically concerned here that the
 // computed value for text-shadow and a "none" specified on a keyframe
 // are correctly represented.
 
 test(function(t) {
+  if (isServoEnabled()) {
+    // FIXME : Bug 1374564 : Serialization animation value of shadow is wrong.
+    return;
+  }
   var div = addDiv(t);
 
   div.style.textShadow = '1px 1px 2px rgb(0, 0, 0), ' +
                          '0 0 16px rgb(0, 0, 255), ' +
                          '0 0 3.2px rgb(0, 0, 255)';
   div.style.animation = 'anim-text-shadow 100s';
   var frames = getKeyframes(div);