testing/web-platform/tests/css/css-masking/mask-image/mask-image-url-local-mask.html
author Lando <lando@lando.test>
Fri, 11 Jul 2025 04:32:24 +0000 (76 minutes ago)
changeset 796014 f14d1c1492bc6791542a001365abbca4bd9b28db
parent 434440 991f66df325128a737357f1a3d81a0544cc5969d
permissions -rw-r--r--
Merge autoland to mozilla-central
<!DOCTYPE html>
<title>CSS Test: mask-image: url(#local-mask)</title>
<link rel="author" title="Xidorn Quan" href="https://www.upsuper.org">
<link rel="author" title="Mozilla" href="https://www.mozilla.org">
<link rel="help" href="https://drafts.fxtf.org/css-masking-1/#mask-layer-image">
<link rel="match" href="reference/mask-image-ref.html">
<meta name="assert" content="mask-image can use local reference to a &lt;mask&gt; element">
<style>
#back {
  position: absolute;
  box-sizing: border-box;
  width: 200px;
  height: 200px;
  border: 60px solid green;
  background: red;
}
#front {
  position: absolute;
  box-sizing: border-box;
  width: 200px;
  height: 200px;
  border: 40px solid red;
  background: green;
  mask-image: url(#localmask);
}
</style>
<p>The test passes if there is a green square and no red below.</p>
<div id="back"></div><div id="front"></div>
<svg viewBox="0 0 200 200" style="width: 0; height: 0">
  <mask id="localmask">
    <rect x="50" y="50" width="100" height="100" fill="white">
  </mask>
</svg>