| 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 |
<!--= Copyright 2008 World Wide Web Consortium, (Massachusetts =--> |
| 6 |
<!--= Institute of Technology, European Research Consortium for =--> |
| 7 |
<!--= Informatics and Mathematics (ERCIM), Keio University). =--> |
| 8 |
<!--= All Rights Reserved. =--> |
| 9 |
<!--= See http://www.w3.org/Consortium/Legal/. =--> |
| 10 |
<!--======================================================================--> |
| 11 |
<d:SVGTestCase xmlns:d="http://www.w3.org/2000/02/svg/testsuite/description/" |
| 12 |
template-version="1.4" reviewer="DAS" author="CM" status="accepted" |
| 13 |
version="$Revision: 1.11 $" testname="$RCSfile: animate-dom-01-f.svg,v $"> |
| 14 |
<d:testDescription xmlns="http://www.w3.org/1999/xhtml" href="http://www.w3.org/TR/SVG11/animate.html#InterfaceSVGAnimationElement"> |
| 15 |
<p> |
| 16 |
This tests the return value required for the |
| 17 |
SVGAnimationElement.getStartTime() method, as described in |
| 18 |
section 19.5 DOM Interfaces. |
| 19 |
</p> |
| 20 |
</d:testDescription> |
| 21 |
<d:operatorScript xmlns="http://www.w3.org/1999/xhtml"> |
| 22 |
<p> |
| 23 |
After the loading the document, some animations that have no |
| 24 |
visible effect will run. The text "Test running..." will |
| 25 |
appear in the bottom right corner until the test has |
| 26 |
completed. (This takes 2.5s.) |
| 27 |
</p> |
| 28 |
</d:operatorScript> |
| 29 |
<d:passCriteria xmlns="http://www.w3.org/1999/xhtml"> |
| 30 |
<p> |
| 31 |
The test is passed if all seven rectangles are green once the animations |
| 32 |
have stopped running (i.e., 2.5s after the document has loaded.) |
| 33 |
</p> |
| 34 |
</d:passCriteria> |
| 35 |
</d:SVGTestCase> |
| 36 |
<title id="test-title">$RCSfile: animate-dom-01-f.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='30' y='30'>Testing SVGAnimationElement.getStartTime()</text> |
| 49 |
|
| 50 |
<text x='340' y='340' display='none'>Test running... |
| 51 |
<set attributeName='display' to='inline' begin='0s' dur='2.5s'/> |
| 52 |
</text> |
| 53 |
|
| 54 |
<g id='g' display='none'/> |
| 55 |
|
| 56 |
<animate id='a1' attributeName='display' values='inline; inline' |
| 57 |
calcMode='discrete' begin='1s' dur='1s'/> |
| 58 |
<animate id='a2' attributeName='display' values='inline; inline' |
| 59 |
calcMode='discrete' begin='1s' dur='1s' fill='freeze'/> |
| 60 |
<animate id='a3' attributeName='display' values='inline; inline' |
| 61 |
calcMode='discrete' begin='indefinite' dur='1s'/> |
| 62 |
<animate id='a4' attributeName='display' values='inline; inline' |
| 63 |
calcMode='discrete' begin='indefinite; 100s; g.click; 1s; indefinite' dur='1s'/> |
| 64 |
<animate id='a5' attributeName='display' values='inline; inline' |
| 65 |
calcMode='discrete' begin='100s; 1s' dur='1s'/> |
| 66 |
<animate id='a6dep' attributeName='display' values='inline; inline' |
| 67 |
calcMode='discrete' begin='5s' dur='1s'/> |
| 68 |
<animate id='a6' attributeName='display' values='inline; inline' |
| 69 |
calcMode='discrete' begin='a6dep.begin+2s' dur='1s'/> |
| 70 |
|
| 71 |
<animate attributeName='display' values='inline; inline' |
| 72 |
calcMode='discrete' begin='0.5s' dur='1s' onbegin='before()'/> |
| 73 |
<animate attributeName='display' values='inline; inline' |
| 74 |
calcMode='discrete' begin='1.5s' dur='1s' onbegin='during()'/> |
| 75 |
<animate attributeName='display' values='inline; inline' |
| 76 |
calcMode='discrete' begin='2.5s' dur='1s' onbegin='after()'/> |
| 77 |
|
| 78 |
<g transform='translate(30,-10)'> |
| 79 |
<rect id='r1' y='50' width='25' height='25'/> |
| 80 |
<rect id='r2' y='80' width='25' height='25'/> |
| 81 |
<rect id='r3' y='110' width='25' height='25'/> |
| 82 |
<rect id='r4' y='140' width='25' height='25'/> |
| 83 |
<rect id='r5' y='170' width='25' height='25'/> |
| 84 |
<rect id='r6' y='200' width='25' height='25'/> |
| 85 |
<rect id='r7' y='230' width='25' height='25'/> |
| 86 |
<rect id='r8' y='260' width='25' height='25'/> |
| 87 |
</g> |
| 88 |
|
| 89 |
<g font-size='14' transform='translate(70,-15)'> |
| 90 |
<text y='72'>Called before a lone interval starts</text> |
| 91 |
<text y='102'>Called on an animation with no intervals</text> |
| 92 |
<text y='132'>Called during an interval</text> |
| 93 |
<text y='162'>Called after a lone interval ends, fill="remove"</text> |
| 94 |
<text y='192'>Called after a lone interval ends, fill="freeze"</text> |
| 95 |
<text y='222'>Called with multiple begin values</text> |
| 96 |
<text y='252'>Called with multiple begin values including "indefinite"</text> |
| 97 |
<text y='282'>Called with syncbase begin value</text> |
| 98 |
</g> |
| 99 |
<script><![CDATA[ |
| 100 |
var i, ids = 'a1 a2 a3 a4 a5 a6 r1 r2 r3 r4 r5 r6 r7 r8'.split(' '); |
| 101 |
for (i in ids) { |
| 102 |
this[ids[i]] = document.getElementById(ids[i]); |
| 103 |
} |
| 104 |
|
| 105 |
function before() { |
| 106 |
try { |
| 107 |
if (a1.getStartTime() == 1) { |
| 108 |
r1.setAttributeNS(null, 'fill', 'lime'); |
| 109 |
} |
| 110 |
} catch (e) { |
| 111 |
r1.setAttributeNS(null, 'fill', 'red'); |
| 112 |
} |
| 113 |
|
| 114 |
r2.setAttributeNS(null, 'fill', 'red'); |
| 115 |
try { |
| 116 |
a3.getStartTime(); |
| 117 |
} catch (e) { |
| 118 |
if (e.code == DOMException.INVALID_STATE_ERR) { |
| 119 |
r2.setAttributeNS(null, 'fill', 'lime'); |
| 120 |
} |
| 121 |
} |
| 122 |
|
| 123 |
try { |
| 124 |
if (a4.getStartTime() == 1) { |
| 125 |
r6.setAttributeNS(null, 'fill', 'lime'); |
| 126 |
} |
| 127 |
} catch (e) { |
| 128 |
r6.setAttributeNS(null, 'fill', 'red'); |
| 129 |
} |
| 130 |
|
| 131 |
try { |
| 132 |
if (a5.getStartTime() == 1) { |
| 133 |
r7.setAttributeNS(null, 'fill', 'lime'); |
| 134 |
} |
| 135 |
} catch (e) { |
| 136 |
r7.setAttributeNS(null, 'fill', 'red'); |
| 137 |
} |
| 138 |
|
| 139 |
try { |
| 140 |
if (a6.getStartTime() == 7) { |
| 141 |
r8.setAttributeNS(null, 'fill', 'lime'); |
| 142 |
} |
| 143 |
} catch (e) { |
| 144 |
r8.setAttributeNS(null, 'fill', 'red'); |
| 145 |
} |
| 146 |
} |
| 147 |
|
| 148 |
function during() { |
| 149 |
try { |
| 150 |
if (a1.getStartTime() == 1) { |
| 151 |
r3.setAttributeNS(null, 'fill', 'lime'); |
| 152 |
} |
| 153 |
} catch (e) { |
| 154 |
r3.setAttributeNS(null, 'fill', 'red'); |
| 155 |
} |
| 156 |
} |
| 157 |
|
| 158 |
function after() { |
| 159 |
r4.setAttributeNS(null, 'fill', 'red'); |
| 160 |
try { |
| 161 |
a1.getStartTime(); |
| 162 |
} catch (e) { |
| 163 |
if (e.code == DOMException.INVALID_STATE_ERR) { |
| 164 |
r4.setAttributeNS(null, 'fill', 'lime'); |
| 165 |
} |
| 166 |
} |
| 167 |
|
| 168 |
r5.setAttributeNS(null, 'fill', 'red'); |
| 169 |
try { |
| 170 |
a2.getStartTime(); |
| 171 |
} catch (e) { |
| 172 |
if (e.code == DOMException.INVALID_STATE_ERR) { |
| 173 |
r5.setAttributeNS(null, 'fill', 'lime'); |
| 174 |
} |
| 175 |
} |
| 176 |
} |
| 177 |
]]></script> |
| 178 |
</g> |
| 179 |
<g font-family="SVGFreeSansASCII,sans-serif" font-size="32"> |
| 180 |
<text id="revision" x="10" y="340" stroke="none" |
| 181 |
fill="black">$Revision: 1.11 $</text> |
| 182 |
</g> |
| 183 |
<rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000"/> |
| 184 |
<!-- comment out this watermark once the test is approved --><!-- |
| 185 |
<g id="draft-watermark"> |
| 186 |
<rect x="1" y="1" width="478" height="20" fill="red" stroke="black" stroke-width="1"/> |
| 187 |
<text font-family="SVGFreeSansASCII,sans-serif" font-weight="bold" font-size="20" x="240" |
| 188 |
text-anchor="middle" y="18" stroke-width="0.5" stroke="black" fill="white">DRAFT</text> |
| 189 |
</g>--> |
| 190 |
</svg> |