| 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="CL" author="LH" status="accepted" |
| 15 |
version="$Revision: 1.7 $" testname="$RCSfile: masking-path-01-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 to see if the basic clipping works using the clipPath element |
| 19 |
and the clip-path property. |
| 20 |
</p> |
| 21 |
<p> |
| 22 |
This test uses the following elements : <clipPath> and the following |
| 23 |
properties : clip-path. |
| 24 |
</p> |
| 25 |
</d:testDescription> |
| 26 |
<d:operatorScript xmlns="http://www.w3.org/1999/xhtml"> |
| 27 |
<p> |
| 28 |
Run the test. No interaction required. |
| 29 |
</p> |
| 30 |
</d:operatorScript> |
| 31 |
<d:passCriteria xmlns="http://www.w3.org/1999/xhtml"> |
| 32 |
<p> |
| 33 |
The test at the top shows an orange rectangle (with black stroke) being clipped by another rectangle. |
| 34 |
So only the middle portion of the orange rectangle should be visible. Also the black stroke should |
| 35 |
only be visible along the top and bottom edge of the rectangle. |
| 36 |
</p> |
| 37 |
<p> |
| 38 |
The example at the bottom has a group containing a text string and two rectangles. The group |
| 39 |
has a clipping path defined using two overlapping rectangles. Of concern is the overlapping area |
| 40 |
shared by the two rectangles. There should not be holes in this overlapping area, the |
| 41 |
clip region is the union of the two rectangles. For clarity, |
| 42 |
guide rectangles in grey show the position of the clipping rectangles. |
| 43 |
</p> |
| 44 |
<p> |
| 45 |
The rendered picture should match the reference image exactly, except for possible |
| 46 |
variations in the labelling text (per CSS2 rules). |
| 47 |
</p> |
| 48 |
</d:passCriteria> |
| 49 |
</d:SVGTestCase> |
| 50 |
<title id="test-title">$RCSfile: masking-path-01-b.svg,v $</title> |
| 51 |
<defs> |
| 52 |
<font-face font-family="SVGFreeSansASCII" unicode-range="U+0-7F"> |
| 53 |
<font-face-src> |
| 54 |
<font-face-uri xlink:href="../resources/SVGFreeSans.svg#ascii"/> |
| 55 |
</font-face-src> |
| 56 |
</font-face> |
| 57 |
</defs> |
| 58 |
<g id="test-body-content" font-family="SVGFreeSansASCII,sans-serif" font-size="18"> |
| 59 |
<g shape-rendering="geometricPrecision"> |
| 60 |
<!--text font-size="14" x="10" y="20">Test for clipping using clipPath element</text--> |
| 61 |
<defs> |
| 62 |
<clipPath id="clip1"> |
| 63 |
<rect x="200" y="10" width="60" height="100"/> |
| 64 |
</clipPath> |
| 65 |
<clipPath id="clip2"> |
| 66 |
<rect x="90" y="150" width="175" height="100"/> |
| 67 |
<rect x="225" y="160" width="95" height="75"/> |
| 68 |
</clipPath> |
| 69 |
</defs> |
| 70 |
<rect x="20" y="20" width="440" height="60" fill="orange" stroke="black" stroke-width="5" clip-path="url(#clip1)"/> |
| 71 |
<text font-size="30" x="20" y="130">Rectangle being clipped</text> |
| 72 |
<g clip-path="url(#clip2)"> |
| 73 |
<rect x="115" y="190" width="225" height="40" fill="aqua" stroke="blue" stroke-width="5"/> |
| 74 |
<rect x="115" y="240" width="225" height="40" fill="lime" stroke="green" stroke-width="5"/> |
| 75 |
<text font-size="30" x="115" y="180">Line of text to be clipped</text> |
| 76 |
</g> |
| 77 |
<text font-size="30" x="20" y="280">Group being clipped</text> |
| 78 |
<!-- show the two rects and the overlap area --> |
| 79 |
<g fill="none" stroke="#999" stroke-width="2"> |
| 80 |
<rect x="90" y="150" width="175" height="100"/> |
| 81 |
<rect x="225" y="160" width="95" height="75"/> |
| 82 |
</g> |
| 83 |
</g> |
| 84 |
</g> |
| 85 |
<g font-family="SVGFreeSansASCII,sans-serif" font-size="32"> |
| 86 |
<text id="revision" x="10" y="340" stroke="none" fill="black">$Revision: 1.7 $</text> |
| 87 |
</g> |
| 88 |
<rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/> |
| 89 |
<!-- comment out this watermark once the test is approved --> |
| 90 |
<!--<g id="draft-watermark"> |
| 91 |
<rect x="1" y="1" width="478" height="20" fill="red" stroke="black" stroke-width="1"/> |
| 92 |
<text font-family="SVGFreeSansASCII,sans-serif" font-weight="bold" font-size="20" x="240" |
| 93 |
text-anchor="middle" y="18" stroke-width="0.5" stroke="black" fill="white">DRAFT</text> |
| 94 |
</g>--> |
| 95 |
</svg> |