| 1 |
<svg id="svg-root" width="100%" height="100%" viewBox="0 0 480 360" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> |
| 2 |
<!--======================================================================--> |
| 3 |
<!--= SVG 1.1 2nd Edition Test Case =--> |
| 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/" template-version="1.4" reviewer="CL" author="Microsoft" status="accepted" version="$Revision: 1.2 $" testname="$RCSfile: masking-path-14-f.svg,v $"> |
| 12 |
<d:testDescription xmlns="http://www.w3.org/1999/xhtml" href="http://dev.w3.org/SVG/profiles/1.1F2/publish/masking.html#EstablishingANewClippingPath"> |
| 13 |
<p> |
| 14 |
The 'clipPath' element itself and its children elements do not inherit clipping paths from ancestors of the 'clipPath' element. |
| 15 |
</p> |
| 16 |
<p> |
| 17 |
Overlay a red 'rect' with a black 'rect' of a larger size. Define a 'clipPath' with a 'rect' of the same size as the red 'rect', but different 'x' and 'y' offsets. Reference that 'clipPath' from a 'g' element containing another 'clipPath' element. In this latter 'clipPath', specify a 'rect' of the same size and same 'x' and 'y' offsets as the red 'rect', and reference it from the black 'rect' element. Reference the same 'clipPath' elements, but this time with a black 'rect' which overlays a red 'rect' of a larger size. If there is no red on the page, the first 'clipPath' was not inherited by the second 'clipPath'. |
| 18 |
</p> |
| 19 |
</d:testDescription> |
| 20 |
<d:operatorScript xmlns="http://www.w3.org/1999/xhtml"> |
| 21 |
<p> |
| 22 |
Run the test. No interaction required |
| 23 |
</p> |
| 24 |
</d:operatorScript> |
| 25 |
<d:passCriteria xmlns="http://www.w3.org/1999/xhtml"> |
| 26 |
<p> |
| 27 |
Test passes if there are two black rectangles, and there is no red visible on the page. |
| 28 |
</p> |
| 29 |
</d:passCriteria> |
| 30 |
</d:SVGTestCase> |
| 31 |
<title id="test-title">$RCSfile: masking-path-14-f.svg,v $</title> |
| 32 |
<defs> |
| 33 |
<font-face |
| 34 |
font-family="SVGFreeSansASCII" |
| 35 |
unicode-range="U+0-7F"> |
| 36 |
<font-face-src> |
| 37 |
<font-face-uri xlink:href="../resources/SVGFreeSans.svg#ascii"/> |
| 38 |
</font-face-src> |
| 39 |
</font-face> |
| 40 |
</defs> |
| 41 |
<g id="test-body-content" font-family="SVGFreeSansASCII,sans-serif" font-size="18"> |
| 42 |
<clipPath id="testClipPathAncestor"> |
| 43 |
<rect x="50" y="50" width="50" height="50" /> |
| 44 |
</clipPath> |
| 45 |
<g clip-path="url(#testClipPathAncestor)"> |
| 46 |
<clipPath id="testClipPath"> |
| 47 |
<rect x="0" y="0" width="50" height="50" /> |
| 48 |
</clipPath> |
| 49 |
</g> |
| 50 |
<svg x="0" y="0" width="200" height="200"> |
| 51 |
<rect x="0" y="0" width="50" height="50" fill="red" /> |
| 52 |
<rect x="0" y="0" width="200" height="200" fill="black" clip-path="url(#testClipPath)" /> |
| 53 |
</svg> |
| 54 |
<svg x="200" y="0" width="200" height="200"> |
| 55 |
<rect x="0" y="0" width="200" height="200" fill="red" clip-path="url(#testClipPath)" /> |
| 56 |
<rect x="0" y="0" width="50" height="50" fill="black" /> |
| 57 |
</svg> |
| 58 |
</g> |
| 59 |
<g font-family="SVGFreeSansASCII,sans-serif" font-size="32"> |
| 60 |
<text id="revision" x="10" y="340" stroke="none" |
| 61 |
fill="black">$Revision: 1.2 $</text> |
| 62 |
</g> |
| 63 |
<rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000"/> |
| 64 |
<!-- comment out this watermark once the test is approved --> |
| 65 |
<!-- |
| 66 |
<g id="draft-watermark"> |
| 67 |
<rect x="1" y="1" width="478" height="20" fill="red" stroke="black" stroke-width="1"/> |
| 68 |
<text font-family="SVGFreeSansASCII,sans-serif" font-weight="bold" font-size="20" x="240" |
| 69 |
text-anchor="middle" y="18" stroke-width="0.5" stroke="black" fill="white">DRAFT</text> |
| 70 |
</g> |
| 71 |
--> |
| 72 |
</svg> |