Bug 1223658 - Part 7: Reftests for checking stacking context when changing keyframe and target directly in delay phase. r?birtles
MozReview-Commit-ID: 5skSGbo7qp2
--- a/layout/reftests/web-animations/reftest.list
+++ b/layout/reftests/web-animations/reftest.list
@@ -1,16 +1,20 @@
test-pref(dom.animations-api.core.enabled,true) == 1246046-1.html green-box.html
test-pref(dom.animations-api.core.enabled,true) == 1267937-1.html 1267937-ref.html
test-pref(dom.animations-api.core.enabled,true) == 1298742-1.html 1298742-ref.html
test-pref(dom.animations-api.core.enabled,true) == stacking-context-transform-none-animation-before-appending-element.html stacking-context-animation-ref.html
test-pref(dom.animations-api.core.enabled,true) == stacking-context-opacity-changing-keyframe.html stacking-context-animation-ref.html
+test-pref(dom.animations-api.core.enabled,true) == stacking-context-opacity-changing-keyframe-in-delay.html stacking-context-animation-ref.html
test-pref(dom.animations-api.core.enabled,true) == stacking-context-opacity-changing-target.html stacking-context-animation-changing-target-ref.html
+test-pref(dom.animations-api.core.enabled,true) == stacking-context-opacity-changing-target-in-delay.html stacking-context-animation-changing-target-ref.html
test-pref(dom.animations-api.core.enabled,true) == stacking-context-opacity-changing-effect.html stacking-context-animation-ref.html
test-pref(dom.animations-api.core.enabled,true) == stacking-context-opacity-losing-css-animation-in-delay.html stacking-context-animation-ref.html
test-pref(dom.animations-api.core.enabled,true) == stacking-context-transform-changing-keyframe.html stacking-context-animation-ref.html
+test-pref(dom.animations-api.core.enabled,true) == stacking-context-transform-changing-keyframe-in-delay.html stacking-context-animation-ref.html
test-pref(dom.animations-api.core.enabled,true) == stacking-context-transform-changing-target.html stacking-context-animation-changing-target-ref.html
+test-pref(dom.animations-api.core.enabled,true) == stacking-context-transform-changing-target-in-delay.html stacking-context-animation-changing-target-ref.html
test-pref(dom.animations-api.core.enabled,true) == stacking-context-transform-changing-effect.html stacking-context-animation-ref.html
test-pref(dom.animations-api.core.enabled,true) == stacking-context-transform-changing-display-property.html stacking-context-animation-ref.html
test-pref(dom.animations-api.core.enabled,true) == stacking-context-transform-losing-css-animation-in-delay.html stacking-context-animation-ref.html
test-pref(dom.animations-api.core.enabled,true) == style-updates-on-iteration-composition-changed-from-accumulate-to-replace.html style-updates-for-iteration-composite-ref.html
test-pref(dom.animations-api.core.enabled,true) == style-updates-on-iteration-composition-changed-from-replace-to-accumulate.html style-updates-for-iteration-composite-ref.html
test-pref(dom.animations-api.core.enabled,true) == style-updates-on-current-iteration-changed.html style-updates-for-iteration-composite-ref.html
new file mode 100644
--- /dev/null
+++ b/layout/reftests/web-animations/stacking-context-opacity-changing-keyframe-in-delay.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+<title>
+Changing keyframes to opacity frames creates a stacking context even if the
+animation is delay phase
+</title>
+<style>
+span {
+ height: 100px;
+ width: 100px;
+ position: fixed;
+ background: green;
+ top: 50px;
+}
+#test {
+ width: 100px; height: 100px;
+ background: blue;
+}
+</style>
+<span></span>
+<div id="test"></div>
+<script>
+ var anim = document.getElementById("test")
+ .animate({ width: ['100px', '100px'] },
+ { delay: 100000, duration: 100000 });
+ anim.ready.then(function() {
+ anim.effect.setKeyframes({ opacity: [0, 1] });
+ requestAnimationFrame(function() {
+ document.documentElement.classList.remove("reftest-wait");
+ });
+ });
+</script>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/web-animations/stacking-context-opacity-changing-target-in-delay.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+<title>
+Changing target to an element that does not override opacity animations
+creates a stacking context even if the animation is delay phase
+</title>
+<style>
+span {
+ height: 100px;
+ width: 100px;
+ position: fixed;
+ background: green;
+ top: 50px;
+}
+#first {
+ width: 100px; height: 100px;
+ background: blue;
+ opacity: 1 ! important;
+}
+#second {
+ width: 100px; height: 100px;
+ background: blue;
+}
+</style>
+<span></span>
+<div id="first"></div>
+<div id="second"></div>
+<script>
+ var anim = document.getElementById("first")
+ .animate({ opacity: [0, 1] },
+ { delay: 100000, duration: 100000 });
+ anim.ready.then(function() {
+ anim.effect.target = document.getElementById("second");
+ requestAnimationFrame(function() {
+ document.documentElement.classList.remove("reftest-wait");
+ });
+ });
+</script>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/web-animations/stacking-context-transform-changing-keyframe-in-delay.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+<title>
+Changing keyframes to transform frames creates a stacking context even if the
+animation is delay phase
+</title>
+<style>
+span {
+ height: 100px;
+ width: 100px;
+ position: fixed;
+ background: green;
+ top: 50px;
+}
+#test {
+ width: 100px; height: 100px;
+ background: blue;
+}
+</style>
+<span></span>
+<div id="test"></div>
+<script>
+ var anim = document.getElementById("test")
+ .animate({ width: ['100px', '100px'] },
+ { delay: 100000, duration: 100000 });
+ anim.ready.then(function() {
+ anim.effect.setKeyframes(
+ { transform: ['translate(0px)', 'translate(0px)'] });
+ requestAnimationFrame(function() {
+ document.documentElement.classList.remove("reftest-wait");
+ });
+ });
+</script>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/web-animations/stacking-context-transform-changing-target-in-delay.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+<title>
+Changing target to an element that does not overrider transform animations
+creates a stacking context even if the animation is delay phase
+</title>
+<style>
+span {
+ height: 100px;
+ width: 100px;
+ position: fixed;
+ background: green;
+ top: 50px;
+}
+#first {
+ width: 100px; height: 100px;
+ background: blue;
+ transform: none ! important;
+}
+#second {
+ width: 100px; height: 100px;
+ background: blue;
+}
+</style>
+<span></span>
+<div id="first"></div>
+<div id="second"></div>
+<script>
+ var anim = document.getElementById("first")
+ .animate({ transform: ['translateX(0px)', 'translateX(100px)'] },
+ { delay: 100000, duration: 100000 });
+ anim.ready.then(function() {
+ anim.effect.target = document.getElementById("second");
+ requestAnimationFrame(function() {
+ document.documentElement.classList.remove("reftest-wait");
+ });
+ });
+</script>