summaryrefslogtreecommitdiffstats
path: root/layout/style/test/file_animations_async_tests.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/file_animations_async_tests.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/file_animations_async_tests.html')
-rw-r--r--layout/style/test/file_animations_async_tests.html77
1 files changed, 77 insertions, 0 deletions
diff --git a/layout/style/test/file_animations_async_tests.html b/layout/style/test/file_animations_async_tests.html
new file mode 100644
index 000000000..9d4dfa1fe
--- /dev/null
+++ b/layout/style/test/file_animations_async_tests.html
@@ -0,0 +1,77 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+ <meta charset="utf-8">
+ <title>Test for Bug 1086937</title>
+ <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>
+ <script type="application/javascript" src="animation_utils.js"></script>
+ <style>
+ /* must use implicit value at one end */
+ @keyframes slide-left { from { margin-left: -1000px } }
+ </style>
+ <script type="application/javascript">
+
+ var gDisplay;
+
+ function run() {
+ gDisplay = document.getElementById("display");
+ opener.SimpleTest.executeSoon(test1);
+ }
+
+ /*
+ * Bug 1086937 - Animations continue correctly across load of
+ * downloadable font.
+ */
+ function test1() {
+ var animdiv = document.createElement("div");
+ // Take control of the refresh driver right from the start
+ advance_clock(0);
+ animdiv.style.animation = "slide-left 100s linear"; // 10px per second
+ gDisplay.appendChild(animdiv);
+ var cs = getComputedStyle(animdiv, "");
+ is(cs.marginLeft, "-1000px", "initial value of animation (force flush)");
+ advance_clock(1000);
+ is(cs.marginLeft, "-990px", "value of animation before font load");
+
+ var font = new FontFace("DownloadedAhem", "url(Ahem.ttf)");
+ document.fonts.add(font);
+
+ var fontdiv = document.createElement("div");
+ fontdiv.appendChild(document.createTextNode("A"));
+ fontdiv.style.fontFamily = "DownloadedAhem";
+ gDisplay.appendChild(fontdiv);
+
+ font.load().then(function(loadedFace) {
+ is(cs.marginLeft, "-990px", "value of animation after font load " +
+ "(clock only advances when we say so)");
+ advance_clock(1000);
+ is(cs.marginLeft, "-980px",
+ "animation should still be advancing after font load");
+
+ SpecialPowers.DOMWindowUtils.restoreNormalRefresh();
+ document.fonts.delete(font);
+ animdiv.remove();
+ fontdiv.remove();
+
+ finish();
+ });
+ }
+
+ </script>
+</head>
+<body onload="run()">
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1086937">Mozilla Bug 1086937</a>
+<div id="display"></div>
+<pre id="test">
+</pre>
+</body>
+</html>