| 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-03-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 c. |
| 19 |
</p> |
| 20 |
<p> |
| 21 |
The three strings tests event handling behavior on text. |
| 22 |
Text selection only is available after event listeners and event |
| 23 |
attributes have been processed, and after hyperlink processing |
| 24 |
has occurred. |
| 25 |
</p> |
| 26 |
</d:testDescription> |
| 27 |
<d:operatorScript xmlns="http://www.w3.org/1999/xhtml"> |
| 28 |
<p> |
| 29 |
First, click the string on the first line; then the second. Lastly, all text should be selectable. |
| 30 |
</p> |
| 31 |
</d:operatorScript> |
| 32 |
<d:passCriteria xmlns="http://www.w3.org/1999/xhtml"> |
| 33 |
<p> |
| 34 |
The supplemental text below the text strings describes what should occur. |
| 35 |
</p> |
| 36 |
</d:passCriteria> |
| 37 |
</d:SVGTestCase> |
| 38 |
<title id="test-title">$RCSfile: interact-order-03-b.svg,v $</title> |
| 39 |
<defs> |
| 40 |
<font-face font-family="SVGFreeSansASCII" 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 |
<defs> |
| 48 |
<script type="text/ecmascript"><![CDATA[ |
| 49 |
|
| 50 |
function bubbleYes(evt, color){ |
| 51 |
// Get Document |
| 52 |
var target = evt.target; |
| 53 |
target.setAttribute('fill', '' +color); |
| 54 |
} |
| 55 |
function bubbleNo(evt, color){ |
| 56 |
// Get Document |
| 57 |
var target = evt.target; |
| 58 |
target.setAttribute('fill', '' +color); |
| 59 |
evt.stopPropagation(); |
| 60 |
evt.preventDefault(); |
| 61 |
} |
| 62 |
|
| 63 |
]]></script> |
| 64 |
</defs> |
| 65 |
<text font-family="Arial" font-size="40" x="60" y="40">Event bubbling - c</text> |
| 66 |
<g id="background"> |
| 67 |
<rect fill="#EEE" stroke="#000" x="10" y="55" width="460" height="230"/> |
| 68 |
</g> |
| 69 |
<g fill="#000" font-family="Arial" font-size="40"> |
| 70 |
<!-- Ensure that events get the event before the hyperlink which |
| 71 |
happens before text selection --> |
| 72 |
<a xlink:href="../images/interact-order-03-b-targ.svg" font-size="40"> |
| 73 |
<text x="20" y="90" onclick="bubbleNo(evt, 'red')" onmouseout="bubbleNo(evt, 'inherit')"> |
| 74 |
String turns red on click |
| 75 |
</text> |
| 76 |
<g onclick="bubbleYes(evt, 'blue')" onmouseout="bubbleYes(evt, 'inherit')"> |
| 77 |
<text x="60" y="160"> |
| 78 |
String hyperlinks to |
| 79 |
</text> |
| 80 |
<text x="20" y="200" font-size="33"> |
| 81 |
interact-order-03b-targ.svg |
| 82 |
</text> |
| 83 |
</g> |
| 84 |
<text x="30" y="270" onclick="bubbleNo(evt, 'inherit')"> |
| 85 |
All strings are selectable. |
| 86 |
</text> |
| 87 |
</a> |
| 88 |
</g> |
| 89 |
</g> |
| 90 |
<g font-family="SVGFreeSansASCII,sans-serif" font-size="32"> |
| 91 |
<text id="revision" x="10" y="340" stroke="none" fill="black">$Revision: 1.5 $</text> |
| 92 |
</g> |
| 93 |
<rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/> |
| 94 |
<!-- comment out this watermark once the test is approved --> |
| 95 |
<!--<g id="draft-watermark"> |
| 96 |
<rect x="1" y="1" width="478" height="20" fill="red" stroke="black" stroke-width="1"/> |
| 97 |
<text font-family="SVGFreeSansASCII,sans-serif" font-weight="bold" font-size="20" x="240" |
| 98 |
text-anchor="middle" y="18" stroke-width="0.5" stroke="black" fill="white">DRAFT</text> |
| 99 |
</g>--> |
| 100 |
</svg> |