| 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.4 $" testname="$RCSfile: interact-pointer-01-t.svg,v $"> |
| 14 |
<d:testDescription xmlns="http://www.w3.org/1999/xhtml" href="http://www.w3.org/TR/SVG11/interact.html#PointerEventsProperty"> |
| 15 |
<p> |
| 16 |
This tests that zero opacity pixels in a mask do not affect |
| 17 |
hit testing for the purpose of pointer event targetting. |
| 18 |
</p> |
| 19 |
</d:testDescription> |
| 20 |
<d:operatorScript xmlns="http://www.w3.org/1999/xhtml"> |
| 21 |
<p> |
| 22 |
After loading the test, a rectangle will be displayed. |
| 23 |
Move the pointer over the rectangle, and it will change color |
| 24 |
to indicate whether the test was passed. |
| 25 |
</p> |
| 26 |
</d:operatorScript> |
| 27 |
<d:passCriteria xmlns="http://www.w3.org/1999/xhtml"> |
| 28 |
<p> |
| 29 |
If the rectangle turns green once the pointing device is moved over it, |
| 30 |
the test was passed. If instead it turns red (or remains black), |
| 31 |
then the test failed. If the rectangle was initially red when |
| 32 |
the document was loaded, then that also indicates that the test failed. |
| 33 |
</p> |
| 34 |
</d:passCriteria> |
| 35 |
</d:SVGTestCase> |
| 36 |
<title id="test-title">$RCSfile: interact-pointer-01-t.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='10' y='40' font-size='18'>Test pointer events with zero opacity mask pixels</text> |
| 49 |
|
| 50 |
<mask id='m' maskUnits='userSpaceOnUse' x='10' y='80' width='50' height='50'/> |
| 51 |
<rect id='r' x='10' y='80' width='50' height='50' onmouseover='report(false)'/> |
| 52 |
<rect x='10' y='80' width='50' height='50' mask='url(#m)' fill='red' onmouseover='report(true)'/> |
| 53 |
|
| 54 |
<g id='g'> |
| 55 |
<text id='t' x='10' y='150' font-size='13'>Move the pointing device over the rectangle.</text> |
| 56 |
<text id='t2' x='10' y='166' font-size='13'>If it is red, you've already failed.</text> |
| 57 |
</g> |
| 58 |
|
| 59 |
<script> |
| 60 |
function report(pass) { |
| 61 |
document.getElementById('r').setAttribute('fill', pass ? 'green' : 'red'); |
| 62 |
document.getElementById('t').firstChild.nodeValue = pass ? "If the rectangle is green, you've passed! Otherwise, you've failed." : "You've failed."; |
| 63 |
document.getElementById('g').removeChild(document.getElementById('t2')); |
| 64 |
} |
| 65 |
</script> |
| 66 |
</g> |
| 67 |
<g font-family="SVGFreeSansASCII,sans-serif" font-size="32"> |
| 68 |
<text id="revision" x="10" y="340" stroke="none" |
| 69 |
fill="black">$Revision: 1.4 $</text> |
| 70 |
</g> |
| 71 |
<rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000"/> |
| 72 |
<!-- comment out this watermark once the test is approved --><!-- |
| 73 |
<g id="draft-watermark"> |
| 74 |
<rect x="1" y="1" width="478" height="20" fill="red" stroke="black" stroke-width="1"/> |
| 75 |
<text font-family="SVGFreeSansASCII,sans-serif" font-weight="bold" font-size="20" x="240" |
| 76 |
text-anchor="middle" y="18" stroke-width="0.5" stroke="black" fill="white">DRAFT</text> |
| 77 |
</g>--> |
| 78 |
</svg> |