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/clip-path-union-trailing-moveto.html - WPT Dashboard Interop Dashboard
<!doctype html>
<meta charset="utf-8">
<title>Clip paths union all children when a path has a trailing moveto</title>
<link rel="author" title="Kurt Catti-Schmidt" href="mailto:kschmi@microsoft.com">
<link rel="match" href="clip-path-union-trailing-moveto-ref.html">
<meta name="assert" content="A trailing moveto in a clipPath child must not cause other children to be omitted from the clip, for either HTML or SVG consumers.">
<style>
.case {
position: relative;
width: 150px;
height: 150px;
}
.backdrop {
position: absolute;
width: 100px;
height: 100px;
background: red;
}
.target {
width: 150px;
height: 150px;
background: green;
clip-path: url(#clip);
}
svg {
display: block;
}
</style>
<p>Test passes if there are two green squares and no red.</p>
<div class="case">
<div class="backdrop"></div>
<div class="target"></div>
</div>
<svg width="150" height="150">
<defs>
<clipPath id="clip">
<path d="M70 70h20v20h-20zM0 0"/>
<rect width="100" height="100"/>
</clipPath>
</defs>
<rect width="100" height="100" fill="red"/>
<g clip-path="url(#clip)">
<rect width="150" height="150" fill="green"/>
</g>
</svg>