summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/2dcontext/shadows/canvas_shadows_002-ref.htm
blob: 0658be808eb9ac1bb69c0e6ab46a1ab72d88b7fc (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>
  <head>
    <title>HTML5 Canvas Test:  Shadows for images</title>
    <link rel="author" title="Microsoft" href="http://www.microsoft.com" />
    <link rel="help" href="http://www.w3.org/TR/2dcontext/#shadows" />
    <meta name="assert" content="Shadows must be drawn for images." />
    <script type="text/javascript">
      function runTest() {
        var canvas = document.getElementById("canvas1");
        var ctx = canvas.getContext("2d");

        // Draw a black rectangle image on the canvas.
        var img = document.getElementById("imgBlackRect");
        ctx.drawImage(img, 0, 0);
        ctx.drawImage(img, 150, 0);
      }
    </script>

  </head>
  <body onload="runTest()">
    <p>Description:  Shadows must be drawn for images.</p>
    <p>Test passes if two black rectangles are shown and there is no red visible on the page.</p>
    <canvas id="canvas1" width="300" height="150">Browser does not support HTML5 Canvas.</canvas>
    <img id="imgBlackRect" style="display:none;" width="100" height="50" src="/images/black-rectangle.png">
  </body>
</html>