Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/css-masking/clip-path-svg-content/clip-path-precision-001.svg - WPT Dashboard Interop Dashboard
<g id="testmeta">
<title>CSS Masking: clipPath precision</title>
<html:link rel="author" title="Dirk Schulze" href="mailto:dschulze@adobe.com"/>
<html:link rel="match" href="reference/clip-path-precision-001-ref.svg" />
<metadata class="flags">svg</metadata>
<desc class="assert">Various comma values should no influence the precision
of the clipPath element. The test should not show any red outlines
around the boxes.</desc>
</g>
<defs>
<g id="paths">
<path d="M10 10 h20 v20 h-20 v-20 m1 1 v18 h18 v-18 h-18"/>
<rect x="19" y="19" width="2" height="2" />
<rect x="5.51" y="0.51" width="2" height="32.3" fill="white"/>
<rect x="35.4" y="0.51" width="2" height="32.3" fill="white"/>
</g>
</defs>
<mask id="mask">
<use xlink:href="#paths" fill="white" x="60" />
</mask>
<clipPath id="clipper">
<path d="M40 10 h20 v20 h-20 v-20 m1 1 v18 h18 v-18 h-18"/>
<rect x="49" y="19" width="2" height="2" />
<rect x="35.51" y="0.51" width="2" height="32.3" />
<rect x="65.4" y="0.51" width="2" height="32.3" />
</clipPath>
<use xlink:href="#paths" fill="green" />
<g clip-path="url(#clipper)">
<rect fill="red" x="38" y="8" width="24" height="24" />
<use xlink:href="#paths" fill="green" x="30" />
</g>
<g mask="url(#mask)">
<rect fill="red" x="68" y="8" width="24" height="24" />
<use xlink:href="#paths" fill="green" x="60" />
</g>
</svg>