| 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.7 $" testname="$RCSfile: masking-path-03-b.svg,v $"> |
| 16 |
<d:testDescription xmlns="http://www.w3.org/1999/xhtml" href="http://www.w3.org/TR/SVG11/masking.html#ClippingPaths"> |
| 17 |
<p> |
| 18 |
Test 'overflow'/'clip' on outermost and inner 'svg' elements. |
| 19 |
</p> |
| 20 |
<p> |
| 21 |
There are two parts to the test. The first part tests viewport clipping |
| 22 |
on outermost 'svg' elements. The second part tests viewport clipping |
| 23 |
on inner 'svg' elements. |
| 24 |
</p> |
| 25 |
<p> |
| 26 |
The test case also tests the initial value of the 'overflow' property |
| 27 |
to ensure that it is set to 'hidden' for all 'svg' elements. |
| 28 |
Tester should zoom out and/or pan to check this. |
| 29 |
</p> |
| 30 |
<p> |
| 31 |
To test clipping to the outermost 'svg' element, |
| 32 |
a rectangle with a light blue interior, a light red border and a black |
| 33 |
string that says "Clip to outer 'svg'" is painted four times such that |
| 34 |
it will overflow each of the top, left, right and bottom |
| 35 |
sides of the bounds of the outermost 'svg' element, respectively. |
| 36 |
</p> |
| 37 |
<p> |
| 38 |
To test clipping to inner 'svg' elements, a rectangle with a light red |
| 39 |
interior, a light blue border and a black string that says "Clip to |
| 40 |
inner 'svg'" is painted four times such that it will overflow each of |
| 41 |
the top, left, right and bottom sides of the bounds of an inner 'svg' |
| 42 |
element, respectively. |
| 43 |
</p> |
| 44 |
<p> |
| 45 |
Note that minor text layout differences, as are permissible under CSS2 |
| 46 |
rules, can lead to slightly different visual results regarding where |
| 47 |
the text strings get clipped. |
| 48 |
</p> |
| 49 |
</d:testDescription> |
| 50 |
<d:operatorScript xmlns="http://www.w3.org/1999/xhtml"> |
| 51 |
<p> |
| 52 |
Run the test. No interaction required. |
| 53 |
</p> |
| 54 |
</d:operatorScript> |
| 55 |
<d:passCriteria xmlns="http://www.w3.org/1999/xhtml"> |
| 56 |
<p>The test passes if:</p> |
| 57 |
<ul> |
| 58 |
<li>The four "Outer Clip" boxed strings must not render outside the |
| 59 |
outermost 'svg' element (the 480x360 rectangular viewport) and |
| 60 |
must continue to be clipped to this viewport if the image is zoomed in or out, |
| 61 |
or panned.</li> |
| 62 |
<li>The four "Inner Clip" boxed strings must not render outside the |
| 63 |
bounds of the green rectangle.</li> |
| 64 |
</ul> |
| 65 |
</d:passCriteria> |
| 66 |
</d:SVGTestCase> |
| 67 |
<title id="test-title">$RCSfile: masking-path-03-b.svg,v $</title> |
| 68 |
<defs> |
| 69 |
<font-face font-family="SVGFreeSansASCII" unicode-range="U+0-7F"> |
| 70 |
<font-face-src> |
| 71 |
<font-face-uri xlink:href="../resources/SVGFreeSans.svg#ascii"/> |
| 72 |
</font-face-src> |
| 73 |
</font-face> |
| 74 |
</defs> |
| 75 |
<g id="test-body-content" font-family="SVGFreeSansASCII,sans-serif" font-size="18"> |
| 76 |
<g shape-rendering="geometricPrecision"> |
| 77 |
<!--text font-size="18" text-anchor="middle" x="240" y="70">Test 'overflow'/'clip' on outermost and inner 'svg' elements</text--> |
| 78 |
<text font-size="18" x="10" y="70">Test 'overflow'/'clip' on outermost and inner 'svg' elements</text> |
| 79 |
<!-- Test initial value for 'overflow' property (i.e., hidden) |
| 80 |
on outermost 'svg' --> |
| 81 |
<g font-size="48" stroke-width="2"> |
| 82 |
<g transform="translate(115,-20)"> |
| 83 |
<rect width="250" height="60" fill="#ccccff" stroke="#ff8888"/> |
| 84 |
<text x="15" y="45">Outer Clip</text> |
| 85 |
</g> |
| 86 |
<g transform="translate(-175,150)"> |
| 87 |
<rect width="250" height="60" fill="#ccccff" stroke="#ff8888"/> |
| 88 |
<text x="15" y="45">Outer Clip</text> |
| 89 |
</g> |
| 90 |
<g transform="translate(405,150)"> |
| 91 |
<rect width="250" height="60" fill="#ccccff" stroke="#ff8888"/> |
| 92 |
<text x="15" y="45">Outer Clip</text> |
| 93 |
</g> |
| 94 |
<g transform="translate(115,330)"> |
| 95 |
<rect width="250" height="60" fill="#ccccff" stroke="#ff8888"/> |
| 96 |
<text x="15" y="45">Outer Clip</text> |
| 97 |
</g> |
| 98 |
</g> |
| 99 |
<!-- Test initial value for 'overflow' property (i.e., hidden) |
| 100 |
on inner 'svg' --> |
| 101 |
<rect x="115" y="100" width="250" height="160" fill="none" stroke="#006600" stroke-width="5"/> |
| 102 |
<svg xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" x="115" y="100" width="250" height="160"> |
| 103 |
<g font-size="32" stroke-width="2"> |
| 104 |
<g transform="translate(50,-15)"> |
| 105 |
<rect width="150" height="35" fill="#ffaaaa" stroke="#6666ff"/> |
| 106 |
<text x="6" y="26">Inner Clip</text> |
| 107 |
</g> |
| 108 |
<g transform="translate(-50,62.5)"> |
| 109 |
<rect width="150" height="35" fill="#ffaaaa" stroke="#6666ff"/> |
| 110 |
<text x="6" y="26">Inner Clip</text> |
| 111 |
</g> |
| 112 |
<g transform="translate(150,62.5)"> |
| 113 |
<rect width="150" height="35" fill="#ffaaaa" stroke="#6666ff"/> |
| 114 |
<text x="6" y="26">Inner Clip</text> |
| 115 |
</g> |
| 116 |
<g transform="translate(50,140)"> |
| 117 |
<rect width="150" height="35" fill="#ffaaaa" stroke="#6666ff"/> |
| 118 |
<text x="6" y="26">Inner Clip</text> |
| 119 |
</g> |
| 120 |
</g> |
| 121 |
</svg> |
| 122 |
</g> |
| 123 |
</g> |
| 124 |
<g font-family="SVGFreeSansASCII,sans-serif" font-size="32"> |
| 125 |
<text id="revision" x="10" y="340" stroke="none" fill="black">$Revision: 1.7 $</text> |
| 126 |
</g> |
| 127 |
<rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/> |
| 128 |
<!-- comment out this watermark once the test is approved --> |
| 129 |
<!--<g id="draft-watermark"> |
| 130 |
<rect x="1" y="1" width="478" height="20" fill="red" stroke="black" stroke-width="1"/> |
| 131 |
<text font-family="SVGFreeSansASCII,sans-serif" font-weight="bold" font-size="20" x="240" |
| 132 |
text-anchor="middle" y="18" stroke-width="0.5" stroke="black" fill="white">DRAFT</text> |
| 133 |
</g>--> |
| 134 |
</svg> |