<!DOCTYPE html>
<html>
  <head>
    <style type="text/css" media="screen">
      body {
        outline: 10px solid transparent; /* affects layer sizes */
      }
      canvas {
        margin: 20px;
        width: 200px;
        height: 200px;
        padding: 0 20px;
      }
    
      .compare {
        margin-left: 40px;
        margin-top: 20px;
        width: 200px;
        height: 200px;
        background-color: rgba(0, 255, 0, 1.0);
      }
    </style>
    <script>
        if (window.testRunner) {
            testRunner.overridePreference("WebKitWebGLEnabled", "1");
            testRunner.dumpAsText(true);
        }

        function initWebGL(canvasName, vshader, fshader, attribs, clearColor, clearDepth)
        {
            var canvas = document.getElementById(canvasName);
            var gl = canvas.getContext("experimental-webgl", {alpha: false});
            if (!gl) {
                alert("No WebGL context found");
                return null;
            }

            gl.clearColor(clearColor[0], clearColor[1], clearColor[2], clearColor[3]);
            gl.clearDepth(clearDepth);

            return gl;
        }

        function drawCanvas(canvasID)
        {
          var gl = initWebGL(canvasID, "", "", [], [ 0, 1, 0, 0 ], 1);
          gl.viewport(0, 0, 200, 200);
          gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
        }

        function init()
        {
          drawCanvas('canvas');
        }
    </script>
  </head>
  <body onload="init()">
   
    <div class="compare"></div>
    <canvas id="canvas" width="200" height="200"></canvas>

    <!-- Top and bottom should look the same. -->
  </body>
</html>
