summaryrefslogtreecommitdiffstats
path: root/layout/style/test/test_animations_dynamic_changes.html
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /layout/style/test/test_animations_dynamic_changes.html
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'layout/style/test/test_animations_dynamic_changes.html')
-rw-r--r--layout/style/test/test_animations_dynamic_changes.html65
1 files changed, 65 insertions, 0 deletions
diff --git a/layout/style/test/test_animations_dynamic_changes.html b/layout/style/test/test_animations_dynamic_changes.html
new file mode 100644
index 000000000..a68d734dc
--- /dev/null
+++ b/layout/style/test/test_animations_dynamic_changes.html
@@ -0,0 +1,65 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=978833
+-->
+<head>
+ <title>Test for Bug 978833</title>
+ <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+ <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
+ <style id="style">
+ @keyframes a {
+ from, to {
+ /* a non-inherited property, so it's cached in the rule tree */
+ margin-left: 50px;
+ }
+ }
+ .alwaysa {
+ animation: a linear 1s infinite;
+ }
+ </style>
+</head>
+<body>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=978833">Mozilla Bug 978833</a>
+<p id="display"></p>
+<pre id="test">
+<script type="application/javascript">
+
+var p = document.getElementById("display");
+var cs = getComputedStyle(p, "");
+var style = document.getElementById("style").sheet;
+
+/** Test for Bug 978833 **/
+function test_bug978833() {
+ var kfs = style.cssRules[0];
+ var kf = kfs.cssRules[0];
+ is(kf.style.marginLeft, "50px", "we found the right keyframe rule");
+
+ p.classList.add("alwaysa");
+ is(cs.marginLeft, "50px", "p margin-left should be 50px");
+
+ // Temporarily remove the animation style, since we resolve keyframes
+ // on top of current animation styles (although maybe we shouldn't),
+ // so we need to remove those styles to hit the rule tree cache.
+ p.classList.remove("alwaysa");
+ is(cs.marginLeft, "0px", "p margin-left should be 0px without animation");
+
+ p.classList.add("alwaysa");
+ kf.style.marginLeft = "100px";
+ is(cs.marginLeft, "100px", "p margin-left should be 100px after change");
+
+ // Try the same thing a second time, just to make sure it works again.
+ p.classList.remove("alwaysa");
+ is(cs.marginLeft, "0px", "p margin-left should be 0px without animation");
+ p.classList.add("alwaysa");
+ kf.style.marginLeft = "150px";
+ is(cs.marginLeft, "150px", "p margin-left should be 150px after second change");
+
+ p.style.animation = "";
+}
+test_bug978833();
+
+</script>
+</pre>
+</body>
+</html>