Bug 1265611 - Add tests for CSS animations
MozReview-Commit-ID: LTnRxQixqzJ
new file mode 100644
--- /dev/null
+++ b/layout/style/test/file_animations_with_disabled_properties.html
@@ -0,0 +1,57 @@
+<!doctype html>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=1265611
+-->
+<head>
+ <meta charset=utf-8>
+ <title>Test for bug 1265611</title>
+ <style>
+ @keyframes enabled-and-disabled {
+ from {
+ left: 0px;
+ -webkit-text-fill-color: green;
+ }
+ to {
+ left: 100px;
+ -webkit-text-fill-color: blue;
+ }
+ }
+ </style>
+ <script>
+ var is = opener.is.bind(opener);
+ var ok = opener.ok.bind(opener);
+ var todo = opener.todo.bind(opener);
+ function finish() {
+ var o = opener;
+ self.close();
+ o.SimpleTest.finish();
+ }
+ </script>
+</head>
+<body>
+<div id="display"></div>
+<script type="application/javascript">
+'use strict';
+
+var display = document.getElementById('display');
+display.style.animation = 'enabled-and-disabled 0.01s';
+
+var animation = display.getAnimations()[0];
+is(animation.effect.getFrames().length, 2,
+ 'Got two frames on the generated animation');
+
+ok(animation.effect.getFrames()[0].hasOwnProperty('left'),
+ 'Enabled property is set on initial keyframe');
+ok(!animation.effect.getFrames()[0].hasOwnProperty('webkitTextFillColor'),
+ 'Disabled property is not set on initial keyframe');
+
+ok(animation.effect.getFrames()[1].hasOwnProperty('left'),
+ 'Enabled property is set on final keyframe');
+ok(!animation.effect.getFrames()[1].hasOwnProperty('webkitTextFillColor'),
+ 'Disabled property is not set on final keyframe');
+
+finish();
+</script>
+</body>
+</html>
--- a/layout/style/test/mochitest.ini
+++ b/layout/style/test/mochitest.ini
@@ -58,16 +58,18 @@ support-files = file_animations_iteratio
[test_animations_omta_start.html]
skip-if = (buildapp == 'b2g' && toolkit != 'gonk') # bug 1041017
[test_animations_pausing.html]
support-files = file_animations_pausing.html
[test_animations_playbackrate.html]
support-files = file_animations_playbackrate.html
[test_animations_styles_on_event.html]
support-files = file_animations_styles_on_event.html
+[test_animations_with_disabled_properties.html]
+support-files = file_animations_with_disabled_properties.html
[test_any_dynamic.html]
[test_at_rule_parse_serialize.html]
[test_attribute_selector_eof_behavior.html]
[test_background_blend_mode.html]
[test_box_size_keywords.html]
[test_bug73586.html]
[test_bug74880.html]
[test_bug98997.html]
new file mode 100644
--- /dev/null
+++ b/layout/style/test/test_animations_with_disabled_properties.html
@@ -0,0 +1,32 @@
+<!doctype html>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=1265611
+-->
+<head>
+ <title>Test CSS animations ignore disabled properties (Bug 1265611)</title>
+ <script type="application/javascript"
+ src="/tests/SimpleTest/SimpleTest.js"></script>
+ <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
+</head>
+<body>
+<a target="_blank"
+ href="https://bugzilla.mozilla.org/show_bug.cgi?id=1265611">Mozilla Bug
+ 1265611</a>
+<div id="display"></div>
+<pre id="test">
+<script>
+'use strict';
+
+SimpleTest.waitForExplicitFinish();
+
+SpecialPowers.pushPrefEnv(
+ { 'set': [[ 'dom.animations-api.core.enabled', true ],
+ [ 'layout.css.prefixes.webkit', false ]] },
+ function() {
+ window.open('file_animations_with_disabled_properties.html');
+ });
+</script>
+</pre>
+</body>
+</html>