Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /html/canvas/element/manual/filters/canvas-filter-shadow.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<link rel="match" href="canvas-filter-shadow-expected.html"/>
<body>
<canvas id="canvas" width="300" height="300"></canvas>
</body>
<script>
/*
The expected behavior of filter-generated shadows is tested against
a drawing using only rectangles that draws the shadows manually.
*/
var canvas = document.getElementById('canvas');
var ctx = canvas.getContext('2d');
ctx.filter = 'drop-shadow(10px 10px 0 red)';
ctx.fillRect(10, 10, 50, 50);
</script>