| 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 2010 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="ED" author="CL" status="accepted" |
| 15 |
version="$Revision: 1.3 $" testname="$RCSfile: animate-elem-90-b.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 |
Test that the class attribute is animatable and that style |
| 19 |
sheets select on the animated value. |
| 20 |
<!-- not clear whether to link to dev.w3.org or to /TR |
| 21 |
http://dev.w3.org/SVG/profiles/1.1F2/publish/styling.html#ClassAttribute |
| 22 |
--> |
| 23 |
|
| 24 |
</p> |
| 25 |
</d:testDescription> |
| 26 |
<d:operatorScript xmlns="http://www.w3.org/1999/xhtml"> |
| 27 |
<p> |
| 28 |
This test uses the following elements : 'set', |
| 29 |
and 'animate'. It requires that CSS style sheets are supported. |
| 30 |
</p> |
| 31 |
<p> |
| 32 |
The test shows a circle which is initially hidden, becomes visible and blue at |
| 33 |
3s, abruptly changing to dark red at 5s. Two overlapping animations both animate the |
| 34 |
class attribute. The class attribute, as a string value, does not support |
| 35 |
linear interpolation so a discrete animation is produced, changing from the |
| 36 |
start to the end value midway through the animation duration. |
| 37 |
</p> |
| 38 |
<p> |
| 39 |
The first animation starts at 2s and lasts for 4s so the mid point is at 3s. |
| 40 |
The second animation starts at 3s and lasts for 4s so the midpoint is at 5s. |
| 41 |
The file includes various guides that can be used to verify the |
| 42 |
correctness of the animation. The value of the class attribute |
| 43 |
at 02 is "start" so the first CSS rule matches. At 3s it becomes "midway" |
| 44 |
so the second rule matches. At 5s it becomes "final midway" so the second and |
| 45 |
third rules match; the third rule has higher specificity so determines the fill color. |
| 46 |
|
| 47 |
</p> |
| 48 |
</d:operatorScript> |
| 49 |
<d:passCriteria xmlns="http://www.w3.org/1999/xhtml"> |
| 50 |
<p> |
| 51 |
The color of the large circle must match the colour of the smaller guide |
| 52 |
boxes on the left at times 0s, 3s and 5s. If the text "CSS not supported" |
| 53 |
is visible, the test does not apply. |
| 54 |
</p> |
| 55 |
</d:passCriteria> |
| 56 |
</d:SVGTestCase> |
| 57 |
<title id="test-title">$RCSfile: animate-elem-90-b.svg,v $</title> |
| 58 |
<defs> |
| 59 |
<font-face font-family="SVGFreeSansASCII" unicode-range="U+0-7F"> |
| 60 |
<font-face-src> |
| 61 |
<font-face-uri xlink:href="../resources/SVGFreeSans.svg#ascii"/> |
| 62 |
</font-face-src> |
| 63 |
</font-face> |
| 64 |
<style type="text/css"> |
| 65 |
.start {visibility: hidden } |
| 66 |
.midway {visibility: visible; fill: rgb(0,0,255); } |
| 67 |
#test-body-content .final {fill: rgb(128,0,0); } |
| 68 |
.hideme {display: none;} |
| 69 |
</style> |
| 70 |
</defs> |
| 71 |
<g id="test-body-content" font-family="SVGFreeSansASCII,sans-serif" font-size="18"> |
| 72 |
<!-- Guide objects to show where the animation elements belong at which time --> |
| 73 |
<g font-family="Verdana" font-size="12"> |
| 74 |
<text x="15" y="55">Color at start</text> |
| 75 |
<rect x="15" y="60" width="30" height="30"/> |
| 76 |
<circle cx="30" cy="75" r="10" fill="#000"/> |
| 77 |
<text x="15" y="145">Color at 3s</text> |
| 78 |
<rect x="15" y="150" width="30" height="30"/> |
| 79 |
<circle cx="30" cy="165" r="10" fill="rgb(0,0,255)"/> |
| 80 |
<text x="15" y="235">Color at 5s</text> |
| 81 |
<rect x="15" y="240" width="30" height="30"/> |
| 82 |
<circle cx="30" cy="255" r="10" fill="rgb(128,0,0)"/> |
| 83 |
</g> |
| 84 |
|
| 85 |
<g> |
| 86 |
<rect x="150" y="50" width="240" height="240" stroke="black" fill="black"/> |
| 87 |
<circle cx="270" cy="170" r="110" class="start"> |
| 88 |
<set attributeName="class" attributeType="XML" to="midway" begin="2s" dur="2s" fill="freeze"/> |
| 89 |
<animate attributeName="class" attributeType="XML" from="midway" to="final midway" begin="3s" dur="4s" fill="freeze"/> |
| 90 |
</circle> |
| 91 |
</g> |
| 92 |
<text x="270" y="170" text-anchor="middle" font-size="40" fill="#F69" class="hideme">CSS not supported</text> |
| 93 |
</g> |
| 94 |
<g font-family="SVGFreeSansASCII,sans-serif" font-size="32"> |
| 95 |
<text id="revision" x="10" y="340" stroke="none" fill="black">$Revision: 1.3 $</text> |
| 96 |
</g> |
| 97 |
<rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/> |
| 98 |
<!-- comment out this watermark once the test is approved --> |
| 99 |
<!--<g id="draft-watermark"> |
| 100 |
<rect x="1" y="1" width="478" height="20" fill="red" stroke="black" stroke-width="1"/> |
| 101 |
<text font-family="SVGFreeSansASCII,sans-serif" font-weight="bold" font-size="20" x="240" |
| 102 |
text-anchor="middle" y="18" stroke-width="0.5" stroke="black" fill="white">DRAFT</text> |
| 103 |
</g>--> |
| 104 |
</svg> |