| 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-63-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 validates multiple end conditions in the end attribute, |
| 19 |
assuming support for the <set> element and setting the |
| 20 |
dur attribute to 'indefinite'. |
| 21 |
</p> |
| 22 |
<p> |
| 23 |
The test validates the various possibilities for the end attribute |
| 24 |
value: multiple offset values, multiple event base values, multiple sync base |
| 25 |
values, multiple repeat values, and multiple accessKey values. Finally, |
| 26 |
the test validates that end values of different kinds can be mixed. |
| 27 |
</p> |
| 28 |
<p> |
| 29 |
The test shows 6 rows where a red rectangle's x attribute is animated |
| 30 |
with <set> elements. |
| 31 |
</p> |
| 32 |
<p> |
| 33 |
On the first three rows, the red rectangles should show on the left from |
| 34 |
0 to 1s. From 1 to 2s, the rectangles should show on the right. Then |
| 35 |
the rectangles should show on the left from 2 to 4s, then on the right |
| 36 |
again from 4 to 5s and come back to the left position and stay there |
| 37 |
after 5s. |
| 38 |
</p> |
| 39 |
<p> |
| 40 |
On the fourth row, the rectangle's end condition is event based |
| 41 |
and requires a user click. One of the end condition is defined |
| 42 |
to be 5 seconds prior to the click and one is defined to be 5 |
| 43 |
seconds after the click. If the user clicks on the rectangle |
| 44 |
before 5 seconds (in document time), the red rectangle we move |
| 45 |
to the left position 5 seconds after the click (because the |
| 46 |
'click - 5s' end time resolves to a time prior to the begin |
| 47 |
time). If the user clicks after 5 seconds (in document time), |
| 48 |
then the red rectangle moves to the left position immediately because |
| 49 |
the 'click - 5s' time resolves to a time after the begin time. |
| 50 |
</p> |
| 51 |
<p> |
| 52 |
On the fifth row, the rectangle's end condition is accessKey based |
| 53 |
and requires a user to press the 'a' key. The behavior is exactly the |
| 54 |
same as for the previous row, except that the triggering event |
| 55 |
is the 'a' key press. |
| 56 |
</p> |
| 57 |
<p> |
| 58 |
The last row's rectangle has a end condition with two offset values |
| 59 |
(1s;4s) and should behave like the rectangles of the first three |
| 60 |
rows for the first 5 seconds of the document's timeline. In addition, |
| 61 |
the end condition has a click event base and thus, the rectangle |
| 62 |
should immediately move to the left position if the user everytime the user |
| 63 |
clicks clicks on the rectangle when it is on the right position. |
| 64 |
Finally, the end condition also has an accessKey condition |
| 65 |
for the 'b' character. Thus, the rectangle should move to the left |
| 66 |
position every time the user presses the 'b' key and the rectangle is |
| 67 |
on the right position. |
| 68 |
</p> |
| 69 |
</d:testDescription> |
| 70 |
<d:operatorScript xmlns="http://www.w3.org/1999/xhtml"> |
| 71 |
<p>Run the test. Observe the document for six seconds. |
| 72 |
Then, click the red square in the "2 event base" row |
| 73 |
and then press "a" on the keyboard.</p> |
| 74 |
<p>Next, reload the test. Before five seconds have elapsed, |
| 75 |
click the red square in the "2 event base" row and then |
| 76 |
press "a" on the keyboard. Observe the document for another six seconds.</p> |
| 77 |
</d:operatorScript> |
| 78 |
<d:passCriteria xmlns="http://www.w3.org/1999/xhtml"> |
| 79 |
<p>The test passes if the following conditions are met:</p> |
| 80 |
<ul> |
| 81 |
<li>In the first load of the document, the red squares in the top three |
| 82 |
rows and the bottom row are in the relevant column according to the |
| 83 |
times written above the columns: in left column for the first second |
| 84 |
of the document, in the right column between 1s and 2s, in the left |
| 85 |
column again between 2s and 4s, in the right column again between 4s |
| 86 |
and 5s, and finally revert to the left column at 5s. During this |
| 87 |
whole time, the red squares on the "2 event base" and "2 accessKeys" |
| 88 |
rows must be in the right column.</li> |
| 89 |
<li>In the first load of the document, immediately once the red |
| 90 |
square is clicked, it must move to the left column.</li> |
| 91 |
<li>In the first load of the document, immediately once "a" is pressed |
| 92 |
on the keyboard, the red square in the "2 accessKeys" row must move |
| 93 |
to the left column.</li> |
| 94 |
<li>In the second load of the document, five seconds after the red |
| 95 |
square is clicked, it must move to the left column.</li> |
| 96 |
<li>In the second load of the document, five seconds after "a" is pressed |
| 97 |
on the keyboard, the red square in the "2 accessKeys" row must move |
| 98 |
to the left column.</li> |
| 99 |
</ul> |
| 100 |
</d:passCriteria> |
| 101 |
</d:SVGTestCase> |
| 102 |
<title id="test-title">$RCSfile: animate-elem-63-t.svg,v $</title> |
| 103 |
<defs> |
| 104 |
<font-face font-family="SVGFreeSansASCII" unicode-range="U+0-7F"> |
| 105 |
<font-face-src> |
| 106 |
<font-face-uri xlink:href="../resources/SVGFreeSans.svg#ascii"/> |
| 107 |
</font-face-src> |
| 108 |
</font-face> |
| 109 |
</defs> |
| 110 |
<g id="test-body-content" font-family="SVGFreeSansASCII,sans-serif" font-size="18"> |
| 111 |
<text text-anchor="middle" x="240" y="30" font-size="20">multiple end</text> |
| 112 |
<g transform="translate(100, 100)"> |
| 113 |
<g transform="translate(80,25)" text-anchor="end" font-size="14"> |
| 114 |
<text>2 offsets</text> |
| 115 |
<text y="25">2 sync bases</text> |
| 116 |
<text y="50">2 repeat</text> |
| 117 |
<text y="100">2 event base</text> |
| 118 |
<text y="125">2 accessKeys</text> |
| 119 |
<text y="150">misc</text> |
| 120 |
</g> |
| 121 |
|
| 122 |
<g id="timeMarkersText" transform="translate(150, 5)" text-anchor="middle" font-size="14"> |
| 123 |
<text>0-1s</text> |
| 124 |
<text y="-20">2s-4s</text> |
| 125 |
<text y="-40">> 5s</text> |
| 126 |
<g transform="translate(40,0)"> |
| 127 |
<text>1-2s</text> |
| 128 |
<text y="-20">4-5s</text> |
| 129 |
</g> |
| 130 |
</g> |
| 131 |
|
| 132 |
<g transform="translate(150,20)" stroke="black"> |
| 133 |
<defs> |
| 134 |
<rect id="shadow" x="-6" y="-6" width="12" height="12" fill="#ccc" stroke="black" stroke-width="1"/> |
| 135 |
</defs> |
| 136 |
|
| 137 |
<g id="setOne"> |
| 138 |
<use xlink:href="#shadow" x="0"/> |
| 139 |
<use xlink:href="#shadow" x="40"/> |
| 140 |
<rect x="-6" y="-6" width="12" height="12" fill="rgb(204,0,102)"> |
| 141 |
<set id="firstSet" attributeName="x" to="34" begin="1s; 4s" end="2s; 5s" dur="indefinite"/> |
| 142 |
</rect> |
| 143 |
</g> |
| 144 |
|
| 145 |
<g id="setTwo" transform="translate(0, 25)"> |
| 146 |
<set id="syncBase" attributeName="display" to="inline" begin="0s" dur="indefinite"/> |
| 147 |
<use xlink:href="#shadow" x="0"/> |
| 148 |
<use xlink:href="#shadow" x="40"/> |
| 149 |
<rect x="-6" y="-6" width="12" height="12" fill="rgb(204,0,102)"> |
| 150 |
<set attributeName="x" to="34" begin="1s; 4s" end="syncBase.begin+2s;syncBase.begin + 5s" dur="indefinite"/> |
| 151 |
</rect> |
| 152 |
</g> |
| 153 |
|
| 154 |
<g id="setThree" transform="translate(0, 50)"> |
| 155 |
<set id="repeatBase" attributeName="display" to="inline" begin="0s" dur="1s" repeatDur="indefinite"/> |
| 156 |
<use xlink:href="#shadow" x="0"/> |
| 157 |
<use xlink:href="#shadow" x="40"/> |
| 158 |
<rect x="-6" y="-6" width="12" height="12" fill="rgb(204,0,102)"> |
| 159 |
<set attributeName="x" to="34" begin="1s; 4s" end="repeatBase.repeat(2);repeatBase.repeat(5)" dur="indefinite"/> |
| 160 |
</rect> |
| 161 |
</g> |
| 162 |
|
| 163 |
<g id="setFour" transform="translate(0, 100)"> |
| 164 |
<use xlink:href="#shadow" x="0"/> |
| 165 |
<use xlink:href="#shadow" x="40"/> |
| 166 |
|
| 167 |
<rect id="setFourTarget" x="-6" y="-6" width="12" height="12" fill="rgb(204,0,102)"> |
| 168 |
<set attributeName="x" to="34" begin="0s" end="setFourTarget.click -5s; setFourTarget.click + 5s" dur="indefinite"/> |
| 169 |
</rect> |
| 170 |
</g> |
| 171 |
|
| 172 |
<g id="setFive" transform="translate(0, 125)"> |
| 173 |
<use xlink:href="#shadow" x="0"/> |
| 174 |
<use xlink:href="#shadow" x="40"/> |
| 175 |
<rect id="setFiveTarget" x="-6" y="-6" width="12" height="12" fill="rgb(204,0,102)"> |
| 176 |
<set attributeName="x" to="34" begin="0s" end="accessKey(a) - 5s;accessKey(a)+5s" dur="indefinite"/> |
| 177 |
</rect> |
| 178 |
</g> |
| 179 |
|
| 180 |
<g id="setSix" transform="translate(0, 150)"> |
| 181 |
<use xlink:href="#shadow" x="0"/> |
| 182 |
<use xlink:href="#shadow" x="40"/> |
| 183 |
<rect id="setSixTarget" x="-6" y="-6" width="12" height="12" fill="rgb(204,0,102)"> |
| 184 |
<set attributeName="x" to="34" begin="1s;4s" end="2s;5s;setSixTarget.click;accessKey(b)" dur="indefinite"/> |
| 185 |
</rect> |
| 186 |
</g> |
| 187 |
</g> |
| 188 |
</g> |
| 189 |
</g> |
| 190 |
<g font-family="SVGFreeSansASCII,sans-serif" font-size="32"> |
| 191 |
<text id="revision" x="10" y="340" stroke="none" fill="black">$Revision: 1.6 $</text> |
| 192 |
</g> |
| 193 |
<rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000"/> |
| 194 |
<!-- comment out this watermark once the test is approved --> |
| 195 |
<!--<g id="draft-watermark"> |
| 196 |
<rect x="1" y="1" width="478" height="20" fill="red" stroke="black" stroke-width="1"/> |
| 197 |
<text font-family="SVGFreeSansASCII,sans-serif" font-weight="bold" font-size="20" x="240" |
| 198 |
text-anchor="middle" y="18" stroke-width="0.5" stroke="black" fill="white">DRAFT</text> |
| 199 |
</g>--> |
| 200 |
</svg> |