Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/filter-effects/effect-reference-add-hw-001.html - WPT Dashboard Interop Dashboard
<!doctype html>
<title>SVG Filters: feColorMatrix filter</title>
<link rel="match" href="reference/effect-reference-add-hw-001-ref.html">
<meta name="assert" content="Check that a reference filter can be dynamically set on elements with will-change: transform."/>
<div style="width: 100px; height: 100px; background-color: rgb(255, 0, 0); will-change: transform" id="div1"></div>
<defs>
<filter id="colormatrix">
<feColorMatrix type="matrix" values="0 1 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 1 0"/>
</filter>
</defs>
</svg>
<script>
var div = document.getElementById("div1");
div.style.filter = "url(#colormatrix)";
</script>