| 1 |
<svg id="svg-root" width="100%" height="100%" |
| 2 |
viewBox="0 0 480 360" xmlns="http://www.w3.org/2000/svg" |
| 3 |
xmlns:xlink="http://www.w3.org/1999/xlink"> |
| 4 |
<!--======================================================================--> |
| 5 |
<!--= SVG 1.1 2nd Edition Test Case =--> |
| 6 |
<!--======================================================================--> |
| 7 |
<!--= Copyright 2008 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="[reviewer]" author="CM" status="created" |
| 15 |
version="$Revision: 1.1 $" testname="$RCSfile: animate-elem-91-t.svg,v $"> |
| 16 |
<d:testDescription xmlns="http://www.w3.org/1999/xhtml" href="http://www.w3.org/TR/SVG11/animate.html#ValueAttributes"> |
| 17 |
<p> |
| 18 |
This tests that to-animations on attributes whose values cannot be |
| 19 |
interpolated are treated as discrete animations. |
| 20 |
</p> |
| 21 |
</d:testDescription> |
| 22 |
<d:operatorScript xmlns="http://www.w3.org/1999/xhtml"> |
| 23 |
<p> |
| 24 |
Run the test. No interaction required. |
| 25 |
</p> |
| 26 |
</d:operatorScript> |
| 27 |
<d:passCriteria xmlns="http://www.w3.org/1999/xhtml"> |
| 28 |
<p> |
| 29 |
The test passes if there initially eight red squares in the |
| 30 |
left column when the document is loaded and the all move |
| 31 |
at the same time to the right column two seconds after the |
| 32 |
document is loaded. |
| 33 |
</p> |
| 34 |
</d:passCriteria> |
| 35 |
</d:SVGTestCase> |
| 36 |
<title id="test-title">$RCSfile: animate-elem-91-t.svg,v $</title> |
| 37 |
<defs> |
| 38 |
<font-face |
| 39 |
font-family="SVGFreeSansASCII" |
| 40 |
unicode-range="U+0-7F"> |
| 41 |
<font-face-src> |
| 42 |
<font-face-uri xlink:href="../resources/SVGFreeSans.svg#ascii"/> |
| 43 |
</font-face-src> |
| 44 |
</font-face> |
| 45 |
</defs> |
| 46 |
<g id="test-body-content" font-family="SVGFreeSansASCII,sans-serif" font-size="18"> |
| 47 |
|
| 48 |
<text x="10" y="40">Testing <animate to=""> with non-interpolable attributes</text> |
| 49 |
|
| 50 |
<g font-size="16"> |
| 51 |
|
| 52 |
<text x="207.5" y="75" text-anchor="middle">0s-2s</text> |
| 53 |
<text x="307.5" y="75" text-anchor="middle">> 2s</text> |
| 54 |
|
| 55 |
<!-- Reference: using <set> --> |
| 56 |
<g transform="translate(0,85)"> |
| 57 |
<text x="30" y="12">(reference)</text> |
| 58 |
<rect x="200" width="12" height="12" stroke="black" fill="rgb(204,0,102)"> |
| 59 |
<set attributeName="fill" to="#ccc" begin="2s" dur="2s" fill="freeze"/> |
| 60 |
</rect> |
| 61 |
<rect x="300" width="12" height="12" stroke="black" fill="#ccc"> |
| 62 |
<set attributeName="fill" to="rgb(204,0,102)" begin="2s" dur="2s" fill="freeze"/> |
| 63 |
</rect> |
| 64 |
</g> |
| 65 |
|
| 66 |
<!-- Sub-test 1: class on <rect> --> |
| 67 |
<g transform="translate(0,110)"> |
| 68 |
<style type="text/css">.on { fill: rgb(204,0,102) } .off { fill: #ccc }</style> |
| 69 |
<text x="30" y="12">class</text> |
| 70 |
<rect x="200" width="12" height="12" stroke="black" class="on"> |
| 71 |
<animate attributeName="class" to="off" begin="2s" dur="2s" fill="freeze"/> |
| 72 |
</rect> |
| 73 |
<rect x="300" width="12" height="12" stroke="black" class="off"> |
| 74 |
<animate attributeName="class" to="on" begin="2s" dur="2s" fill="freeze"/> |
| 75 |
</rect> |
| 76 |
</g> |
| 77 |
|
| 78 |
<!-- Sub-test 2: clipPathUnits on <clipPath> --> |
| 79 |
<g transform="translate(0,135)"> |
| 80 |
<text x="30" y="12">clipPathUnits</text> |
| 81 |
<clipPath id="c1" clipPathUnits="objectBoundingBox"> |
| 82 |
<rect width="1" height="1"/> |
| 83 |
<animate attributeName="clipPathUnits" to="userSpaceOnUse" begin="2s" dur="2s" fill="freeze"/> |
| 84 |
</clipPath> |
| 85 |
<rect x="200" width="12" height="12" stroke="black" fill="#ccc"/> |
| 86 |
<rect x="200" width="12" height="12" stroke="black" fill="rgb(204,0,102)" clip-path="url(#c1)"/> |
| 87 |
<rect x="300" width="12" height="12" stroke="black" fill="rgb(204,0,102)"/> |
| 88 |
<rect x="300" width="12" height="12" stroke="black" fill="#ccc" clip-path="url(#c1)"/> |
| 89 |
</g> |
| 90 |
|
| 91 |
<!-- Sub-test 3: in on <feComposite> --> |
| 92 |
<g transform="translate(0,160)"> |
| 93 |
<text x="30" y="12">in</text> |
| 94 |
<filter id="f1" x="0" y="0" width="1" height="1"> |
| 95 |
<feFlood flood-color="#ccc" result="off"/> |
| 96 |
<feFlood flood-color="rgb(204,0,102)" result="on"/> |
| 97 |
<feComposite in="on" in2="SourceGraphic"> |
| 98 |
<animate attributeName="in" to="off" begin="2s" dur="2s" fill="freeze"/> |
| 99 |
</feComposite> |
| 100 |
</filter> |
| 101 |
<filter id="f2" x="0" y="0" width="1" height="1"> |
| 102 |
<feFlood flood-color="#ccc" result="off"/> |
| 103 |
<feFlood flood-color="rgb(204,0,102)" result="on"/> |
| 104 |
<feComposite in="off" in2="SourceGraphic"> |
| 105 |
<animate attributeName="in" to="on" begin="2s" dur="2s" fill="freeze"/> |
| 106 |
</feComposite> |
| 107 |
</filter> |
| 108 |
<rect x="200" width="12" height="12" fill="none" filter="url(#f1)"/> |
| 109 |
<rect x="200" width="12" height="12" stroke="black" fill="none"/> |
| 110 |
<rect x="300" width="12" height="12" fill="none" filter="url(#f2)"/> |
| 111 |
<rect x="300" width="12" height="12" stroke="black" fill="none"/> |
| 112 |
</g> |
| 113 |
|
| 114 |
<!-- Sub-test 4: preserveAspectRatio on <svg> --> |
| 115 |
<g transform="translate(0,185)"> |
| 116 |
<text x="30" y="12">preserveAspectRatio</text> |
| 117 |
<rect x="200" width="12" height="12" fill="#ccc"/> |
| 118 |
<rect x="300" width="12" height="12" fill="rgb(204,0,102)"/> |
| 119 |
<clipPath id="c2" clipPathUnits="userSpaceOnUse"> |
| 120 |
<rect x="200" y="0" width="112" height="12"/> |
| 121 |
</clipPath> |
| 122 |
<g clip-path="url(#c2)"> |
| 123 |
<svg width="200" height="100" viewBox="0 0 400 400" preserveAspectRatio="none" overflow="visible"> |
| 124 |
<rect x="400" width="24" height="48" fill="rgb(204,0,102)"/> |
| 125 |
<rect x="600" width="24" height="48" fill="#ccc"/> |
| 126 |
<animate attributeName="preserveAspectRatio" to="xMinYMin" begin="2s" dur="2s" fill="freeze"/> |
| 127 |
</svg> |
| 128 |
</g> |
| 129 |
<rect x="200" width="12" height="12" stroke="black" fill="none"/> |
| 130 |
<rect x="300" width="12" height="12" stroke="black" fill="none"/> |
| 131 |
</g> |
| 132 |
|
| 133 |
<!-- Sub-test 5: spreadMethod on <linearGradient> --> |
| 134 |
<g transform="translate(0,210)"> |
| 135 |
<text x="30" y="12">spreadMethod</text> |
| 136 |
<linearGradient id="g1" gradientUnits="objectBoundingBox" x1="1" y1="0" x2="2" y2="0" spreadMethod="reflect"> |
| 137 |
<stop offset="0" stop-color="rgb(204,0,102)" stop-opacity="0"/> |
| 138 |
<stop offset="0" stop-color="rgb(204,0,102)"/> |
| 139 |
<stop offset="1" stop-color="rgb(204,0,102)"/> |
| 140 |
<stop offset="1" stop-color="rgb(204,0,102)" stop-opacity="0"/> |
| 141 |
<animate attributeName="spreadMethod" to="pad" begin="2s" dur="2s" fill="freeze"/> |
| 142 |
</linearGradient> |
| 143 |
<linearGradient id="g2" gradientUnits="objectBoundingBox" x1="1" y1="0" x2="2" y2="0" spreadMethod="reflect"> |
| 144 |
<stop offset="0" stop-color="#ccc" stop-opacity="0"/> |
| 145 |
<stop offset="0" stop-color="#ccc"/> |
| 146 |
<stop offset="1" stop-color="#ccc"/> |
| 147 |
<stop offset="1" stop-color="#ccc" stop-opacity="0"/> |
| 148 |
<animate attributeName="spreadMethod" to="pad" begin="2s" dur="2s" fill="freeze"/> |
| 149 |
</linearGradient> |
| 150 |
<rect x="200" width="12" height="12" fill="#ccc"/> |
| 151 |
<rect x="300" width="12" height="12" fill="rgb(204,0,102)"/> |
| 152 |
<rect x="200" width="12" height="12" stroke="black" fill="url(#g1)"/> |
| 153 |
<rect x="300" width="12" height="12" stroke="black" fill="url(#g2)"/> |
| 154 |
</g> |
| 155 |
|
| 156 |
<!-- Sub-test 6: xlink:href on <use> --> |
| 157 |
<g transform="translate(0,235)"> |
| 158 |
<text x="30" y="12">xlink:href</text> |
| 159 |
<g display="none"> |
| 160 |
<rect id="r1" width="12" height="12" fill="rgb(204,0,102)" stroke="black"/> |
| 161 |
<rect id="r2" width="12" height="12" fill="#ccc" stroke="black"/> |
| 162 |
</g> |
| 163 |
<use xlink:href="#r1" x="200"> |
| 164 |
<animate attributeName="xlink:href" to="#r2" begin="2s" dur="2s" fill="freeze"/> |
| 165 |
</use> |
| 166 |
<use xlink:href="#r2" x="300"> |
| 167 |
<animate attributeName="xlink:href" to="#r1" begin="2s" dur="2s" fill="freeze"/> |
| 168 |
</use> |
| 169 |
</g> |
| 170 |
|
| 171 |
<!-- Sub-test 7: display on <rect> --> |
| 172 |
<g transform="translate(0,260)"> |
| 173 |
<text x="30" y="12">display</text> |
| 174 |
<g> |
| 175 |
<rect x="200" width="12" height="12" fill="rgb(204,0,102)" stroke="black"/> |
| 176 |
<rect x="300" width="12" height="12" fill="#ccc" stroke="black"/> |
| 177 |
<animate attributeName="display" to="none" begin="2s" dur="2s" fill="freeze"/> |
| 178 |
</g> |
| 179 |
<g display="none"> |
| 180 |
<rect x="200" width="12" height="12" fill="#ccc" stroke="black"/> |
| 181 |
<rect x="300" width="12" height="12" fill="rgb(204,0,102)" stroke="black"/> |
| 182 |
<animate attributeName="display" to="inline" begin="2s" dur="2s" fill="freeze"/> |
| 183 |
</g> |
| 184 |
</g> |
| 185 |
</g> |
| 186 |
</g> |
| 187 |
<g font-family="SVGFreeSansASCII,sans-serif" font-size="32"> |
| 188 |
<text id="revision" x="10" y="340" stroke="none" |
| 189 |
fill="black">$Revision: 1.1 $</text> |
| 190 |
</g> |
| 191 |
<rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000"/> |
| 192 |
<!-- comment out this watermark once the test is approved --> |
| 193 |
<g id="draft-watermark"> |
| 194 |
<rect x="1" y="1" width="478" height="20" fill="red" stroke="black" stroke-width="1"/> |
| 195 |
<text font-family="SVGFreeSansASCII,sans-serif" font-weight="bold" font-size="20" x="240" |
| 196 |
text-anchor="middle" y="18" stroke-width="0.5" stroke="black" fill="white">DRAFT</text> |
| 197 |
</g> |
| 198 |
</svg> |