| 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="accepted" |
| 15 |
version="$Revision: 1.6 $" testname="$RCSfile: animate-elem-52-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 eventbase targets. |
| 19 |
</p> |
| 20 |
<p> |
| 21 |
The test consists of 4 rectangles named A, B, C, D. The D rectangle contains |
| 22 |
three animations changing the color of the animation target. |
| 23 |
Each animation applies to one of the other rectangles |
| 24 |
by using xlink:href. Clicking on rect A should change it's |
| 25 |
color immediately, clicking B changes its color after 2 seconds, |
| 26 |
clicking C changes its color after 4 seconds and clicking D shows no visible change |
| 27 |
(although D contains the animations the event target for each |
| 28 |
animation is the referenced rectangle, this rectangle is also the |
| 29 |
animation target.) |
| 30 |
</p> |
| 31 |
<p> |
| 32 |
The following sections in the SMIL Animation spec (http://www.w3.org/TR/smil-animation/) |
| 33 |
are relevant as confirmation of this test: |
| 34 |
The SMIL spec(3.6.7 subsection "Event Values") states that "If the |
| 35 |
Eventbase-element term is missing, the event-base element is defined to |
| 36 |
be the target element of the animation" |
| 37 |
The SMIL spec (3.1 subsection "The target element") says that the |
| 38 |
animation target may be defined explicitly thru the targetElement IDREF |
| 39 |
or href URI. |
| 40 |
So in this test, the animation target is defined through |
| 41 |
xlink:href and the event base per definition is then also this |
| 42 |
referenced element. |
| 43 |
</p> |
| 44 |
</d:testDescription> |
| 45 |
<d:operatorScript xmlns="http://www.w3.org/1999/xhtml"> |
| 46 |
<p>Run the test. Click on each of the four blue rectangles from left to right.</p> |
| 47 |
</d:operatorScript> |
| 48 |
<d:passCriteria xmlns="http://www.w3.org/1999/xhtml"> |
| 49 |
<p>The test passes if all of the following conditions are met:</p> |
| 50 |
<ul> |
| 51 |
<li>the A rectangle turns yellow immediately when clicked</li> |
| 52 |
<li>the B rectangle turns yellow two seconds after being clicked</li> |
| 53 |
<li>the C rectangle turns yellow four seconds after being clicked</li> |
| 54 |
<li>at the time the C rectangle turns yellow, the D rectangle is still blue</li> |
| 55 |
</ul> |
| 56 |
</d:passCriteria> |
| 57 |
</d:SVGTestCase> |
| 58 |
<title id="test-title">$RCSfile: animate-elem-52-t.svg,v $</title> |
| 59 |
<defs> |
| 60 |
<font-face font-family="SVGFreeSansASCII" unicode-range="U+0-7F"> |
| 61 |
<font-face-src> |
| 62 |
<font-face-uri xlink:href="../resources/SVGFreeSans.svg#ascii"/> |
| 63 |
</font-face-src> |
| 64 |
</font-face> |
| 65 |
</defs> |
| 66 |
<g id="test-body-content" font-family="SVGFreeSansASCII,sans-serif" font-size="18"> |
| 67 |
<text x="65" y="50" font-size="30" stroke="none" fill="black">A</text> |
| 68 |
<text x="165" y="50" font-size="30" stroke="none" fill="black">B</text> |
| 69 |
<text x="265" y="50" font-size="30" stroke="none" fill="black">C</text> |
| 70 |
<text x="365" y="50" font-size="30" stroke="none" fill="black">D</text> |
| 71 |
|
| 72 |
<g transform="translate(0,45)"> |
| 73 |
<g id="A" fill="rgb(126,143,250)"> |
| 74 |
<rect x="30" y="15" rx="5" ry="5" width="90" height="40" stroke="#000000" fill="inherit" stroke-width="2"/> |
| 75 |
<text x="50" y="40" font-size="20" stroke="none" fill="black">click A</text> |
| 76 |
</g> |
| 77 |
|
| 78 |
<g id="B" fill="rgb(126,143,250)"> |
| 79 |
<rect x="130" y="15" rx="5" ry="5" width="90" height="40" stroke="#000000" fill="inherit" stroke-width="2"/> |
| 80 |
<text x="135" y="40" font-size="20" stroke="none" fill="black">click B+2</text> |
| 81 |
</g> |
| 82 |
|
| 83 |
<g id="C" fill="rgb(126,143,250)"> |
| 84 |
<rect x="230" y="15" rx="5" ry="5" width="90" height="40" stroke="#000000" fill="inherit" stroke-width="2"/> |
| 85 |
<text x="235" y="40" font-size="20" stroke="none" fill="black">click C+4</text> |
| 86 |
</g> |
| 87 |
|
| 88 |
<g fill="rgb(126,143,250)"> |
| 89 |
<rect x="330" y="15" rx="5" ry="5" width="90" height="40" stroke="#000000" fill="inherit" stroke-width="2"/> |
| 90 |
<text x="350" y="40" font-size="20" stroke="none" fill="black">never</text> |
| 91 |
<set begin="click" fill="freeze" xlink:href="#A" attributeName="fill" to="yellow"/> |
| 92 |
<set begin="click+2" fill="freeze" xlink:href="#B" attributeName="fill" to="yellow"/> |
| 93 |
<set begin="click+4" fill="freeze" xlink:href="#C" attributeName="fill" to="yellow"/> |
| 94 |
</g> |
| 95 |
</g> |
| 96 |
|
| 97 |
<text x="15" y="175" font-size="28">Test of Eventbase targets.</text> |
| 98 |
<text x="15" y="245" font-size="18">Note that clicking rect D should give no result.</text> |
| 99 |
<text x="15" y="205" font-size="18">Clicking a rectangle should change its color at the </text> |
| 100 |
<text x="15" y="225" font-size="18">time for the click + delay as indicated in each rect.</text> |
| 101 |
</g> |
| 102 |
<g font-family="SVGFreeSansASCII,sans-serif" font-size="32"> |
| 103 |
<text id="revision" x="10" y="340" stroke="none" fill="black">$Revision: 1.6 $</text> |
| 104 |
</g> |
| 105 |
<rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/> |
| 106 |
<!-- comment out this watermark once the test is approved --> |
| 107 |
<!--<g id="draft-watermark"> |
| 108 |
<rect x="1" y="1" width="478" height="20" fill="red" stroke="black" stroke-width="1"/> |
| 109 |
<text font-family="SVGFreeSansASCII,sans-serif" font-weight="bold" font-size="20" x="240" |
| 110 |
text-anchor="middle" y="18" stroke-width="0.5" stroke="black" fill="white">DRAFT</text> |
| 111 |
</g>--> |
| 112 |
</svg> |