| 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="Peter Graffagnino" status="accepted" |
| 15 |
version="$Revision: 1.6 $" testname="$RCSfile: filters-offset-01-b.svg,v $"> |
| 16 |
<d:testDescription xmlns="http://www.w3.org/1999/xhtml" href="http://www.w3.org/TR/SVG11/filters.html#feOffsetElement"> |
| 17 |
<p> |
| 18 |
The target crosshairs should align with |
| 19 |
lower left bounds of the associated circle. |
| 20 |
The color of each crosshair should match |
| 21 |
the associated circle. |
| 22 |
</p> |
| 23 |
<p> |
| 24 |
Verify the basic capability to handle the feOffset, feMerge and |
| 25 |
feFlood filter nodes. Four copies of a filled circle should appear at |
| 26 |
various offsets and colors. For each circle a reference crosshair is |
| 27 |
drawn at the lower left of the circle to indicate the expected color, |
| 28 |
opacity and position for the filtered element. The targets are drawn |
| 29 |
with the standard svg path element. |
| 30 |
</p> |
| 31 |
<p> |
| 32 |
In addition to feFlood, feMerge, and feOffset, this test uses |
| 33 |
'feComposite' to recolor the SourceGraphic with the feFlood color. |
| 34 |
The source graphic uses 'circle'. The target cross hairs are drawn |
| 35 |
with 'path' and use 'fill' and 'fill-opacity'. |
| 36 |
</p> |
| 37 |
</d:testDescription> |
| 38 |
<d:operatorScript xmlns="http://www.w3.org/1999/xhtml"> |
| 39 |
<p> |
| 40 |
Run the test. No interaction required. |
| 41 |
</p> |
| 42 |
</d:operatorScript> |
| 43 |
<d:passCriteria xmlns="http://www.w3.org/1999/xhtml"> |
| 44 |
<p> |
| 45 |
The rendered image should match the reference image. Additionally, the |
| 46 |
target crosshairs should match the color, lower left corner, and |
| 47 |
opacity of each copy of the filtered circle. |
| 48 |
</p> |
| 49 |
</d:passCriteria> |
| 50 |
</d:SVGTestCase> |
| 51 |
<title id="test-title">$RCSfile: filters-offset-01-b.svg,v $</title> |
| 52 |
<defs> |
| 53 |
<font-face font-family="SVGFreeSansASCII" unicode-range="U+0-7F"> |
| 54 |
<font-face-src> |
| 55 |
<font-face-uri xlink:href="../resources/SVGFreeSans.svg#ascii"/> |
| 56 |
</font-face-src> |
| 57 |
</font-face> |
| 58 |
</defs> |
| 59 |
<g id="test-body-content" font-family="SVGFreeSansASCII,sans-serif" font-size="18"> |
| 60 |
<defs> |
| 61 |
<filter id="FOMTest" filterUnits="objectBoundingBox" x="0" y="0" width="2.5" height="4"> |
| 62 |
|
| 63 |
<feOffset result="Off1" dx="40" dy="30"/> |
| 64 |
<feFlood result="F1" flood-color="#408000" flood-opacity=".8"/> |
| 65 |
<feComposite in2="Off1" operator="in" result="C1"/> |
| 66 |
|
| 67 |
<feOffset in="SourceGraphic" result="Off2" dx="80" dy="60"/> |
| 68 |
<feFlood result="F2" flood-color="#408000" flood-opacity=".6"/> |
| 69 |
<feComposite in2="Off2" operator="in" result="C2"/> |
| 70 |
|
| 71 |
<feOffset in="SourceGraphic" result="Off3" dx="120" dy="90"/> |
| 72 |
<feFlood result="F3" flood-color="#408000" flood-opacity=".4"/> |
| 73 |
<feComposite in2="Off3" operator="in" result="C3"/> |
| 74 |
|
| 75 |
<feMerge> |
| 76 |
<feMergeNode in="C3"/> |
| 77 |
<feMergeNode in="C2"/> |
| 78 |
<feMergeNode in="C1"/> |
| 79 |
<feMergeNode in="SourceGraphic"/> |
| 80 |
</feMerge> |
| 81 |
</filter> |
| 82 |
</defs> |
| 83 |
|
| 84 |
<circle cx="160" cy="50" r="40" fill="#000" filter="url(#FOMTest)"/> |
| 85 |
|
| 86 |
<!-- Add some crosshairs of the same color of the |
| 87 |
flood at the same location as the offset --> |
| 88 |
|
| 89 |
<!-- 20 pixel cross hair at 120,90 --> |
| 90 |
<path fill="#000" transform="translate(120, 90)" d="M-1,-11h2v10h10v2h-10v10h-2v-10h-10v-2h10v-10"/> |
| 91 |
|
| 92 |
<!-- 20 pixel cross hair at 160,120 --> |
| 93 |
<path fill="#408000" fill-opacity=".8" transform="translate(160, 120)" d="M-1,-11h2v10h10v2h-10v10h-2v-10h-10v-2h10v-10"/> |
| 94 |
|
| 95 |
<!-- 20 pixel cross hair at 200,150 --> |
| 96 |
<path fill="#408000" fill-opacity=".6" transform="translate(200, 150)" d="M-1,-11h2v10h10v2h-10v10h-2v-10h-10v-2h10v-10"/> |
| 97 |
|
| 98 |
<!-- 20 pixel cross hair at 240,180 --> |
| 99 |
<path fill="#408000" fill-opacity=".4" transform="translate(240, 180)" d="M-1,-11h2v10h10v2h-10v10h-2v-10h-10v-2h10v-10"/> |
| 100 |
|
| 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> |