| 1 |
<svg version="1.1" baseProfile="basic" 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="SVGWG" author="Jon Ferraiolo" status="accepted" |
| 15 |
version="$Revision: 1.5 $" testname="$RCSfile: interact-order-02-b.svg,v $"> |
| 16 |
<d:testDescription xmlns="http://www.w3.org/1999/xhtml" href="http://www.w3.org/TR/SVG11/interact.html#UIEventProcessing"> |
| 17 |
<p> |
| 18 |
Test event bubbling of event attributes, part b. |
| 19 |
</p> |
| 20 |
<p> |
| 21 |
The two circles test whether events are handled in the |
| 22 |
proper order. Events listeners and event attributes are processed |
| 23 |
before hyperlink processing, which is processed before text selection. |
| 24 |
|
| 25 |
</p> |
| 26 |
</d:testDescription> |
| 27 |
<d:operatorScript xmlns="http://www.w3.org/1999/xhtml"> |
| 28 |
<p>Click on the first circle, then the second, and lastly the new third circle.</p> |
| 29 |
</d:operatorScript> |
| 30 |
<d:passCriteria xmlns="http://www.w3.org/1999/xhtml"> |
| 31 |
<p> |
| 32 |
Clicking on the first circle should change the circle from black to red. Clicking |
| 33 |
on the second circle should take you to another SVG file titled "Hyperlink target for |
| 34 |
interact-order-02.svg. Cliking on the circle in this SVG file should return you to the orginal |
| 35 |
two circles. |
| 36 |
</p> |
| 37 |
</d:passCriteria> |
| 38 |
</d:SVGTestCase> |
| 39 |
<title id="test-title">$RCSfile: interact-order-02-b.svg,v $</title> |
| 40 |
<defs> |
| 41 |
<font-face font-family="SVGFreeSansASCII" unicode-range="U+0-7F"> |
| 42 |
<font-face-src> |
| 43 |
<font-face-uri xlink:href="../resources/SVGFreeSans.svg#ascii"/> |
| 44 |
</font-face-src> |
| 45 |
</font-face> |
| 46 |
</defs> |
| 47 |
<g id="test-body-content" font-family="SVGFreeSansASCII,sans-serif" font-size="18"> |
| 48 |
<defs> |
| 49 |
<script type="text/ecmascript"><![CDATA[ |
| 50 |
|
| 51 |
function bubbleYes(evt, color){ |
| 52 |
// Get Document |
| 53 |
var target = evt.target; |
| 54 |
target.setAttribute('fill', '' +color); |
| 55 |
} |
| 56 |
function bubbleNo(evt, color){ |
| 57 |
// Get Document |
| 58 |
var target = evt.target; |
| 59 |
target.setAttribute('fill', '' +color); |
| 60 |
evt.stopPropagation(); |
| 61 |
evt.preventDefault(); |
| 62 |
} |
| 63 |
|
| 64 |
]]></script> |
| 65 |
</defs> |
| 66 |
<text font-family="Arial" font-size="40" x="60" y="45">Event bubbling - b</text> |
| 67 |
<g id="background"> |
| 68 |
<rect fill="#EEE" stroke="#000" x="10" y="60" width="460" height="120"/> |
| 69 |
<rect fill="#FFF" stroke="#000" x="10" y="180" width="460" height="120"/> |
| 70 |
</g> |
| 71 |
<g fill="#000" font-family="Arial" font-size="40"> |
| 72 |
<!-- Test the order of events --> |
| 73 |
<!-- Ensure that events get the event before the hyperlink. --> |
| 74 |
<a xlink:href="../images/interact-order-02-b-targ.svg"> |
| 75 |
<circle onclick="bubbleNo(evt, 'red')" onmouseout="bubbleNo(evt, 'inherit')" cx="70" cy="120" r="50"/> |
| 76 |
<circle onclick="bubbleYes(evt, 'blue')" onmouseout="bubbleNo(evt, 'inherit')" cx="70" cy="240" r="50"/> |
| 77 |
</a> |
| 78 |
<text x="135" y="110"> |
| 79 |
Click on circle, |
| 80 |
</text> |
| 81 |
<text x="135" y="150"> |
| 82 |
circle turns red |
| 83 |
</text> |
| 84 |
<text x="135" y="230"> |
| 85 |
Click on circle, |
| 86 |
</text> |
| 87 |
<text x="135" y="270"> |
| 88 |
hyperlink |
| 89 |
</text> |
| 90 |
</g> |
| 91 |
</g> |
| 92 |
<g font-family="SVGFreeSansASCII,sans-serif" font-size="32"> |
| 93 |
<text id="revision" x="10" y="340" stroke="none" fill="black">$Revision: 1.5 $</text> |
| 94 |
</g> |
| 95 |
<rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/> |
| 96 |
<!-- comment out this watermark once the test is approved --> |
| 97 |
<!--<g id="draft-watermark"> |
| 98 |
<rect x="1" y="1" width="478" height="20" fill="red" stroke="black" stroke-width="1"/> |
| 99 |
<text font-family="SVGFreeSansASCII,sans-serif" font-weight="bold" font-size="20" x="240" |
| 100 |
text-anchor="middle" y="18" stroke-width="0.5" stroke="black" fill="white">DRAFT</text> |
| 101 |
</g>--> |
| 102 |
</svg> |