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/mask-image/mask-image-url-local-mask-mutated.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<html class="reftest-wait">
<title>CSS Masking: SVG mask referenced by mask-image is dynamically updated</title>
<link rel="match" href="reference/mask-image-url-local-mask-mutated-ref.html">
<meta name="assert" content="Changing the geometry of a child of an SVG mask referenced by mask-image on an HTML element updates the rendering.">
<script src="/common/reftest-wait.js"></script>
<script src="/common/rendering-utils.js"></script>
<style>
#target {
width: 100px;
height: 100px;
background-color: green;
mask-image: url(#mask);
}
</style>
<div id="target"></div>
<svg height="0" width="0">
<mask id="mask" maskContentUnits="objectBoundingBox">
<rect width="1" height="0" fill="white"></rect>
</mask>
</svg>
<script>
waitForAtLeastOneFrame().then(function() {
document.querySelector('rect').setAttribute('height', 1);
takeScreenshot();
});
</script>