| 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="VH" author="OA" status="issue" |
| 15 |
version="$Revision: 1.7 $" testname="$RCSfile: animate-elem-53-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 |
The purpose of this test is to test animation of points and calcmode. |
| 19 |
</p> |
| 20 |
<!-- The test has no well defined pass criteria and its not clear also which of the several results produced by different implementations is correct. Think Opera 10.6 is correct; test needs to be discussed by wg. --> |
| 21 |
</d:testDescription> |
| 22 |
<d:operatorScript xmlns="http://www.w3.org/1999/xhtml"> |
| 23 |
|
| 24 |
<p> |
| 25 |
1. The green squares should animate together side by side. This applies |
| 26 |
to the blue ones as well. |
| 27 |
2. The time values indicate when the squares should reach the |
| 28 |
corresponding reference square. |
| 29 |
3. The total distance is 0+40+80+24.14=144.14 |
| 30 |
a. The "green animation" is 9 sec and linear so each interval |
| 31 |
should get 3 sec. |
| 32 |
b. The "blue animation" is 8 sec and paced so the intervals |
| 33 |
should get 2.22, 4.44 and 1.34 sec each. |
| 34 |
</p> |
| 35 |
<p> |
| 36 |
Here comes a more detailed description of the animation. |
| 37 |
|
| 38 |
The left green square (LG) is animated by animating the points with |
| 39 |
a value array, consisting of 4 lists of points. This is an animation |
| 40 |
with calc-mode=linear so an equal amount of time should be spent on |
| 41 |
all 4 intervals. The right green square (RG) is animated by a simple |
| 42 |
linear motion followed by a scale to follow LG. |
| 43 |
The last scale by 1.9428 correspond to a movement of the lover right |
| 44 |
corner of the square by sqrt((30*0.9428)^2 + (30*0.9428)^2) which is |
| 45 |
approximately 40 distance units. This is the same distance as the first |
| 46 |
interval in the values array (and half the second interval). |
| 47 |
The length (in terms of distance) is not really important for the |
| 48 |
green squares but for the blue squares which are animated with |
| 49 |
calc-mode=paced the length is used to calculate the time for each |
| 50 |
interval. |
| 51 |
Since the first and last interval are of the same length which |
| 52 |
totals to the length of the middle interval, the interval should |
| 53 |
be given time according to [27.75%(2.22sec);55.5%(4.44sec);16.75%(1.34sec)]. |
| 54 |
|
| 55 |
So the left blue square (LR) is animated just as the LG square but |
| 56 |
with calc-mode=paced. The same applies to the right blue square (RR) |
| 57 |
that has default calc-mode (paced for animateMotion) compablue to the |
| 58 |
RG square that has calc-mode=linear. |
| 59 |
The calc-mode for the scale of RR (and RG) is not important since |
| 60 |
it's not a value list type of animation. |
| 61 |
</p> |
| 62 |
</d:operatorScript> |
| 63 |
<d:passCriteria xmlns="http://www.w3.org/1999/xhtml"> |
| 64 |
<p> |
| 65 |
[[Describe the pass criteria of the test here. The pass criteria is what |
| 66 |
should be displayed when the test is run.]] |
| 67 |
</p> |
| 68 |
</d:passCriteria> |
| 69 |
</d:SVGTestCase> |
| 70 |
<title id="test-title">$RCSfile: animate-elem-53-t.svg,v $</title> |
| 71 |
<defs> |
| 72 |
<font-face font-family="SVGFreeSansASCII" unicode-range="U+0-7F"> |
| 73 |
<font-face-src> |
| 74 |
<font-face-uri xlink:href="../resources/SVGFreeSans.svg#ascii"/> |
| 75 |
</font-face-src> |
| 76 |
</font-face> |
| 77 |
</defs> |
| 78 |
<g id="test-body-content" font-family="SVGFreeSansASCII,sans-serif" font-size="18"> |
| 79 |
<defs> |
| 80 |
<polygon id="p" points="0,0 30,0 30,30 0,30" fill="none" stroke="black"/> |
| 81 |
</defs> |
| 82 |
<g transform="translate(0,0)"> |
| 83 |
<use xlink:href="#p" x="10" y="10"/> |
| 84 |
<text x="15" y="35" font-size="20">0s</text> |
| 85 |
<use xlink:href="#p" x="10" y="50"/> |
| 86 |
<text x="15" y="75" font-size="20">3s</text> |
| 87 |
<use xlink:href="#p" x="10" y="130"/> |
| 88 |
<text x="15" y="155" font-size="20">6s</text> |
| 89 |
<rect x="10" y="130" width="58.28" height="58.28" fill="none" stroke="black"/> |
| 90 |
<text x="45" y="185" font-size="20">9s</text> |
| 91 |
<polygon id="LG" points="0,0 30,0 30,30 0,30" fill="none" stroke="green"> |
| 92 |
<animate attributeName="points" begin="0" dur="9" fill="freeze" values="10,10 40,10 40,40 10,40; 10,50 40,50 40,80 10,80; 10,130 40,130 40,160 10,160; 10,130 68.28,130 68.28,188.28 10,188.28"/> |
| 93 |
</polygon> |
| 94 |
<g transform="translate(70,10)"> |
| 95 |
<polygon id="RG" points="0,0 30,0 30,30 0,30" fill="none" stroke="green"> |
| 96 |
<animateMotion values="0,0;0,40;0,120" begin="0" dur="6" calcMode="linear" fill="freeze"/> |
| 97 |
<animateTransform attributeName="transform" type="scale" from="1" to="1.9428" begin="6" dur="3" fill="freeze"/> |
| 98 |
</polygon> |
| 99 |
</g> |
| 100 |
</g> |
| 101 |
<g transform="translate(120,0)"> |
| 102 |
<use xlink:href="#p" x="10" y="10"/> |
| 103 |
<text x="15" y="35" font-size="20">0s</text> |
| 104 |
<use xlink:href="#p" x="10" y="50"/> |
| 105 |
<text x="15" y="75" font-size="20">2.22s</text> |
| 106 |
<use xlink:href="#p" x="10" y="130"/> |
| 107 |
<text x="15" y="155" font-size="20">6.66s</text> |
| 108 |
<rect x="10" y="130" width="58.28" height="58.28" fill="none" stroke="black"/> |
| 109 |
<text x="45" y="185" font-size="20">8s</text> |
| 110 |
<polygon id="LR" points="10,10 40,10 40,40 10,40" fill="none" stroke="blue"> |
| 111 |
<animate attributeName="points" begin="0" dur="8" calcMode="paced" fill="freeze" values="10,10 40,10 40,40 10,40; 10,50 40,50 40,80 10,80; 10,130 40,130 40,160 10,160; 10,130 68.28,130 68.28,188.28 10,188.28"/> |
| 112 |
</polygon> |
| 113 |
<g transform="translate(70,10)"> |
| 114 |
<polygon id="RR" points="0,0 30,0 30,30 0,30" fill="none" stroke="blue"> |
| 115 |
<animateMotion values="0,0;0,40;0,120" begin="0" dur="6.66" fill="freeze"/> |
| 116 |
<animateTransform attributeName="transform" type="scale" from="1" to="1.9428" begin="6.66" dur="1.34" fill="freeze"/> |
| 117 |
</polygon> |
| 118 |
</g> |
| 119 |
</g> |
| 120 |
<text x="5" y="225" font-size="26">Animation on: 'points' with 'calc-mode'.</text> |
| 121 |
<text x="5" y="255" font-size="16">Coloblue and black squares should match at indicated time.</text> |
| 122 |
<text x="5" y="275" font-size="16">Same coloblue squares (green and blue) should match at all times</text> |
| 123 |
</g> |
| 124 |
<g font-family="SVGFreeSansASCII,sans-serif" font-size="32"> |
| 125 |
<text id="revision" x="10" y="340" stroke="none" fill="black">$Revision: 1.7 $</text> |
| 126 |
</g> |
| 127 |
<rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/> |
| 128 |
<!-- comment out this watermark once the test is approved --> |
| 129 |
<g id="draft-watermark"> |
| 130 |
<rect x="1" y="1" width="478" height="20" fill="red" stroke="black" stroke-width="1"/> |
| 131 |
<text font-family="SVGFreeSansASCII,sans-serif" font-weight="bold" font-size="20" x="240" |
| 132 |
text-anchor="middle" y="18" stroke-width="0.5" stroke="black" fill="white">DRAFT</text> |
| 133 |
</g> |
| 134 |
</svg> |