summaryrefslogtreecommitdiffstats
path: root/layout/reftests/web-animations/1267937-1.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/reftests/web-animations/1267937-1.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/reftests/web-animations/1267937-1.html')
-rw-r--r--layout/reftests/web-animations/1267937-1.html58
1 files changed, 58 insertions, 0 deletions
diff --git a/layout/reftests/web-animations/1267937-1.html b/layout/reftests/web-animations/1267937-1.html
new file mode 100644
index 000000000..6288ec162
--- /dev/null
+++ b/layout/reftests/web-animations/1267937-1.html
@@ -0,0 +1,58 @@
+<!doctype html>
+<html class="reftest-wait reftest-no-flush">
+<head>
+<meta charset=utf-8>
+<title>Bug 1267937</title>
+<style>
+#target {
+ width: 100px;
+ height: 100px;
+ background: green;
+}
+</style>
+</head>
+<body>
+<div id="target"></div>
+<script>
+ var target = document.getElementById("target");
+ var anim = target.animate(
+ { marginLeft: [ "0px", "10px" ] },
+ { duration: 500000 /* 500s */, easing: "steps(2, start)" });
+
+ anim.ready.then(function() {
+ // Set currentTime in before phase, i.e., GetComputedTimingAt() returns
+ // null progress in the phase so that we can skip ComposeStyle().
+ // This currentTime value should be far from zero in order to skip
+ // restyles requested by setting currentTime or frames in a next tick.
+ // If this value is near by zero, say -1, the restyles will be processed in
+ // the next tick and current time in the next tick must be greater than
+ // zero at that point, that means the animation with new frame values will
+ // be painted. As a result, this test will be useless.
+ anim.currentTime = -500;
+
+ // Setting another frame does not cause any visual changes because
+ // the animation is still in the before phase.
+ anim.effect.setKeyframes({ marginLeft: [ "0px", "400px" ] });
+
+ var beforePhaseFrames = 0;
+ window.requestAnimationFrame(function handleFrame() {
+ if (anim.effect.getComputedTiming().progress === null) {
+ beforePhaseFrames++;
+ }
+ if (anim.effect.getComputedTiming().progress !== null) {
+ if (beforePhaseFrames == 0) {
+ console.log("WARNING: We never got frames in the before phase. " +
+ "This test is going to be passed accidentally. " +
+ "Consider setting smaller current time, e.g. -1000ms.");
+ }
+ // After starting the animation, progress should be 0.5, that means
+ // margin-left is 200px.
+ document.documentElement.classList.remove("reftest-wait");
+ return;
+ }
+ window.requestAnimationFrame(handleFrame);
+ });
+ });
+</script>
+</body>
+</html>