Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /svg/render/reftests/outer-svg-mask.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<title>A mask on an outermost svg element is positioned relative to its border box</title>
<link rel="author" title="Nikolas Zimmermann" href="mailto:nzimmermann@igalia.com">
<link rel="match" href="outer-svg-mask-ref.html">
<meta name="assert" content="A mask on an outermost svg element that is not positioned at the origin is applied at the position of the svg element.">
<style>
body {
margin: 0;
}
svg {
display: block;
position: absolute;
left: 50px;
top: 50px;
width: 100px;
height: 100px;
mask: url(#mask);
}
</style>
<svg>
<mask id="mask" maskUnits="userSpaceOnUse" x="0" y="0" width="100" height="100">
<rect width="50" height="100" fill="white"/>
</mask>
<rect width="100" height="100" fill="green"/>
</svg>