| 1 |
<svg version="1.1" baseProfile="tiny" id="svg-root" |
| 2 |
width="100%" height="100%" viewBox="0 0 480 360" |
| 3 |
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> |
| 4 |
<!--======================================================================--> |
| 5 |
<!--= SVG 1.1 2nd Edition Test Case =--> |
| 6 |
<!--======================================================================--> |
| 7 |
<!--= Copyright 2009 World Wide Web Consortium, (Massachusetts =--> |
| 8 |
<!--= Institute of Technology, European Research Consortium for =--> |
| 9 |
<!--= Informatics and Mathematics (ERCIM), Keio University). =--> |
| 10 |
<!--= All Rights Reserved. =--> |
| 11 |
<!--= See http://www.w3.org/Consortium/Legal/. =--> |
| 12 |
<!--======================================================================--> |
| 13 |
<d:SVGTestCase xmlns:d="http://www.w3.org/2000/02/svg/testsuite/description/" |
| 14 |
template-version="1.4" reviewer="CN" author="VH" status="accepted" |
| 15 |
version="$Revision: 1.6 $" testname="$RCSfile: animate-elem-67-t.svg,v $"> |
| 16 |
<d:testDescription xmlns="http://www.w3.org/1999/xhtml" href="http://www.w3.org/TR/SVG11/animate.html#Animation"> |
| 17 |
<p> |
| 18 |
This tests performs basic tests on restart attribute. |
| 19 |
</p> |
| 20 |
<p> |
| 21 |
Each row in the test shows different rectangles subject to <set> |
| 22 |
animations with different configurations with regards to the restart |
| 23 |
attribute. For each row, the animation should be active |
| 24 |
during the first 5 seconds of the animations where the red rectangle |
| 25 |
should show in the right column. At five seconds into the animation, |
| 26 |
all the rectangles should move to their left position. |
| 27 |
</p> |
| 28 |
<p> |
| 29 |
On the first row, the <set> animation has a begin attribute set to |
| 30 |
'0s;1s' and a dur attribute set to 4s. This should result in a first |
| 31 |
interval of (0s <= t < 4s) which should be superceeded, at 1s, by a new interval |
| 32 |
of (1s <= t < 5s) because the default restart behavior is 'always'. |
| 33 |
Consequently, the rectangle should be in the right position during the |
| 34 |
(0s <= t < 5s) interval and move to the left position at 5s. |
| 35 |
</p> |
| 36 |
<p> |
| 37 |
On the second row, the <set> animation has a begin attribute set to |
| 38 |
'0s;1s', a dur attribute set to 4s and a restart attribute set to always. |
| 39 |
The behavior should be the same as for the first row. |
| 40 |
</p> |
| 41 |
<p> |
| 42 |
On the third row, the first (left most) rectangle's <set> animation |
| 43 |
has a begin attribute set to '0s;1s', a dur set to 5s and a restart attribute |
| 44 |
set to whenNotActive. Because of the rules for computing intervals, the |
| 45 |
animation's interval is (0s <= t < 5s) and is not superseded by a (1s <= t < 6s) interval |
| 46 |
because of the restart value. |
| 47 |
|
| 48 |
The second (right most) red rectangle's <set> animation has a begin |
| 49 |
attribute set to '0s;2.5s' and a dur attribute set to 2.5s. This results in |
| 50 |
a first interval (0s <= t < 2.5s) which is followed by a (2.5s <= t < 5s) interval. Consequently, |
| 51 |
the rectangle stays on its right position for the first five seconds before it definitively |
| 52 |
moves to the left position. |
| 53 |
</p> |
| 54 |
<p> |
| 55 |
On the fourth row, the <set> animation has a begin attribute set to |
| 56 |
'0s;5s' and a dur attribute set to 5s. This results in a first interval of (0s <= t < 5s). |
| 57 |
Because the restart attribute is set to 'never', the following possible interval, |
| 58 |
(5s <= t < 10s) does not apply and the animation is only active for the first 5 seconds. |
| 59 |
</p> |
| 60 |
<p> |
| 61 |
The fifth row shows a simple animated red rectangle which lasts for 5 seconds. It shows |
| 62 |
a reference of how the other animations should behave visually: all red rectangles should |
| 63 |
have the same horizontal position as the one on the reference row, at any time during the |
| 64 |
animation. |
| 65 |
</p> |
| 66 |
</d:testDescription> |
| 67 |
<d:operatorScript xmlns="http://www.w3.org/1999/xhtml"> |
| 68 |
<p>Run the test and observe it for at least six seconds. No interaction required.</p> |
| 69 |
</d:operatorScript> |
| 70 |
<d:passCriteria xmlns="http://www.w3.org/1999/xhtml"> |
| 71 |
<p>The test passes if for the first five seconds after the document loads, |
| 72 |
the red squares in each row (two in the third row, and one each in the |
| 73 |
remaining rows) are in the right column, and after the five seconds, |
| 74 |
they all move to the left column.</p> |
| 75 |
</d:passCriteria> |
| 76 |
</d:SVGTestCase> |
| 77 |
<title id="test-title">$RCSfile: animate-elem-67-t.svg,v $</title> |
| 78 |
<defs> |
| 79 |
<font-face font-family="SVGFreeSansASCII" unicode-range="U+0-7F"> |
| 80 |
<font-face-src> |
| 81 |
<font-face-uri xlink:href="../resources/SVGFreeSans.svg#ascii"/> |
| 82 |
</font-face-src> |
| 83 |
</font-face> |
| 84 |
</defs> |
| 85 |
<g id="test-body-content" font-family="SVGFreeSansASCII,sans-serif" font-size="18"> |
| 86 |
<text text-anchor="middle" x="240" y="30" font-size="20">restart</text> |
| 87 |
|
| 88 |
<g transform="translate(130, 80)"> |
| 89 |
|
| 90 |
<g transform="translate(120,45)" text-anchor="end" font-size="14"> |
| 91 |
<text>no restart (defaults to always)</text> |
| 92 |
<text y="25">restart="always"</text> |
| 93 |
<text y="50">restart="whenNotActive"</text> |
| 94 |
<text y="75">restart="never"</text> |
| 95 |
<text y="100">reference</text> |
| 96 |
</g> |
| 97 |
|
| 98 |
<g id="timeMarkersText" transform="translate(180, 25)" text-anchor="middle" font-size="14"> |
| 99 |
<text>> 5s</text> |
| 100 |
<text x="80">0s-5s</text> |
| 101 |
</g> |
| 102 |
|
| 103 |
<g transform="translate(180,40)" stroke="black"> |
| 104 |
<defs> |
| 105 |
<rect id="shadow" x="-6" y="-6" width="12" height="12" fill="#ccc" stroke="black" stroke-width="1"/> |
| 106 |
</defs> |
| 107 |
|
| 108 |
<g id="setOne"> |
| 109 |
<use xlink:href="#shadow" x="0"/> |
| 110 |
<use xlink:href="#shadow" x="80"/> |
| 111 |
|
| 112 |
<rect x="-6" y="-6" width="12" height="12" fill="rgb(204,0,102)"> |
| 113 |
<set id="firstSet" attributeName="x" to="74" begin="0s;1s" dur="4s"/> |
| 114 |
</rect> |
| 115 |
|
| 116 |
</g> |
| 117 |
|
| 118 |
<g id="setTwo" transform="translate(0, 25)"> |
| 119 |
<use xlink:href="#shadow" x="0"/> |
| 120 |
<use xlink:href="#shadow" x="80"/> |
| 121 |
|
| 122 |
<rect x="-6" y="-6" width="12" height="12" fill="rgb(204,0,102)"> |
| 123 |
<set attributeName="x" to="74" begin="0s;1s" dur="4s" restart="always"/> |
| 124 |
</rect> |
| 125 |
|
| 126 |
</g> |
| 127 |
|
| 128 |
<g id="setThree" transform="translate(0, 50)"> |
| 129 |
<use xlink:href="#shadow" x="0"/> |
| 130 |
<use xlink:href="#shadow" x="80"/> |
| 131 |
|
| 132 |
<rect x="-6" y="-6" width="12" height="12" fill="rgb(204,0,102)"> |
| 133 |
<set attributeName="x" to="74" begin="0s;1s" dur="5s" restart="whenNotActive"/> |
| 134 |
</rect> |
| 135 |
|
| 136 |
<g transform="translate(20,0)"> |
| 137 |
<use xlink:href="#shadow" x="0"/> |
| 138 |
<use xlink:href="#shadow" x="80"/> |
| 139 |
|
| 140 |
<rect x="-6" y="-6" width="12" height="12" fill="rgb(204,0,102)"> |
| 141 |
<set attributeName="x" to="74" begin="0s;2.5s" dur="2.5s" restart="whenNotActive"/> |
| 142 |
</rect> |
| 143 |
</g> |
| 144 |
</g> |
| 145 |
|
| 146 |
<g id="setFour" transform="translate(0, 75)"> |
| 147 |
<use xlink:href="#shadow" x="0"/> |
| 148 |
<use xlink:href="#shadow" x="80"/> |
| 149 |
|
| 150 |
<rect x="-6" y="-6" width="12" height="12" fill="rgb(204,0,102)"> |
| 151 |
<set attributeName="x" to="74" begin="0s;5s" dur="5s" restart="never"/> |
| 152 |
</rect> |
| 153 |
</g> |
| 154 |
|
| 155 |
<g id="reference" transform="translate(0, 100)"> |
| 156 |
<use xlink:href="#shadow" x="0"/> |
| 157 |
<use xlink:href="#shadow" x="80"/> |
| 158 |
|
| 159 |
<rect x="-6" y="-6" width="12" height="12" fill="rgb(204,0,102)"> |
| 160 |
<set attributeName="x" to="74" dur="5s"/> |
| 161 |
</rect> |
| 162 |
</g> |
| 163 |
</g> |
| 164 |
</g> |
| 165 |
</g> |
| 166 |
<g font-family="SVGFreeSansASCII,sans-serif" font-size="32"> |
| 167 |
<text id="revision" x="10" y="340" stroke="none" fill="black">$Revision: 1.6 $</text> |
| 168 |
</g> |
| 169 |
<rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000"/> |
| 170 |
<!-- comment out this watermark once the test is approved --> |
| 171 |
<!--<g id="draft-watermark"> |
| 172 |
<rect x="1" y="1" width="478" height="20" fill="red" stroke="black" stroke-width="1"/> |
| 173 |
<text font-family="SVGFreeSansASCII,sans-serif" font-weight="bold" font-size="20" x="240" |
| 174 |
text-anchor="middle" y="18" stroke-width="0.5" stroke="black" fill="white">DRAFT</text> |
| 175 |
</g>--> |
| 176 |
</svg> |