summaryrefslogtreecommitdiffstats
path: root/dom/canvas/test/reftest/filters/svg-bbox.html
blob: f25e26355d8b41082722bac3ec5a4d9be22e4204 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<!DOCTYPE html>
<html>
<body>
<svg style="display: block; width: 0; height: 0">
  <defs>
    <filter id="color-matrix">
      <feColorMatrix type="matrix" in="SourceGraphic"
        values="0 0 0 0 0 
                0 0 0 0 255 
                0 0 0 0 0 
                0 0 0 0 255"/>
    </filter>
  </defs>
</svg>
<canvas id="canvas" width="100" height="100"></canvas>
<script>

var canvas = document.getElementById('canvas');
var ctx = canvas.getContext('2d');

ctx.filter = 'url(#color-matrix)';
ctx.fillStyle = '#fff';
ctx.fillRect(25, 25, 50, 50);

</script>
</body>
</html>