animate-dom-01-f-isvalid.html (6688B)
1 <!DOCTYPE html> 2 <html lang='en'> 3 <head> 4 <title>animate-dom-01-f-manual.svg</title> 5 <meta charset='utf-8'> 6 </head> 7 <body> 8 <h1>Source SVG: animate-dom-01-f-manual.svg</h1> 9 <svg id="svg-root" width="100%" height="100%" 10 viewBox="0 0 480 360" xmlns="http://www.w3.org/2000/svg" 11 xmlns:xlink="http://www.w3.org/1999/xlink"> 12 <!--======================================================================--> 13 <!--= Copyright 2008 World Wide Web Consortium, (Massachusetts =--> 14 <!--= Institute of Technology, European Research Consortium for =--> 15 <!--= Informatics and Mathematics (ERCIM), Keio University). =--> 16 <!--= All Rights Reserved. =--> 17 <!--= See http://www.w3.org/Consortium/Legal/. =--> 18 <!--======================================================================--> 19 20 <title id="test-title">$RCSfile: animate-dom-01-f.svg,v $</title> 21 <defs> 22 <font-face 23 font-family="SVGFreeSansASCII" 24 unicode-range="U+0-7F"> 25 <font-face-src> 26 <font-face-uri xlink:href="../resources/SVGFreeSans.svg#ascii"/> 27 </font-face-src> 28 </font-face> 29 </defs> 30 <g id="test-body-content" font-family="SVGFreeSansASCII,sans-serif" font-size="18"> 31 32 <text x='30' y='30'>Testing SVGAnimationElement.getStartTime()</text> 33 34 <text x='340' y='340' display='none'>Test running... 35 <set attributeName='display' to='inline' begin='0s' dur='2.5s'/> 36 </text> 37 38 <g id='g' display='none'/> 39 40 <animate id='a1' attributeName='display' values='inline; inline' 41 calcMode='discrete' begin='1s' dur='1s'/> 42 <animate id='a2' attributeName='display' values='inline; inline' 43 calcMode='discrete' begin='1s' dur='1s' fill='freeze'/> 44 <animate id='a3' attributeName='display' values='inline; inline' 45 calcMode='discrete' begin='indefinite' dur='1s'/> 46 <animate id='a4' attributeName='display' values='inline; inline' 47 calcMode='discrete' begin='indefinite; 100s; g.click; 1s; indefinite' dur='1s'/> 48 <animate id='a5' attributeName='display' values='inline; inline' 49 calcMode='discrete' begin='100s; 1s' dur='1s'/> 50 <animate id='a6dep' attributeName='display' values='inline; inline' 51 calcMode='discrete' begin='5s' dur='1s'/> 52 <animate id='a6' attributeName='display' values='inline; inline' 53 calcMode='discrete' begin='a6dep.begin+2s' dur='1s'/> 54 55 <animate attributeName='display' values='inline; inline' 56 calcMode='discrete' begin='0.5s' dur='1s' onbegin='before()'/> 57 <animate attributeName='display' values='inline; inline' 58 calcMode='discrete' begin='1.5s' dur='1s' onbegin='during()'/> 59 <animate attributeName='display' values='inline; inline' 60 calcMode='discrete' begin='2.5s' dur='1s' onbegin='after()'/> 61 62 <g transform='translate(30,-10)'> 63 <rect id='r1' y='50' width='25' height='25'/> 64 <rect id='r2' y='80' width='25' height='25'/> 65 <rect id='r3' y='110' width='25' height='25'/> 66 <rect id='r4' y='140' width='25' height='25'/> 67 <rect id='r5' y='170' width='25' height='25'/> 68 <rect id='r6' y='200' width='25' height='25'/> 69 <rect id='r7' y='230' width='25' height='25'/> 70 <rect id='r8' y='260' width='25' height='25'/> 71 </g> 72 73 <g font-size='14' transform='translate(70,-15)'> 74 <text y='72'>Called before a lone interval starts</text> 75 <text y='102'>Called on an animation with no intervals</text> 76 <text y='132'>Called during an interval</text> 77 <text y='162'>Called after a lone interval ends, fill="remove"</text> 78 <text y='192'>Called after a lone interval ends, fill="freeze"</text> 79 <text y='222'>Called with multiple begin values</text> 80 <text y='252'>Called with multiple begin values including "indefinite"</text> 81 <text y='282'>Called with syncbase begin value</text> 82 </g> 83 <script><![CDATA[ 84 var i, ids = 'a1 a2 a3 a4 a5 a6 r1 r2 r3 r4 r5 r6 r7 r8'.split(' '); 85 for (i in ids) { 86 this[ids[i]] = document.getElementById(ids[i]); 87 } 88 89 function before() { 90 try { 91 if (a1.getStartTime() == 1) { 92 r1.setAttributeNS(null, 'fill', 'lime'); 93 } 94 } catch (e) { 95 r1.setAttributeNS(null, 'fill', 'red'); 96 } 97 98 r2.setAttributeNS(null, 'fill', 'red'); 99 try { 100 a3.getStartTime(); 101 } catch (e) { 102 if (e.code == DOMException.INVALID_STATE_ERR) { 103 r2.setAttributeNS(null, 'fill', 'lime'); 104 } 105 } 106 107 try { 108 if (a4.getStartTime() == 1) { 109 r6.setAttributeNS(null, 'fill', 'lime'); 110 } 111 } catch (e) { 112 r6.setAttributeNS(null, 'fill', 'red'); 113 } 114 115 try { 116 if (a5.getStartTime() == 1) { 117 r7.setAttributeNS(null, 'fill', 'lime'); 118 } 119 } catch (e) { 120 r7.setAttributeNS(null, 'fill', 'red'); 121 } 122 123 try { 124 if (a6.getStartTime() == 7) { 125 r8.setAttributeNS(null, 'fill', 'lime'); 126 } 127 } catch (e) { 128 r8.setAttributeNS(null, 'fill', 'red'); 129 } 130 } 131 132 function during() { 133 try { 134 if (a1.getStartTime() == 1) { 135 r3.setAttributeNS(null, 'fill', 'lime'); 136 } 137 } catch (e) { 138 r3.setAttributeNS(null, 'fill', 'red'); 139 } 140 } 141 142 function after() { 143 r4.setAttributeNS(null, 'fill', 'red'); 144 try { 145 a1.getStartTime(); 146 } catch (e) { 147 if (e.code == DOMException.INVALID_STATE_ERR) { 148 r4.setAttributeNS(null, 'fill', 'lime'); 149 } 150 } 151 152 r5.setAttributeNS(null, 'fill', 'red'); 153 try { 154 a2.getStartTime(); 155 } catch (e) { 156 if (e.code == DOMException.INVALID_STATE_ERR) { 157 r5.setAttributeNS(null, 'fill', 'lime'); 158 } 159 } 160 } 161 ]]></script> 162 </g> 163 <g font-family="SVGFreeSansASCII,sans-serif" font-size="32"> 164 <text id="revision" x="10" y="340" stroke="none" 165 fill="black">$Revision: 1.11 $</text> 166 </g> 167 <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000"/> 168 <!-- comment out this watermark once the test is approved --><!-- 169 <g id="draft-watermark"> 170 <rect x="1" y="1" width="478" height="20" fill="red" stroke="black" stroke-width="1"/> 171 <text font-family="SVGFreeSansASCII,sans-serif" font-weight="bold" font-size="20" x="240" 172 text-anchor="middle" y="18" stroke-width="0.5" stroke="black" fill="white">DRAFT</text> 173 </g>--> 174 </svg> 175 </body> 176 </html>