Bug 1374564 - Add drop-shadow's serialization test. r?hiro
MozReview-Commit-ID: Cf3Zhvwmklv
--- 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,16 +563,37 @@ 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) {
+ 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) {
var div = addDiv(t);
div.style.textShadow = '1px 1px 2px rgb(0, 0, 0), ' +
--- a/dom/animation/test/testcommon.js
+++ b/dom/animation/test/testcommon.js
@@ -335,19 +335,8 @@ function addSVGElement(target, tag, attr
if (attrs) {
for (var attrName in attrs) {
element.setAttributeNS(null, attrName, attrs[attrName]);
}
}
target.appendChild(element);
return element;
}
-
-/*
- * Return true if servo is enabled.
- */
-function isServoEnabled() {
- try {
- return SpecialPowers.getBoolPref('layout.css.servo.enabled');
- } catch(e) {
- return false;
- }
-}