summaryrefslogtreecommitdiffstats
path: root/layout/reftests/svg/smil/timed
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 17:32:43 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 17:32:43 +0000
commit6bf0a5cb5034a7e684dcc3500e841785237ce2dd (patch)
treea68f146d7fa01f0134297619fbe7e33db084e0aa /layout/reftests/svg/smil/timed
parentInitial commit. (diff)
downloadthunderbird-upstream.tar.xz
thunderbird-upstream.zip
Adding upstream version 1:115.7.0.upstream/1%115.7.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'layout/reftests/svg/smil/timed')
-rw-r--r--layout/reftests/svg/smil/timed/appendChild-1a-ref.svg8
-rw-r--r--layout/reftests/svg/smil/timed/appendChild-1a.svg30
-rw-r--r--layout/reftests/svg/smil/timed/appendChild-1b-ref.svg6
-rw-r--r--layout/reftests/svg/smil/timed/appendChild-1b.svg29
-rw-r--r--layout/reftests/svg/smil/timed/appendChild-2a-ref.svg8
-rw-r--r--layout/reftests/svg/smil/timed/appendChild-2a.svg30
-rw-r--r--layout/reftests/svg/smil/timed/appendChild-2b-ref.svg6
-rw-r--r--layout/reftests/svg/smil/timed/appendChild-2b.svg29
-rw-r--r--layout/reftests/svg/smil/timed/paced-1-ref.svg5
-rw-r--r--layout/reftests/svg/smil/timed/paced-1.svg22
-rw-r--r--layout/reftests/svg/smil/timed/pause-1-ref.svg6
-rw-r--r--layout/reftests/svg/smil/timed/pause-1.svg38
-rw-r--r--layout/reftests/svg/smil/timed/reftest.list14
-rw-r--r--layout/reftests/svg/smil/timed/removeChild-1-ref.svg6
-rw-r--r--layout/reftests/svg/smil/timed/removeChild-1.svg28
-rw-r--r--layout/reftests/svg/smil/timed/removeChild-2-ref.svg6
-rw-r--r--layout/reftests/svg/smil/timed/removeChild-2.svg28
17 files changed, 299 insertions, 0 deletions
diff --git a/layout/reftests/svg/smil/timed/appendChild-1a-ref.svg b/layout/reftests/svg/smil/timed/appendChild-1a-ref.svg
new file mode 100644
index 0000000000..65d4170afa
--- /dev/null
+++ b/layout/reftests/svg/smil/timed/appendChild-1a-ref.svg
@@ -0,0 +1,8 @@
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+>
+ <rect id="rect1" y="40" width="10" height="10" fill="blue">
+ </rect>
+ <rect id="rect2" y="80" width="10" height="10" fill="blue">
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/timed/appendChild-1a.svg b/layout/reftests/svg/smil/timed/appendChild-1a.svg
new file mode 100644
index 0000000000..4d740087c1
--- /dev/null
+++ b/layout/reftests/svg/smil/timed/appendChild-1a.svg
@@ -0,0 +1,30 @@
+<!-- This test's animation sets x=100 from 1sec to 1.5sec. We'll
+ remove the animate element at time 1.1sec to capture this, and
+ then wait a little, and make sure the animation is frozen there. -->
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ class="reftest-wait">
+ <script>
+ function go() {
+ var rect1 = document.getElementById("rect1");
+ var rect2 = document.getElementById("rect2");
+ var anim = document.getElementById("anim");
+ rect2.appendChild(anim);
+
+ // Wait >= 1s before taking screenshot, to give animation time to finish
+ setTimeout('document.documentElement.removeAttribute("class")', 1100);
+ }
+ function delay_go() {
+ setTimeout(go, 1100);
+ }
+ document.addEventListener("MozReftestInvalidate", delay_go, false);
+ setTimeout(delay_go, 4000); // fallback for running outside reftest
+ </script>
+ <rect id="rect1" y="40" width="10" height="10" fill="blue">
+ <animate id="anim" attributeName="x"
+ dur="2s" values="0; 50; 100; 150"
+ calcMode="discrete" />
+ </rect>
+ <rect id="rect2" y="80" width="10" height="10" fill="blue">
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/timed/appendChild-1b-ref.svg b/layout/reftests/svg/smil/timed/appendChild-1b-ref.svg
new file mode 100644
index 0000000000..cee137ecc9
--- /dev/null
+++ b/layout/reftests/svg/smil/timed/appendChild-1b-ref.svg
@@ -0,0 +1,6 @@
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+>
+ <rect id="rect2" y="80" width="10" height="10" fill="blue">
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/timed/appendChild-1b.svg b/layout/reftests/svg/smil/timed/appendChild-1b.svg
new file mode 100644
index 0000000000..cedf58a8f6
--- /dev/null
+++ b/layout/reftests/svg/smil/timed/appendChild-1b.svg
@@ -0,0 +1,29 @@
+<!-- This test makes the first rect white (invisible), so that we can
+ focus just on the second rect. -->
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ class="reftest-wait">
+ <script>
+ function go() {
+ var rect1 = document.getElementById("rect1");
+ var rect2 = document.getElementById("rect2");
+ var anim = document.getElementById("anim");
+ rect2.appendChild(anim);
+
+ // Wait >= 1s before taking screenshot, to give animation time to finish
+ setTimeout('document.documentElement.removeAttribute("class")', 1100);
+ }
+ function delay_go() {
+ setTimeout(go, 1100);
+ }
+ document.addEventListener("MozReftestInvalidate", delay_go, false);
+ setTimeout(delay_go, 4000); // fallback for running outside reftest
+ </script>
+ <rect id="rect1" y="40" width="10" height="10" fill="white">
+ <animate id="anim" attributeName="x"
+ dur="2s" values="0; 50; 100; 150"
+ calcMode="discrete" />
+ </rect>
+ <rect id="rect2" y="80" width="10" height="10" fill="blue">
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/timed/appendChild-2a-ref.svg b/layout/reftests/svg/smil/timed/appendChild-2a-ref.svg
new file mode 100644
index 0000000000..db44b46a7a
--- /dev/null
+++ b/layout/reftests/svg/smil/timed/appendChild-2a-ref.svg
@@ -0,0 +1,8 @@
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+>
+ <rect id="rect1" y="40" width="10" height="10" fill="blue">
+ </rect>
+ <rect id="rect2" x="150" y="80" width="10" height="10" fill="blue">
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/timed/appendChild-2a.svg b/layout/reftests/svg/smil/timed/appendChild-2a.svg
new file mode 100644
index 0000000000..19d7c85b8d
--- /dev/null
+++ b/layout/reftests/svg/smil/timed/appendChild-2a.svg
@@ -0,0 +1,30 @@
+<!-- This test's animation sets x=100 from 1sec to 1.5sec. We'll
+ remove the animate element at time 1.1sec to capture this, and
+ then wait a little, and make sure the animation is frozen there. -->
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ class="reftest-wait">
+ <script>
+ function go() {
+ var rect1 = document.getElementById("rect1");
+ var rect2 = document.getElementById("rect2");
+ var anim = document.getElementById("anim");
+ rect2.appendChild(anim);
+
+ // Wait >= 1s before taking screenshot, to give animation time to finish
+ setTimeout('document.documentElement.removeAttribute("class")', 1100);
+ }
+ function delay_go() {
+ setTimeout(go, 1100);
+ }
+ document.addEventListener("MozReftestInvalidate", delay_go, false);
+ setTimeout(delay_go, 4000); // fallback for running outside reftest
+ </script>
+ <rect id="rect1" y="40" width="10" height="10" fill="blue">
+ <animate id="anim" attributeName="x"
+ dur="2s" values="0; 50; 100; 150"
+ calcMode="discrete" fill="freeze"/>
+ </rect>
+ <rect id="rect2" y="80" width="10" height="10" fill="blue">
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/timed/appendChild-2b-ref.svg b/layout/reftests/svg/smil/timed/appendChild-2b-ref.svg
new file mode 100644
index 0000000000..6bef89aca7
--- /dev/null
+++ b/layout/reftests/svg/smil/timed/appendChild-2b-ref.svg
@@ -0,0 +1,6 @@
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+>
+ <rect id="rect2" x="150" y="80" width="10" height="10" fill="blue">
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/timed/appendChild-2b.svg b/layout/reftests/svg/smil/timed/appendChild-2b.svg
new file mode 100644
index 0000000000..f8b772bd56
--- /dev/null
+++ b/layout/reftests/svg/smil/timed/appendChild-2b.svg
@@ -0,0 +1,29 @@
+<!-- This test makes the first rect white (invisible), so that we can
+ focus just on the second rect. -->
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ class="reftest-wait">
+ <script>
+ function go() {
+ var rect1 = document.getElementById("rect1");
+ var rect2 = document.getElementById("rect2");
+ var anim = document.getElementById("anim");
+ rect2.appendChild(anim);
+
+ // Wait >= 1s before taking screenshot, to give animation time to finish
+ setTimeout('document.documentElement.removeAttribute("class")', 1100);
+ }
+ function delay_go() {
+ setTimeout(go, 1100);
+ }
+ document.addEventListener("MozReftestInvalidate", delay_go, false);
+ setTimeout(delay_go, 4000); // fallback for running outside reftest
+ </script>
+ <rect id="rect1" y="40" width="10" height="10" fill="white">
+ <animate id="anim" attributeName="x"
+ dur="2s" values="0; 50; 100; 150"
+ calcMode="discrete" fill="freeze"/>
+ </rect>
+ <rect id="rect2" y="80" width="10" height="10" fill="blue">
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/timed/paced-1-ref.svg b/layout/reftests/svg/smil/timed/paced-1-ref.svg
new file mode 100644
index 0000000000..4a2165f26e
--- /dev/null
+++ b/layout/reftests/svg/smil/timed/paced-1-ref.svg
@@ -0,0 +1,5 @@
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+>
+ <rect height="90" width="90" fill="green"></rect>
+</svg>
diff --git a/layout/reftests/svg/smil/timed/paced-1.svg b/layout/reftests/svg/smil/timed/paced-1.svg
new file mode 100644
index 0000000000..0416e0eace
--- /dev/null
+++ b/layout/reftests/svg/smil/timed/paced-1.svg
@@ -0,0 +1,22 @@
+<!-- In paced calcmode, this animation should jump to -990 really fast,
+ despite the many small-jump values before it, leaving the canvas blank. -->
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ class="reftest-wait">
+ <script>
+ function go() {
+ document.documentElement.removeAttribute("class");
+ }
+ function delay_go() {
+ setTimeout(go, 1000);
+ }
+ document.addEventListener("MozReftestInvalidate", delay_go, false);
+ setTimeout(delay_go, 4000); // fallback for running outside reftest
+ </script>
+ <rect height="90" width="90" fill="green"></rect>
+ <rect x="40" y="40" width="10" height="10" fill="red">
+ <animate attributeName="x"
+ dur="5s" values="40; 41; 42; 43; 44; 45; 46; 47; 48; 49; 50; -950"
+ calcMode="paced" fill="freeze"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/timed/pause-1-ref.svg b/layout/reftests/svg/smil/timed/pause-1-ref.svg
new file mode 100644
index 0000000000..ef492d492b
--- /dev/null
+++ b/layout/reftests/svg/smil/timed/pause-1-ref.svg
@@ -0,0 +1,6 @@
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+>
+ <rect x="100" y="40" width="10" height="10" fill="blue">
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/timed/pause-1.svg b/layout/reftests/svg/smil/timed/pause-1.svg
new file mode 100644
index 0000000000..36101cadf0
--- /dev/null
+++ b/layout/reftests/svg/smil/timed/pause-1.svg
@@ -0,0 +1,38 @@
+<!-- This test's animation sets x=100 from 1sec to 1.5sec. We'll
+ pause the animation at time 1.1sec to capture this, and then wait
+ a little, and make sure the animation is frozen there. -->
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ class="reftest-wait">
+ <script>
+ function go() {
+ // Use try/catch, so that we make sure to remove the reftest-wait
+ // attribute even on older browser versions that don't support
+ // pauseAnimations.
+ try {
+ document.documentElement.pauseAnimations();
+ } catch (e) {
+ // pauseAnimations not implemented. Change rect to red,
+ // and clear class to fail/end immediately.
+ document.documentElement.removeAttribute("class");
+ var rect = document.getElementById("rect");
+ rect.setAttributeNS(null, "fill", "red");
+ throw e;
+ }
+
+ // Wait > 0.5s before taking screenshot, to give animation time to
+ // jump to next value if the freeze didn't work.
+ setTimeout('document.documentElement.removeAttribute("class")', 600);
+ }
+ function delay_go() {
+ setTimeout(go, 1100);
+ }
+ document.addEventListener("MozReftestInvalidate", delay_go, false);
+ setTimeout(delay_go, 4000); // fallback for running outside reftest
+ </script>
+ <rect y="40" width="10" height="10" fill="blue">
+ <animate id="rect" attributeName="x"
+ dur="3s" values="0; 50; 100; 150; 200; 250"
+ calcMode="discrete" fill="freeze"/>
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/timed/reftest.list b/layout/reftests/svg/smil/timed/reftest.list
new file mode 100644
index 0000000000..600a690d9b
--- /dev/null
+++ b/layout/reftests/svg/smil/timed/reftest.list
@@ -0,0 +1,14 @@
+# Tests related to SVG Animation that use timeouts to interrupt, modify,
+# and examine animations.
+#
+# NOTE: Most of these tests require a few seconds to run.
+# (That's longer than most other reftests)
+
+== paced-1.svg paced-1-ref.svg
+== pause-1.svg pause-1-ref.svg
+fails == removeChild-1.svg removeChild-1-ref.svg # rect needs to reset
+fails == removeChild-2.svg removeChild-2-ref.svg # rect needs to reset
+fails == appendChild-1a.svg appendChild-1a-ref.svg # first rect needs to reset
+== appendChild-1b.svg appendChild-1b-ref.svg
+fails == appendChild-2a.svg appendChild-2a-ref.svg # first rect needs to reset
+== appendChild-2b.svg appendChild-2b-ref.svg
diff --git a/layout/reftests/svg/smil/timed/removeChild-1-ref.svg b/layout/reftests/svg/smil/timed/removeChild-1-ref.svg
new file mode 100644
index 0000000000..a1bbb50933
--- /dev/null
+++ b/layout/reftests/svg/smil/timed/removeChild-1-ref.svg
@@ -0,0 +1,6 @@
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+>
+ <rect id="rect1" y="40" width="10" height="10" fill="blue">
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/timed/removeChild-1.svg b/layout/reftests/svg/smil/timed/removeChild-1.svg
new file mode 100644
index 0000000000..905373d710
--- /dev/null
+++ b/layout/reftests/svg/smil/timed/removeChild-1.svg
@@ -0,0 +1,28 @@
+<!-- This test's animation sets x=100 from 1sec to 1.5sec. We'll
+ remove the animate element at time 1.1sec, give it a little more
+ time, and see what happens. -->
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ class="reftest-wait">
+ <script>
+ function go() {
+ var rect1 = document.getElementById("rect1");
+ var anim = document.getElementById("anim");
+ rect1.removeChild(anim);
+
+ // Wait > 0.5s before taking screenshot, to give animation time to
+ // finish, if it's still going
+ setTimeout('document.documentElement.removeAttribute("class")', 700);
+ }
+ function delay_go() {
+ setTimeout(go, 1100);
+ }
+ document.addEventListener("MozReftestInvalidate", delay_go, false);
+ setTimeout(delay_go, 4000); // fallback for running outside reftest
+ </script>
+ <rect id="rect1" y="40" width="10" height="10" fill="blue">
+ <animate id="anim" attributeName="x"
+ dur="2s" values="0; 50; 100; 150"
+ calcMode="discrete" />
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/timed/removeChild-2-ref.svg b/layout/reftests/svg/smil/timed/removeChild-2-ref.svg
new file mode 100644
index 0000000000..a1bbb50933
--- /dev/null
+++ b/layout/reftests/svg/smil/timed/removeChild-2-ref.svg
@@ -0,0 +1,6 @@
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+>
+ <rect id="rect1" y="40" width="10" height="10" fill="blue">
+ </rect>
+</svg>
diff --git a/layout/reftests/svg/smil/timed/removeChild-2.svg b/layout/reftests/svg/smil/timed/removeChild-2.svg
new file mode 100644
index 0000000000..ba07abc2af
--- /dev/null
+++ b/layout/reftests/svg/smil/timed/removeChild-2.svg
@@ -0,0 +1,28 @@
+<!-- This test's animation sets x=100 from 1sec to 1.5sec. We'll
+ remove the animate element at time 1.1sec, give it a little more
+ time, and see what happens. -->
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ class="reftest-wait">
+ <script>
+ function go() {
+ var rect1 = document.getElementById("rect1");
+ var anim = document.getElementById("anim");
+ rect1.removeChild(anim);
+
+ // Wait > 0.5s before taking screenshot, to give animation time to
+ // finish, if it's still going
+ setTimeout('document.documentElement.removeAttribute("class")', 700);
+ }
+ function delay_go() {
+ setTimeout(go, 1100);
+ }
+ document.addEventListener("MozReftestInvalidate", delay_go, false);
+ setTimeout(delay_go, 4000); // fallback for running outside reftest
+ </script>
+ <rect id="rect1" y="40" width="10" height="10" fill="blue">
+ <animate id="anim" attributeName="x"
+ dur="2s" values="0; 50; 100; 150"
+ calcMode="discrete" fill="freeze" />
+ </rect>
+</svg>