diff options
Diffstat (limited to 'layout/reftests/svg/smil/seek')
19 files changed, 396 insertions, 0 deletions
diff --git a/layout/reftests/svg/smil/seek/anim-standard-ref.svg b/layout/reftests/svg/smil/seek/anim-standard-ref.svg new file mode 100644 index 0000000000..39f37ae6d1 --- /dev/null +++ b/layout/reftests/svg/smil/seek/anim-standard-ref.svg @@ -0,0 +1,3 @@ +<svg xmlns="http://www.w3.org/2000/svg"> + <rect x="15" y="15" width="200" height="200" fill="blue"/> +</svg> diff --git a/layout/reftests/svg/smil/seek/anim-standard-ref.xhtml b/layout/reftests/svg/smil/seek/anim-standard-ref.xhtml new file mode 100644 index 0000000000..a50c83bd0e --- /dev/null +++ b/layout/reftests/svg/smil/seek/anim-standard-ref.xhtml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<html xmlns="http://www.w3.org/1999/xhtml"> +<body> +<svg xmlns="http://www.w3.org/2000/svg" width="230px" height="230px"> + <rect x="15" y="15" width="200" height="200" fill="blue"/> +</svg> +</body> +</html> diff --git a/layout/reftests/svg/smil/seek/anim-x-seek-1a.svg b/layout/reftests/svg/smil/seek/anim-x-seek-1a.svg new file mode 100644 index 0000000000..76c4f098ab --- /dev/null +++ b/layout/reftests/svg/smil/seek/anim-x-seek-1a.svg @@ -0,0 +1,18 @@ +<svg xmlns="http://www.w3.org/2000/svg" + class="reftest-wait" + onload="go()"> + <script type="text/javascript"> + function go() { + // Pause, seek to middle of animation, and then seek to exactly 1 duration + // before the animation begins (to make sure animation effects are cleared) + var svg = document.documentElement; + svg.pauseAnimations(); + svg.setCurrentTime(3); + svg.setCurrentTime(0); + svg.removeAttribute("class"); + } + </script> + <rect x="15" y="15" width="200" height="200" fill="blue"> + <set attributeName="x" to="100" begin="2s" dur="2s"/> + </rect> +</svg> diff --git a/layout/reftests/svg/smil/seek/anim-x-seek-1b.svg b/layout/reftests/svg/smil/seek/anim-x-seek-1b.svg new file mode 100644 index 0000000000..76c4f098ab --- /dev/null +++ b/layout/reftests/svg/smil/seek/anim-x-seek-1b.svg @@ -0,0 +1,18 @@ +<svg xmlns="http://www.w3.org/2000/svg" + class="reftest-wait" + onload="go()"> + <script type="text/javascript"> + function go() { + // Pause, seek to middle of animation, and then seek to exactly 1 duration + // before the animation begins (to make sure animation effects are cleared) + var svg = document.documentElement; + svg.pauseAnimations(); + svg.setCurrentTime(3); + svg.setCurrentTime(0); + svg.removeAttribute("class"); + } + </script> + <rect x="15" y="15" width="200" height="200" fill="blue"> + <set attributeName="x" to="100" begin="2s" dur="2s"/> + </rect> +</svg> diff --git a/layout/reftests/svg/smil/seek/anim-x-seek-1c.svg b/layout/reftests/svg/smil/seek/anim-x-seek-1c.svg new file mode 100644 index 0000000000..95fd19bb4b --- /dev/null +++ b/layout/reftests/svg/smil/seek/anim-x-seek-1c.svg @@ -0,0 +1,18 @@ +<svg xmlns="http://www.w3.org/2000/svg" + class="reftest-wait" + onload="go()"> + <script type="text/javascript"> + function go() { + // Pause, seek to middle of animation, and then seek to the exact ending + // of the animation (to make sure animation effects are cleared) + var svg = document.documentElement; + svg.pauseAnimations(); + svg.setCurrentTime(3); + svg.setCurrentTime(4); + svg.removeAttribute("class"); + } + </script> + <rect x="15" y="15" width="200" height="200" fill="blue"> + <set attributeName="x" to="100" begin="2s" dur="2s"/> + </rect> +</svg> diff --git a/layout/reftests/svg/smil/seek/anim-x-seek-1d.svg b/layout/reftests/svg/smil/seek/anim-x-seek-1d.svg new file mode 100644 index 0000000000..bb0edc7474 --- /dev/null +++ b/layout/reftests/svg/smil/seek/anim-x-seek-1d.svg @@ -0,0 +1,18 @@ +<svg xmlns="http://www.w3.org/2000/svg" + class="reftest-wait" + onload="go()"> + <script type="text/javascript"> + function go() { + // Pause, seek to middle of animation, and then seek to a time after + // the animation is over (to make sure animation effects are cleared) + var svg = document.documentElement; + svg.pauseAnimations(); + svg.setCurrentTime(3); + svg.setCurrentTime(5); + svg.removeAttribute("class"); + } + </script> + <rect x="15" y="15" width="200" height="200" fill="blue"> + <set attributeName="x" to="100" begin="2s" dur="2s"/> + </rect> +</svg> diff --git a/layout/reftests/svg/smil/seek/anim-x-seek-1e.svg b/layout/reftests/svg/smil/seek/anim-x-seek-1e.svg new file mode 100644 index 0000000000..b8175fb4cd --- /dev/null +++ b/layout/reftests/svg/smil/seek/anim-x-seek-1e.svg @@ -0,0 +1,17 @@ +<svg xmlns="http://www.w3.org/2000/svg" + class="reftest-wait" + onload="go()"> + <script type="text/javascript"> + function go() { + // Test a backwards seek covering many intervals + var svg = document.documentElement; + svg.pauseAnimations(); + svg.setCurrentTime(15); + svg.setCurrentTime(3.5); + svg.removeAttribute("class"); + } + </script> + <rect x="100" y="15" width="200" height="200" fill="blue"> + <set attributeName="x" to="15" begin="1s; 3s; 5s; 7s; 9s; 11s" dur="1s"/> + </rect> +</svg> diff --git a/layout/reftests/svg/smil/seek/anim-x-seek-cross-container-1a.xhtml b/layout/reftests/svg/smil/seek/anim-x-seek-cross-container-1a.xhtml new file mode 100644 index 0000000000..4e7cc65222 --- /dev/null +++ b/layout/reftests/svg/smil/seek/anim-x-seek-cross-container-1a.xhtml @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<html xmlns="http://www.w3.org/1999/xhtml" class="reftest-wait"> +<!-- + Test backwards seeking with cross-time container dependencies. + --> +<head> +<script> +function snapshot() +{ + var a = document.getElementById("svg-a"); + var b = document.getElementById("svg-b"); + a.pauseAnimations(); + b.pauseAnimations(); + a.setCurrentTime(0); + b.setCurrentTime(2); // 'b' has now begun and 'a' has a begin time of '-1s' in + // a's container time + b.setCurrentTime(1); // Perform a backwards seek--'a' should now have a begin + // time of '0s' in container time + a.setCurrentTime(1); // So seeking forward 1s should get us to the middle of + // the interval + document.documentElement.removeAttribute("class"); +} +</script> +</head> +<body onload="snapshot()"> +<svg xmlns="http://www.w3.org/2000/svg" width="230px" height="230px" id="svg-a"> + <rect x="100" y="15" width="200" height="200" fill="blue"> + <animate attributeName="x" from="0" to="30" begin="b.begin" dur="2s"/> + </rect> +</svg> +<svg xmlns="http://www.w3.org/2000/svg" width="230px" height="230px" id="svg-b"> + <set attributeName="y" to="0" begin="1s" id="b"/> +</svg> +</body> +</html> diff --git a/layout/reftests/svg/smil/seek/anim-x-seek-dynamic-1a.svg b/layout/reftests/svg/smil/seek/anim-x-seek-dynamic-1a.svg new file mode 100644 index 0000000000..75a782ab52 --- /dev/null +++ b/layout/reftests/svg/smil/seek/anim-x-seek-dynamic-1a.svg @@ -0,0 +1,20 @@ +<svg xmlns="http://www.w3.org/2000/svg" + class="reftest-wait" + onload="go()"> + <script type="text/javascript"> + function go() { + // Perform a backwards seek within an interval whose begin point is + // generated by a dynamic event (to make sure such times are preserved when + // we rewind). + var svg = document.documentElement; + svg.pauseAnimations(); + document.getElementById('a').beginElementAt(2); + svg.setCurrentTime(3); + svg.setCurrentTime(2.5); + svg.removeAttribute("class"); + } + </script> + <rect x="100" y="15" width="200" height="200" fill="blue"> + <set attributeName="x" to="15" begin="indefinite" dur="2s" id="a"/> + </rect> +</svg> diff --git a/layout/reftests/svg/smil/seek/anim-x-seek-dynamic-1b.svg b/layout/reftests/svg/smil/seek/anim-x-seek-dynamic-1b.svg new file mode 100644 index 0000000000..e17b49edf2 --- /dev/null +++ b/layout/reftests/svg/smil/seek/anim-x-seek-dynamic-1b.svg @@ -0,0 +1,19 @@ +<svg xmlns="http://www.w3.org/2000/svg" + class="reftest-wait" + onload="go()"> + <script type="text/javascript"> + function go() { + // Check that dynamic end times are preserved during a backwards seek + var svg = document.documentElement; + svg.pauseAnimations(); + svg.setCurrentTime(3); + document.getElementById('a').endElement(); + svg.setCurrentTime(4); + svg.setCurrentTime(3); + svg.removeAttribute("class"); + } + </script> + <rect x="15" y="15" width="200" height="200" fill="blue"> + <set attributeName="x" to="100" begin="2s" dur="2s" id="a"/> + </rect> +</svg> diff --git a/layout/reftests/svg/smil/seek/anim-x-seek-dynamic-1c.svg b/layout/reftests/svg/smil/seek/anim-x-seek-dynamic-1c.svg new file mode 100644 index 0000000000..0a015bf4b3 --- /dev/null +++ b/layout/reftests/svg/smil/seek/anim-x-seek-dynamic-1c.svg @@ -0,0 +1,31 @@ +<svg xmlns="http://www.w3.org/2000/svg" + class="reftest-wait" + onload="go()"> + <script type="text/javascript"> + function go() { + // Check that dynamic times are preserved even from filtering + var svg = document.documentElement; + var a = document.getElementById('a'); + svg.pauseAnimations(); + // Generate a series of intervals with dynamic begin points + svg.setCurrentTime(1); + a.beginElement(); + svg.setCurrentTime(3); + a.beginElement(); + svg.setCurrentTime(5); + a.beginElement(); + svg.setCurrentTime(7); + a.beginElement(); + svg.setCurrentTime(9); + a.beginElement(); + svg.setCurrentTime(11); + // By now, the first interval will have been filtered but test that we have + // preserved the instance time in order to reconstruct it + svg.setCurrentTime(1.5); + svg.removeAttribute("class"); + } + </script> + <rect x="100" y="15" width="200" height="200" fill="blue"> + <set attributeName="x" to="15" begin="indefinite" dur="1s" id="a"/> + </rect> +</svg> diff --git a/layout/reftests/svg/smil/seek/anim-x-seek-dynamic-1d.svg b/layout/reftests/svg/smil/seek/anim-x-seek-dynamic-1d.svg new file mode 100644 index 0000000000..e02ecd9ff9 --- /dev/null +++ b/layout/reftests/svg/smil/seek/anim-x-seek-dynamic-1d.svg @@ -0,0 +1,30 @@ +<svg xmlns="http://www.w3.org/2000/svg" + class="reftest-wait" + onload="go()"> + <script type="text/javascript"> + function go() { + // Check that whilst processing past intervals reset does not clear dynamic + // instance times of future intervals + var svg = document.documentElement; + var a = document.getElementById('a'); + svg.pauseAnimations(); + // Generate a series of intervals with dynamic begin points + svg.setCurrentTime(1); + a.beginElement(); + svg.setCurrentTime(3); + a.beginElement(); + svg.setCurrentTime(5); + a.beginElement(); + svg.setCurrentTime(7); + a.beginElement(); + svg.setCurrentTime(5.5); // Backwards seek will cause us to rebuild the + // world but in the process we should not clear the + // dynamic instance times for future intervals on + // each restart + svg.removeAttribute("class"); + } + </script> + <rect x="100" y="15" width="200" height="200" fill="blue"> + <set attributeName="x" to="15" begin="indefinite" dur="1s" id="a"/> + </rect> +</svg> diff --git a/layout/reftests/svg/smil/seek/anim-x-seek-dynamic-1e.svg b/layout/reftests/svg/smil/seek/anim-x-seek-dynamic-1e.svg new file mode 100644 index 0000000000..87743e9dd6 --- /dev/null +++ b/layout/reftests/svg/smil/seek/anim-x-seek-dynamic-1e.svg @@ -0,0 +1,23 @@ +<svg xmlns="http://www.w3.org/2000/svg" + class="reftest-wait" + onload="go()"> + <script type="text/javascript"> + function go() { + // Check that dynamic times are reset during a forwards seek + var svg = document.documentElement; + var a = document.getElementById('a'); + svg.pauseAnimations(); + svg.setCurrentTime(1); // First interval 1s-2s + a.beginElement(); + svg.setCurrentTime(2); + a.beginElementAt(1); // Add instance time t=3s + a.beginElementAt(3); // Add instance time t=5s -- should be cleared during + // the seek when we process the restart at t=3s + svg.setCurrentTime(5); // Hence at t=5s we should be inactive + svg.removeAttribute("class"); + } + </script> + <rect x="15" y="15" width="200" height="200" fill="blue"> + <set attributeName="x" to="100" begin="indefinite" dur="1s" id="a"/> + </rect> +</svg> diff --git a/layout/reftests/svg/smil/seek/anim-x-seek-dynamic-1f.svg b/layout/reftests/svg/smil/seek/anim-x-seek-dynamic-1f.svg new file mode 100644 index 0000000000..9164c2ca6a --- /dev/null +++ b/layout/reftests/svg/smil/seek/anim-x-seek-dynamic-1f.svg @@ -0,0 +1,30 @@ +<svg xmlns="http://www.w3.org/2000/svg" + class="reftest-wait" + onload="go()"> + <script type="text/javascript"> + function go() { + // Check that dynamic times are reset during a backwards seek + var svg = document.documentElement; + var a = document.getElementById('a'); + svg.pauseAnimations(); + svg.setCurrentTime(1); + a.beginElement(); // First interval: 1s-2s + a.endElementAt(1); + a.beginElementAt(2); // Second interval: 3s-indef + svg.setCurrentTime(5); + a.endElementAt(1); // Add end time at 6s + svg.setCurrentTime(4); // Perform backwards seek from 5s->4s + svg.setCurrentTime(6); // End time at 6s should have been cleared + // and we should still be active + // (See SMIL 3.0, 'Hyperlinks and timing' which has: + // Resolved end times associated with events, + // Repeat-values, Accesskey-values or added via DOM + // method calls are cleared when seeking to time + // earlier than the resolved end time. + svg.removeAttribute("class"); + } + </script> + <rect x="100" y="15" width="200" height="200" fill="blue"> + <set attributeName="x" to="15" begin="indefinite" dur="indefinite" id="a"/> + </rect> +</svg> diff --git a/layout/reftests/svg/smil/seek/anim-x-seek-dynamic-1g.svg b/layout/reftests/svg/smil/seek/anim-x-seek-dynamic-1g.svg new file mode 100644 index 0000000000..43a0d4e907 --- /dev/null +++ b/layout/reftests/svg/smil/seek/anim-x-seek-dynamic-1g.svg @@ -0,0 +1,23 @@ +<svg xmlns="http://www.w3.org/2000/svg" + class="reftest-wait" + onload="go()"> + <script type="text/javascript"> + function go() { + // Check that dynamic interval end times are reset during a backwards seek + var svg = document.documentElement; + var a = document.getElementById('a'); + svg.pauseAnimations(); + svg.setCurrentTime(1); + a.beginElement(); // First interval 1s-2s + a.endElementAt(1); + svg.setCurrentTime(3); + svg.setCurrentTime(1.5); // Backwards seek to 1.5s -- instance time at t=2s + // should be reset + svg.setCurrentTime(3); // Should still be active + svg.removeAttribute("class"); + } + </script> + <rect x="100" y="15" width="200" height="200" fill="blue"> + <set attributeName="x" to="15" begin="indefinite" dur="indefinite" id="a"/> + </rect> +</svg> diff --git a/layout/reftests/svg/smil/seek/anim-x-seek-dynamic-1h.svg b/layout/reftests/svg/smil/seek/anim-x-seek-dynamic-1h.svg new file mode 100644 index 0000000000..a00cefdf48 --- /dev/null +++ b/layout/reftests/svg/smil/seek/anim-x-seek-dynamic-1h.svg @@ -0,0 +1,21 @@ +<svg xmlns="http://www.w3.org/2000/svg" + class="reftest-wait" + onload="go()"> + <script type="text/javascript"> + function go() { + // Check that dynamic times are not prematurely reset during a forwards seek + var svg = document.documentElement; + var a = document.getElementById('a'); + svg.pauseAnimations(); + svg.setCurrentTime(1); + a.beginElement(); // Interval: 1s-3s + a.endElementAt(2); + svg.setCurrentTime(2); // Should not cause end time at t=3s to be reset + svg.setCurrentTime(3); // Should no longer be active + svg.removeAttribute("class"); + } + </script> + <rect x="15" y="15" width="200" height="200" fill="blue"> + <set attributeName="x" to="100" begin="indefinite" dur="indefinite" id="a"/> + </rect> +</svg> diff --git a/layout/reftests/svg/smil/seek/anim-x-seek-dynamic-1i.svg b/layout/reftests/svg/smil/seek/anim-x-seek-dynamic-1i.svg new file mode 100644 index 0000000000..9f19eefcd6 --- /dev/null +++ b/layout/reftests/svg/smil/seek/anim-x-seek-dynamic-1i.svg @@ -0,0 +1,31 @@ +<svg xmlns="http://www.w3.org/2000/svg" + class="reftest-wait" + onload="go()"> + <script type="text/javascript"> + function go() { + // Check that past dynamic times are still preserved after a backwards seek. + // (The converse, that now-future dynamic times are reset during a backwards + // seek is covered by anim-x-seek-dynamic-1g.svg) + var svg = document.documentElement; + var a = document.getElementById('a'); + svg.pauseAnimations(); + // Generate a series of intervals with dynamic begin points + svg.setCurrentTime(1); + a.beginElement(); + svg.setCurrentTime(3); + a.beginElement(); + svg.setCurrentTime(5); + a.beginElement(); + svg.setCurrentTime(7); + a.beginElement(); + svg.setCurrentTime(5); // Backwards seek (1) -- at this point we'll do + // a reset but old dynamic times (e.g. t=1s) should + // be preserved + svg.setCurrentTime(1); // Backwards seek (2) + svg.removeAttribute("class"); + } + </script> + <rect x="100" y="15" width="200" height="200" fill="blue"> + <set attributeName="x" to="15" begin="indefinite" dur="1s" id="a"/> + </rect> +</svg> diff --git a/layout/reftests/svg/smil/seek/anim-x-seek-negative-1a.svg b/layout/reftests/svg/smil/seek/anim-x-seek-negative-1a.svg new file mode 100644 index 0000000000..5e04739a0e --- /dev/null +++ b/layout/reftests/svg/smil/seek/anim-x-seek-negative-1a.svg @@ -0,0 +1,16 @@ +<svg xmlns="http://www.w3.org/2000/svg" + class="reftest-wait" + onload="go()"> + <script type="text/javascript"> + function go() { + // A negative seek should be clamped to 0 + var svg = document.documentElement; + svg.pauseAnimations(); + svg.setCurrentTime(-1); + svg.removeAttribute("class"); + } + </script> + <rect x="100" y="15" width="200" height="200" fill="blue"> + <animate attributeName="x" from="0" to="30" begin="-1s" dur="2s"/> + </rect> +</svg> diff --git a/layout/reftests/svg/smil/seek/reftest.list b/layout/reftests/svg/smil/seek/reftest.list new file mode 100644 index 0000000000..28e055885e --- /dev/null +++ b/layout/reftests/svg/smil/seek/reftest.list @@ -0,0 +1,17 @@ +# Tests for seeking behaviour +== anim-x-seek-1a.svg anim-standard-ref.svg +== anim-x-seek-1b.svg anim-standard-ref.svg +== anim-x-seek-1c.svg anim-standard-ref.svg +== anim-x-seek-1d.svg anim-standard-ref.svg +== anim-x-seek-1e.svg anim-standard-ref.svg +== anim-x-seek-dynamic-1a.svg anim-standard-ref.svg +== anim-x-seek-dynamic-1b.svg anim-standard-ref.svg +== anim-x-seek-dynamic-1c.svg anim-standard-ref.svg +== anim-x-seek-dynamic-1d.svg anim-standard-ref.svg +== anim-x-seek-dynamic-1e.svg anim-standard-ref.svg +== anim-x-seek-dynamic-1f.svg anim-standard-ref.svg +== anim-x-seek-dynamic-1g.svg anim-standard-ref.svg +== anim-x-seek-dynamic-1h.svg anim-standard-ref.svg +== anim-x-seek-dynamic-1i.svg anim-standard-ref.svg +== anim-x-seek-negative-1a.svg anim-standard-ref.svg +== anim-x-seek-cross-container-1a.xhtml anim-standard-ref.xhtml |