summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/canvas/element/manual/filters/canvas-filter-shadow-and-properties-expected.html
blob: 294a219b70875f4e95d71a28ca805ece0025b4b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<!DOCTYPE html>
<body>
  <canvas id="canvas" width="300" height="300"></canvas>
</body>
<script>
  /*
  The expected behavior when both shadow properties and filters are used at the
  same time is that the filter is applied to the elements drawn and the shadow
  properties create another shadow that includes even shadows of the
   filter-generated shadows.
  */
  var canvas = document.getElementById('canvas');
  var ctx = canvas.getContext('2d');
  ctx.fillStyle = 'cyan';
  ctx.fillRect(40, 40, 50, 50);
  ctx.fillRect(30, 30, 50, 50);
  ctx.fillStyle = 'red';
  ctx.fillRect(20, 20, 50, 50);
  ctx.fillStyle = 'black';
  ctx.fillRect(10, 10, 50, 50);
</script>