Merging mozilla-central into mozilla-inbound.
authorMounir Lamouri <mounir.lamouri@gmail.com>
Mon, 22 Aug 2011 19:47:54 +0200
changeset 75666 14ebdc83383736e491333f88e5a3e468cefa7f6c
parent 75665 452d6e41403297b509498d364e3cf01aead59497 (current diff)
parent 75655 c8f2a44d604b3ff4dce90c60fa03439c58ca9a66 (diff)
child 75667 e11c851aab48b70d958a38eac5a80fb43d29137b
push id3
push userfelipc@gmail.com
push dateFri, 30 Sep 2011 20:09:13 +0000
milestone9.0a1
Merging mozilla-central into mozilla-inbound.
content/canvas/test/webgl/conformance/gl-min-textures-unroll.html
content/canvas/test/webgl/delete-quickCheckAPI.patch
content/canvas/test/webgl/disable-gl-min-textures.patch
content/canvas/test/webgl/increase-timeout-delays.patch
--- a/content/canvas/test/webgl/00_test_list.txt
+++ b/content/canvas/test/webgl/00_test_list.txt
@@ -1,5 +1,6 @@
 // files that end in .txt list other tests
 // other lines are assumed to be .html files
 
 conformance/00_test_list.txt
+conformance/more/00_test_list.txt
 
--- a/content/canvas/test/webgl/README.mozilla
+++ b/content/canvas/test/webgl/README.mozilla
@@ -1,13 +1,15 @@
-This is a local copy of the WebGL conformance suite, version 1.0.0.
+This is a local copy of the WebGL conformance suite, SVN revision 15318
 
 The canonical location for this testsuite is:
 
-  https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/conformance-suites/1.0.0/webgl-conformance-tests.html
+  https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/sdk/tests/webgl-conformance-tests.html
 
 All files and directories in this directory, with the exceptions listed below, come from
 upstream and should not be modified without corresponding upstream fixes and/or a
 patch file in this directory. The exceptions (the Mozilla-specific files) are:
+ * the crossorigin directory is not from upstream (not easy to share, as it relies on special features of the HTTP server used for our test framework)
  * README.mozilla (this file)
  * failing_tests_*.txt
  * Makefile.in
  * *.patch files, if any
+
--- a/content/canvas/test/webgl/conformance/00_test_list.txt
+++ b/content/canvas/test/webgl/conformance/00_test_list.txt
@@ -1,56 +1,65 @@
 array-buffer-crash.html
 array-buffer-view-crash.html
 array-unit-tests.html
 bad-arguments-test.html
 buffer-bind-test.html
 buffer-data-array-buffer.html
 buffer-preserve-test.html
+buffer-offscreen-test.html
 canvas-test.html
+canvas-zero-size.html
 constants.html
 context-attributes-alpha-depth-stencil-antialias.html
 context-lost-restored.html
 context-lost.html
 context-type-test.html
 copy-tex-image-and-sub-image-2d.html
 draw-arrays-out-of-bounds.html
 draw-elements-out-of-bounds.html
+drawingbuffer-static-canvas-test.html
+drawingbuffer-test.html
 error-reporting.html
 framebuffer-object-attachment.html
 framebuffer-test.html
 get-active-test.html
 gl-bind-attrib-location-test.html
 gl-clear.html
 gl-drawelements.html
 gl-enable-enum-test.html
 gl-enable-vertex-attrib.html
 gl-enum-tests.html
+gl-fragcoord.html
+shaders/00_test_list.txt
 gl-get-active-attribute.html
 gl-get-active-uniform.html
 gl-get-calls.html
+gl-geterror.html
 gl-getshadersource.html
 gl-getstring.html
 gl-min-attribs.html
-# gl-min-textures.html
+gl-min-textures.html
 gl-min-uniforms.html
 gl-object-get-calls.html
 gl-pixelstorei.html
 gl-scissor-test.html
 gl-shader-test.html
 gl-teximage.html
 gl-uniform-arrays.html
 gl-uniform-bool.html
 gl-uniformmatrix4fv.html
 gl-unknown-uniform.html
+gl-vertex-attrib-zero-issues.html
 gl-vertex-attrib.html
-gl-vertex-attrib-zero-issues.html
 gl-vertexattribpointer.html
+gl-vertexattribpointer-offsets.html
 #glsl-2types-of-textures-on-same-unit.html
 glsl-conformance.html
+glsl-long-variable-names.html
 incorrect-context-object-behaviour.html
 index-validation-copies-indices.html
 index-validation-crash-with-buffer-sub-data.html
 index-validation-verifies-too-many-indices.html
 index-validation-with-resized-buffer.html
 index-validation.html
 instanceof-test.html
 invalid-UTF-16.html
@@ -59,41 +68,42 @@ is-object.html
 methods.html
 more-than-65536-points.html
 null-object-behaviour.html
 null-uniform-location.html
 object-deletion-behaviour.html
 oes-standard-derivatives.html
 oes-texture-float.html
 oes-vertex-array-object.html
-# origin-clean-conformance.html # is obsolete because of bug 656277
+origin-clean-conformance.html
 point-size.html
+premultiplyalpha-test.html
 program-test.html
 read-pixels-pack-alignment.html
 read-pixels-test.html
 renderbuffer-initialization.html
 resource-sharing-test.html
 tex-image-and-sub-image-2d-with-array-buffer-view.html
+tex-image-and-sub-image-2d-with-canvas.html
 tex-image-and-sub-image-2d-with-image-data.html
 tex-image-and-sub-image-2d-with-image.html
 tex-image-and-sub-image-2d-with-video.html
 tex-image-and-uniform-binding-bugs.html
 tex-image-with-format-and-type.html
 tex-image-with-invalid-data.html
 tex-input-validation.html
 tex-sub-image-2d-bad-args.html
 tex-sub-image-2d.html
 texparameter-test.html
 texture-active-bind-2.html
 texture-active-bind.html
 texture-complete.html
 texture-formats-test.html
 texture-npot.html
+texture-npot-video.html
 texture-transparent-pixels-initialized.html
 triangle.html
 type-conversion-test.html
 uniform-location.html
 uniform-samplers-test.html
 uninitialized-test.html
 viewport-unchanged-upon-resize.html
 webgl-specific.html
-more/00_test_list.txt
-
--- a/content/canvas/test/webgl/conformance/array-buffer-crash.html
+++ b/content/canvas/test/webgl/conformance/array-buffer-crash.html
@@ -1,15 +1,16 @@
 <!--
-Copyright (c) 2010 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
  -->
 <html>
 <head>
+<meta charset="utf-8">
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 </head>
 <body>
 <div id="description"></div>
 <div id="console"></div>
 
@@ -28,14 +29,10 @@ try {
 } catch (e) {
 }
 
 testPassed("new ArrayBuffer().byteLength did not crash");
 successfullyParsed = true;
 
 </script>
 <script src="../resources/js-test-post.js"></script>
-
-<script>
-</script>
-
 </body>
 </html>
--- a/content/canvas/test/webgl/conformance/array-buffer-view-crash.html
+++ b/content/canvas/test/webgl/conformance/array-buffer-view-crash.html
@@ -1,10 +1,10 @@
 <!--
-Copyright (c) 2010 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions are
 met:
 
    * Redistributions of source code must retain the above copyright
 notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above
@@ -22,18 +22,20 @@ A PARTICULAR PURPOSE ARE DISCLAIMED. IN 
 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 -->
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 </head>
 <body>
 <div id="description"></div>
 <div id="console"></div>
 
@@ -54,13 +56,10 @@ try {
 }
 
 testPassed("new Uint32Array().length did not crash");
 successfullyParsed = true;
 
 </script>
 <script src="../resources/js-test-post.js"></script>
 
-<script>
-</script>
-
 </body>
 </html>
--- a/content/canvas/test/webgl/conformance/array-unit-tests.html
+++ b/content/canvas/test/webgl/conformance/array-unit-tests.html
@@ -1,11 +1,11 @@
 <!--
-Copyright (c) 2009 The Chromium Authors. All rights reserved.
-Copyright (C) 2009 Apple Computer, Inc.  All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
+Copyright (C) 2011 Apple Computer, Inc.  All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions are
 met:
 
    * Redistributions of source code must retain the above copyright
 notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above
@@ -23,18 +23,20 @@ A PARTICULAR PURPOSE ARE DISCLAIMED. IN 
 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 -->
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 </head>
 <body>
 <div id="description"></div>
 <div id="console"></div>
 
@@ -505,17 +507,21 @@ function shouldThrowIndexSizeErr(func, t
         testPassed(text + " threw an exception");
     }
 }
 
 function testConstructionWithOutOfRangeValues(type, name) {
     shouldThrowIndexSizeErr(function() {
         var buffer = new ArrayBuffer(4);
         var array = new type(buffer, 4, 0x3FFFFFFF);
-    }, "Construction of " + name + " with out-of-range values");
+    }, "Construction of " + name + " with out-of-range number of elements");
+    shouldThrowIndexSizeErr(function() {
+        var buffer = new ArrayBuffer(4);
+        var array = new type(buffer, 8);
+    }, "Construction of " + name + " with out-of-range offset");
 }
 
 function testConstructionWithNegativeOutOfRangeValues(type, name) {
     try {
         var buffer = new ArrayBuffer(-1);
         testFailed("Construction of ArrayBuffer with negative size should throw exception");
     } catch (e) {
         testPassed("Construction of ArrayBuffer with negative size threw exception");
@@ -570,16 +576,31 @@ function testConstructionWithBothArrayBu
     var array2 = new type(bufByteLength / elementSizeInBytes);
     if (array1.length == array2.length) {
         testPassed("Array lengths matched with explicit and implicit creation of ArrayBuffer");
     } else {
         testFailed("Array lengths DID NOT MATCH with explicit and implicit creation of ArrayBuffer");
     }
 }
 
+function testConstructionWithSubPortionOfArrayBuffer(type, name, elementSizeInBytes) {
+    if (elementSizeInBytes > 1) {
+        // Test construction with a valid sub-portion of an array buffer
+        // (whose size is not an integral multiple of the element size).
+        var size = 4 * elementSizeInBytes + (elementSizeInBytes / 2);
+        var buf = new ArrayBuffer(size);
+        try {
+            var array = new type(buf, 0, 2);
+            testPassed("new " + name + "(new ArrayBuffer(" + size + "), 0, 2) succeeded");
+        } catch (e) {
+            testFailed("new " + name + "(new ArrayBuffer(" + size + "), 0, 2) failed: " + e);
+        }
+    }
+}
+
 // These need to be global for shouldBe to see them
 var array;
 var typeSize;
 
 function testSubarrayWithOutOfRangeValues(type, name, sz) {
     debug("Testing subarray of " + name);
     try {
         var buffer = new ArrayBuffer(32);
@@ -699,16 +720,22 @@ function testNaNConversion(type, name) {
   try {
     switch (type) {
     case Float32Array:
       for (var i = 0; i < array.length; ++i) {
         array[i] = NaN;
         results[i] = array[i];
       }
       break;
+    case Float64Array:
+      for (var i = 0; i < array.length; ++i) {
+        array[i] = NaN;
+        results[i] = array[i];
+      }
+      break;
     case Int8Array:
       for (var i = 0; i < array.length; ++i) {
         array[i] = NaN;
         results[i] = array[i];
       }
       break;
     case Int16Array:
       for (var i = 0; i < array.length; ++i) {
@@ -741,17 +768,17 @@ function testNaNConversion(type, name) {
       }
       break;
     default:
       fail("Unhandled type");
       break;
     }
 
     // Some types preserve NaN values; all other types convert NaN to zero.
-    if (type === Float32Array) {
+    if (type === Float32Array || type === Float64Array) {
       assert('initial NaN preserved', isNaN(new type([NaN])[0]));
       for (var i = 0; i < array.length; ++i)
         assert('NaN preserved via setter', isNaN(results[i]));
     } else {
       assertEq('initial NaN converted to zero', 0, new type([NaN])[0]);
       for (var i = 0; i < array.length; ++i)
         assertEq('NaN converted to zero by setter', 0, results[i]);
     }
@@ -774,16 +801,23 @@ function runTests() {
   var testCases =
     [ {name: "Float32Array",
        unsigned: false,
        integral: false,
        elementSizeInBytes: 4,
        testValues:     [ -500.5, 500.5 ],
        expectedValues: [ -500.5, 500.5 ]
       },
+      {name: "Float64Array",
+       unsigned: false,
+       integral: false,
+       elementSizeInBytes: 8,
+       testValues:     [ -500.5, 500.5 ],
+       expectedValues: [ -500.5, 500.5 ]
+      },
       {name: "Int8Array",
        unsigned: false,
        integral: true,
        elementSizeInBytes: 1,
        testValues:     [ -128, 127, -129,  128 ],
        expectedValues: [ -128, 127,  127, -128 ]
       },
       {name: "Int16Array",
@@ -861,16 +895,17 @@ function runTests() {
                                        testCase.expectedValues);
     testConstructionWithNullBuffer(type, name);
     testConstructionWithOutOfRangeValues(type, name);
     testConstructionWithNegativeOutOfRangeValues(type, name);
     testConstructionWithUnalignedOffset(type, name, testCase.elementSizeInBytes);
     testConstructionWithUnalignedLength(type, name, testCase.elementSizeInBytes);
     testConstructionOfHugeArray(type, name, testCase.elementSizeInBytes);
     testConstructionWithBothArrayBufferAndLength(type, name, testCase.elementSizeInBytes);
+    testConstructionWithSubPortionOfArrayBuffer(type, name, testCase.elementSizeInBytes);
     testSubarrayWithOutOfRangeValues(type, name, testCase.elementSizeInBytes);
     testSubarrayWithDefaultValues(type, name, testCase.elementSizeInBytes);
     testSettingFromArrayWithOutOfRangeOffset(type, name);
     testSettingFromFakeArrayWithOutOfRangeLength(type, name);
     testSettingFromTypedArrayWithOutOfRangeOffset(type, name);
     negativeTestGetAndSetMethods(type, name);
     testNaNConversion(type, name);
   }
--- a/content/canvas/test/webgl/conformance/bad-arguments-test.html
+++ b/content/canvas/test/webgl/conformance/bad-arguments-test.html
@@ -1,10 +1,10 @@
 <!--
-Copyright (C) 2009 Apple Computer, Inc.  All rights reserved.
+Copyright (C) 2011 Apple Computer, Inc.  All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions
 are met:
 1. Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
 2. Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
@@ -17,18 +17,20 @@ PURPOSE ARE DISCLAIMED.  IN NO EVENT SHA
 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 -->
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 <script src="resources/webgl-test-utils.js"></script>
 </head>
 <body>
 <div id="description"></div>
 <div id="console"></div>
--- a/content/canvas/test/webgl/conformance/buffer-bind-test.html
+++ b/content/canvas/test/webgl/conformance/buffer-bind-test.html
@@ -1,17 +1,17 @@
 <!--
-Copyright (c) 2009 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
  -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-  "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE html>
 <html>
   <head>
+<meta charset="utf-8">
     <title>WebGL BindBuffer conformance test.</title>
     <link rel="stylesheet" href="../resources/js-test-style.css"/>
     <script src="../resources/js-test-pre.js"></script>
     <script src="resources/webgl-test.js"> </script>
 </head>
 <body>
 <canvas id="example" width="40" height="40" style="width: 40px; height: 40px;"></canvas>
 <div id="description"></div>
@@ -51,17 +51,13 @@ if (!gl) {
   gl.bindBuffer(gl.ARRAY_BUFFER, buf);
   glErrorShouldBe(gl, gl.INVALID_OPERATION,
             "should get INVALID_OPERATION if attempting to bind buffer to different target");
 }
 
 debug("");
 successfullyParsed = true;
 </script>
-</body>
 <script src="../resources/js-test-post.js"></script>
 
-<script>
-</script>
-
 </body>
 </html>
 
--- a/content/canvas/test/webgl/conformance/buffer-data-array-buffer.html
+++ b/content/canvas/test/webgl/conformance/buffer-data-array-buffer.html
@@ -1,15 +1,17 @@
 <!--
-Copyright (c) 2010 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
  -->
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 </head>
 <body>
 <div id="description"></div>
 <div id="console"></div>
 
new file mode 100644
--- /dev/null
+++ b/content/canvas/test/webgl/conformance/buffer-offscreen-test.html
@@ -0,0 +1,92 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL required buffer clear behaviour test</title>
+<link rel="stylesheet" href="../resources/js-test-style.css"/>
+<script src="../resources/js-test-pre.js"></script>
+<script src="resources/webgl-test.js"> </script>
+<script src="resources/webgl-test-utils.js"> </script>
+<style type="text/css">
+body {
+    height: 3000px;
+}
+</style>
+<script type="text/javascript">
+
+var iter = 0;
+var gl1;
+var gl2;
+
+var wtu = WebGLTestUtils;
+
+function timer() {
+    if (iter == 0) {
+        // some random hacky stuff to make sure that we get a compositing step
+        window.scrollBy(0, 10);
+        window.scrollBy(0, -10);
+        iter++;
+
+        setTimeout(timer, 500);
+    } else if (iter == 1) {
+        function clear(gl) {
+            // scissor was set earlier
+            gl.clearColor(0, 0, 1, 1);
+            gl.clear(gl.COLOR_BUFFER_BIT);
+        }
+        clear(gl1);
+        clear(gl2);
+
+        debug("check on screen canvas");
+        wtu.checkCanvasRect(gl1, 0, 10, 10, 10, [0, 0, 255, 255], "cleared corner should be blue, stencil should be preserved");
+        wtu.checkCanvasRect(gl1, 0, 0, 10, 10, [0, 0, 0, 0], "remainder of buffer should be cleared");
+        debug("check off screen canvas");
+        wtu.checkCanvasRect(gl2, 0, 10, 10, 10, [0, 0, 255, 255], "cleared corner should be blue, stencil should be preserved");
+        wtu.checkCanvasRect(gl2, 0, 0, 10, 10, [255, 0, 0, 255], "remainder of buffer should be un-cleared red");
+
+        finishTest();
+    }
+}
+
+function go() {
+    description("This test ensures WebGL implementations correctly clear the drawing buffer on composite if preserveDrawingBuffer is false.");
+
+    debug("");
+
+    gl1 = create3DContext(document.getElementById("c"));
+    c2 = document.createElement('canvas');
+    gl2 = create3DContext(c2);
+    shouldBeTrue("gl1 != null");
+    shouldBeTrue("gl2 != null");
+
+    shouldBeTrue('gl1.getContextAttributes().preserveDrawingBuffer == false');
+    shouldBeTrue('gl2.getContextAttributes().preserveDrawingBuffer == false');
+
+    function init(gl) {
+        gl.clearColor(1, 0, 0, 1);
+        gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);
+
+        // enable scissor here, before compositing, to make sure it's correctly
+        // ignored and restored
+        gl.scissor(0, 10, 10, 10);
+        gl.enable(gl.SCISSOR_TEST);
+    }
+
+    init(gl1);
+    init(gl2);
+
+    setTimeout(timer, 500);
+}
+
+window.addEventListener("load", go, false);
+
+successfullyParsed = true;
+</script>
+</head>
+<body>
+<div id="description"></div>
+<canvas width="20" height="20" style="border: 1px solid blue;" id="c"></canvas>
+<div id="console"></div>
+</body>
+</html>
+
--- a/content/canvas/test/webgl/conformance/buffer-preserve-test.html
+++ b/content/canvas/test/webgl/conformance/buffer-preserve-test.html
@@ -1,78 +1,77 @@
 <!DOCTYPE HTML>
 <html>
 <head>
+<meta charset="utf-8">
 <title>WebGL required buffer clear behaviour test</title>
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"> </script>
 <script src="resources/webgl-test-utils.js"> </script>
 <style type="text/css">
 body {
     height: 3000px;
 }
 </style>
 <script type="text/javascript">
 
 var iter = 0;
-var gl;
+var gl1;
 
 var wtu = WebGLTestUtils;
 
-function checkPixel(gl, x, y, c) {
-    var buf = new Uint8Array(4);
-    gl.readPixels(x, y, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, buf);
-
-    return buf[0] == c[0] &&
-	buf[1] == c[1] &&
-	buf[2] == c[2] &&
-	buf[3] == c[3];
-}
-
 function timer() {
     if (iter == 0) {
-	// some random hacky stuff to make sure that we get a compositing step
-	window.scrollBy(0, 10);
-	window.scrollBy(0, -10);
-	iter++;
+        // some random hacky stuff to make sure that we get a compositing step
+        window.scrollBy(0, 10);
+        window.scrollBy(0, -10);
+        iter++;
 
-	setTimeout(timer, 500);
+        setTimeout(timer, 500);
     } else if (iter == 1) {
-	// scissor was set earlier
-	gl.clearColor(0, 0, 1, 1);
-	gl.clear(gl.COLOR_BUFFER_BIT);
+        function clear(gl) {
+            // scissor was set earlier
+            gl.clearColor(0, 0, 1, 1);
+            gl.clear(gl.COLOR_BUFFER_BIT);
 
-	wtu.checkCanvasRect(gl, 0, 10, 10, 10, [0, 0, 255, 255], "cleared corner should be blue, stencil should be preserved");
-	wtu.checkCanvasRect(gl, 0, 0, 10, 10, [0, 0, 0, 0], "remainder of buffer should be cleared");
+            wtu.checkCanvasRect(gl, 0, 10, 10, 10, [0, 0, 255, 255], "cleared corner should be blue, stencil should be preserved");
+            wtu.checkCanvasRect(gl, 0, 0, 10, 10, [0, 0, 0, 0], "remainder of buffer should be cleared");
+        }
+        clear(gl1);
 
-	finishTest();
+        finishTest();
     }
 }
 
 function go() {
     description("This test ensures WebGL implementations correctly clear the drawing buffer on composite if preserveDrawingBuffer is false.");
 
     debug("");
 
-    gl = create3DContext(document.getElementById("c"));
-    if (!gl) {
-	finishTest();
-	return;
+    gl1 = create3DContext(document.getElementById("c"));
+    if (!gl1) {
+        finishTest();
+        return;
     }
 
-    shouldBeTrue('gl.getContextAttributes().preserveDrawingBuffer == false');
+    shouldBeTrue("gl1 != null");
+    shouldBeTrue('gl1.getContextAttributes().preserveDrawingBuffer == false');
 
-    gl.clearColor(1, 0, 0, 1);
-    gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);
+    function init(gl) {
+        gl.clearColor(1, 0, 0, 1);
+        gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);
 
-    // enable scissor here, before compositing, to make sure it's correctly
-    // ignored and restored
-    gl.scissor(0, 10, 10, 10);
-    gl.enable(gl.SCISSOR_TEST);
+        // enable scissor here, before compositing, to make sure it's correctly
+        // ignored and restored
+        gl.scissor(0, 10, 10, 10);
+        gl.enable(gl.SCISSOR_TEST);
+    }
+
+    init(gl1);
 
     setTimeout(timer, 500);
 }
 
 window.addEventListener("load", go, false);
 
 successfullyParsed = true;
 </script>
--- a/content/canvas/test/webgl/conformance/canvas-test.html
+++ b/content/canvas/test/webgl/conformance/canvas-test.html
@@ -1,18 +1,17 @@
 <!--
-Copyright (c) 2009 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
  -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-  "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE html>
 <html>
 <head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<meta charset="utf-8">
 <title>WebGL Canvas Conformance Tests</title>
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/desktop-gl-constants.js" type="text/javascript"></script>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 </head>
 <body>
 <div id="description"></div>
@@ -183,13 +182,11 @@ if (!gl) {
       }
 
       debug("");
       finishTest();
     }
    }, 1000/30);
 }
 </script>
-<script>
-</script>
 
 </body>
 </html>
new file mode 100644
--- /dev/null
+++ b/content/canvas/test/webgl/conformance/canvas-zero-size.html
@@ -0,0 +1,42 @@
+<!--
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
+Use of this source code is governed by a BSD-style license that can be
+  found in the LICENSE file.
+ -->
+<!DOCTYPE html>
+<html>
+  <head>
+  <meta charset="utf-8">
+    <title>Zero Size Canvas Test</title>
+    <link rel="stylesheet" href="../resources/js-test-style.css"/>
+    <script src="../resources/js-test-pre.js"></script>
+    <script src="resources/webgl-test.js"> </script>
+    <script src="resources/webgl-test-utils.js"> </script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+description("Tests that a zero size canvas does not fail.");
+var wtu = WebGLTestUtils;
+var canvas = document.createElement('canvas');
+var gl = wtu.create3DContext(canvas);
+canvas.width = 0;
+canvas.height = 0;
+gl.viewport(0, 0, 0, 0);
+var program = wtu.setupTexturedQuad(gl);
+shouldBeTrue("program != null");
+var tex = gl.createTexture();
+gl.bindTexture(gl.TEXTURE_2D, tex);
+var pixel = new Uint8Array([0, 255, 0, 255]);
+gl.texImage2D(
+  gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, pixel);
+wtu.drawQuad(gl);
+
+glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from setup.");
+successfullyParsed = true;
+</script>
+<script src="../resources/js-test-post.js"></script>
+
+</body>
+</html>
--- a/content/canvas/test/webgl/conformance/constants.html
+++ b/content/canvas/test/webgl/conformance/constants.html
@@ -1,16 +1,17 @@
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <!--
-Copyright (c) 2009 Ilmari Heikkinen. All rights reserved.
+Copyright (c) 2011 Ilmari Heikkinen. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
 -->
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
 <title>WebGL Constants Test</title>
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/desktop-gl-constants.js" type="text/javascript"></script>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 </head>
 <body>
 <div id="description"></div>
@@ -476,13 +477,11 @@ for (var i in gl) {
     debug(i);
   }
 }
 
 debug("");
 successfullyParsed = true;
 </script>
 <script src="../resources/js-test-post.js"></script>
-<script>
-</script>
 
 </body>
 </html>
--- a/content/canvas/test/webgl/conformance/context-attributes-alpha-depth-stencil-antialias.html
+++ b/content/canvas/test/webgl/conformance/context-attributes-alpha-depth-stencil-antialias.html
@@ -1,71 +1,91 @@
 <!--
-Copyright (c) 2010 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
  -->
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 <script id="vshader" type="x-shader/x-vertex">
 attribute vec3 pos;
 attribute vec4 colorIn;
 varying vec4 color;
 
 void main()
 {
     color = colorIn;
     gl_Position = vec4(pos.xyz, 1.0);
 }
 </script>
 
 <script id="fshader" type="x-shader/x-fragment">
-#ifdef GL_ES
-precision highp float;
-#endif
+precision mediump float;
+
 varying vec4 color;
 
 void main()
 {
     gl_FragColor = color;
 }
 </script>
 
 <script>
 var successfullyParsed = false;
 
 // These four declarations need to be global for "shouldBe" to see them
 var webGL = null;
 var contextAttribs = null;
 var pixel = [0, 0, 0, 1];
 var correctColor = null;
+var value;
 
 function init()
 {
     if (window.initNonKhronosFramework) {
         window.initNonKhronosFramework(true);
     }
 
     description('Verify WebGLContextAttributes are working as specified, including alpha, depth, stencil, antialias, but not premultipliedAlpha');
 
     runTest();
 }
 
-function getWebGL(canvasName, contextAttribs, clearColor, clearDepth, clearStencil)
+function getWebGL(canvasWidth, canvasHeight, contextAttribs, clearColor, clearDepth, clearStencil)
 {
-    var context = initWebGL(canvasName, "vshader", "fshader", ["pos", "colorIn"], clearColor, clearDepth, contextAttribs);
-    if (context) {
-        context.clearStencil(clearStencil);
-        context.enable(context.STENCIL_TEST);
-        context.disable(context.BLEND);
-        context.clear(context.COLOR_BUFFER_BIT | context.DEPTH_BUFFER_BIT | context.STENCIL_BUFFER_BIT);
-    }
+    var canvas = document.createElement("canvas");
+    if (!canvas)
+        return null;
+    canvas.width = canvasWidth;
+    canvas.height = canvasHeight;
+
+    var context = create3DContext(canvas, contextAttribs);
+    if (!context)
+        return null;
+
+    context.program = createProgram(context, "vshader", "fshader", ["pos", "colorIn"]);
+    if (!context.program)
+        return null;
+
+    context.useProgram(context.program);
+
+    context.enable(context.DEPTH_TEST);
+    context.enable(context.STENCIL_TEST);
+    context.disable(context.BLEND);
+
+    context.clearColor(clearColor[0], clearColor[1], clearColor[2], clearColor[3]);
+    context.clearDepth(clearDepth);
+    context.clearStencil(clearStencil);
+    context.clear(context.COLOR_BUFFER_BIT | context.DEPTH_BUFFER_BIT | context.STENCIL_BUFFER_BIT);
+
     return context;
 }
 
 function drawAndReadPixel(gl, vertices, colors, x, y)
 {
     var colorOffset = vertices.byteLength;
 
     var vbo = gl.createBuffer();
@@ -85,38 +105,39 @@ function drawAndReadPixel(gl, vertices, 
     gl.readPixels(x, y, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, buf);
     return buf;
 }
 
 function testAlpha(alpha)
 {
     debug("Testing alpha = " + alpha);
     if (alpha)
-        shouldBeNonNull("webGL = getWebGL('alphaOn', { alpha: true, depth: false, stencil: false, antialias: false }, [ 0, 0, 0, 0 ], 1, 0)");
+        shouldBeNonNull("webGL = getWebGL(1, 1, { alpha: true, depth: false, stencil: false, antialias: false }, [ 0, 0, 0, 0 ], 1, 0)");
     else
-        shouldBeNonNull("webGL = getWebGL('alphaOff', { alpha: false, depth: false, stencil: false, antialias: false }, [ 0, 0, 0, 0 ], 1, 0)");
+        shouldBeNonNull("webGL = getWebGL(1, 1, { alpha: false, depth: false, stencil: false, antialias: false }, [ 0, 0, 0, 0 ], 1, 0)");
     shouldBeNonNull("contextAttribs = webGL.getContextAttributes()");
+    shouldBeTrue("contextAttribs.alpha == " + alpha);
 
     var buf = new Uint8Array(1 * 1 * 4);
     webGL.readPixels(0, 0, 1, 1, webGL.RGBA, webGL.UNSIGNED_BYTE, buf);
     pixel[0] = buf[0];
     pixel[1] = buf[1];
     pixel[2] = buf[2];
     pixel[3] = buf[3];
     correctColor = (contextAttribs.alpha ? [0, 0, 0, 0] : [0, 0, 0, 255]);
     shouldBe("pixel", "correctColor");
 }
 
 function testDepth(depth)
 {
     debug("Testing depth = " + depth);
     if (depth)
-        shouldBeNonNull("webGL = getWebGL('depthOn', { stencil: false, antialias: false }, [ 0, 0, 0, 1 ], 1, 0)");
+        shouldBeNonNull("webGL = getWebGL(1, 1, { stencil: false, antialias: false }, [ 0, 0, 0, 1 ], 1, 0)");
     else
-        shouldBeNonNull("webGL = getWebGL('depthOff', { depth: false, stencil: false, antialias: false }, [ 0, 0, 0, 1 ], 1, 0)");
+        shouldBeNonNull("webGL = getWebGL(1, 1, { depth: false, stencil: false, antialias: false }, [ 0, 0, 0, 1 ], 1, 0)");
     shouldBeNonNull("contextAttribs = webGL.getContextAttributes()");
 
     webGL.depthFunc(webGL.NEVER);
 
     var vertices = new Float32Array([
          1.0,  1.0, 0.0,
         -1.0,  1.0, 0.0,
         -1.0, -1.0, 0.0,
@@ -139,19 +160,19 @@ function testDepth(depth)
     correctColor = (contextAttribs.depth ? [0, 0, 0, 255] : [255, 0, 0, 255]);
     shouldBe("pixel", "correctColor");
 }
 
 function testStencil(stencil)
 {
     debug("Testing stencil = " + stencil);
     if (stencil)
-        shouldBeNonNull("webGL = getWebGL('stencilOn', { depth: false, stencil: true, antialias: false }, [ 0, 0, 0, 1 ], 1, 0)");
+        shouldBeNonNull("webGL = getWebGL(1, 1, { depth: false, stencil: true, antialias: false }, [ 0, 0, 0, 1 ], 1, 0)");
     else
-        shouldBeNonNull("webGL = getWebGL('stencilOff', { depth: false, stencil: false, antialias: false }, [ 0, 0, 0, 1 ], 1, 0)");
+        shouldBeNonNull("webGL = getWebGL(1, 1, { depth: false, stencil: false, antialias: false }, [ 0, 0, 0, 1 ], 1, 0)");
     shouldBeNonNull("contextAttribs = webGL.getContextAttributes()");
 
     webGL.depthFunc(webGL.ALWAYS);
 
     webGL.stencilFunc(webGL.NEVER, 1, 1);
     webGL.stencilOp(webGL.KEEP, webGL.KEEP, webGL.KEEP);
 
     var vertices = new Float32Array([
@@ -177,19 +198,19 @@ function testStencil(stencil)
     correctColor = (contextAttribs.stencil ? [0, 0, 0, 255] : [255, 0, 0, 255]);
     shouldBe("pixel", "correctColor");
 }
 
 function testAntialias(antialias)
 {
     debug("Testing antialias = " + antialias);
     if (antialias)
-        shouldBeNonNull("webGL = getWebGL('antialiasOn', { depth: false, stencil: false, alpha: false, antialias: true }, [ 0, 0, 0, 1 ], 1, 0)");
+        shouldBeNonNull("webGL = getWebGL(2, 2, { depth: false, stencil: false, alpha: false, antialias: true }, [ 0, 0, 0, 1 ], 1, 0)");
     else
-        shouldBeNonNull("webGL = getWebGL('antialiasOff', { depth: false, stencil: false, alpha: false, antialias: false }, [ 0, 0, 0, 1 ], 1, 0)");
+        shouldBeNonNull("webGL = getWebGL(2, 2, { depth: false, stencil: false, alpha: false, antialias: false }, [ 0, 0, 0, 1 ], 1, 0)");
     shouldBeNonNull("contextAttribs = webGL.getContextAttributes()");
 
     var vertices = new Float32Array([
          1.0, 1.0, 0.0,
         -1.0, 1.0, 0.0,
         -1.0, -1.0, 0.0]);
     var colors = new Uint8Array([
         255, 0, 0, 255,
@@ -213,20 +234,12 @@ function runTest()
     testAntialias(false);
 
     finishTest()
 }
 
 </script>
 </head>
 <body onload="init()">
-<canvas id="alphaOn" width="1px" height="1px"></canvas>
-<canvas id="alphaOff" width="1px" height="1px"></canvas>
-<canvas id="depthOn" width="1px" height="1px"></canvas>
-<canvas id="depthOff" width="1px" height="1px"></canvas>
-<canvas id="stencilOn" width="1px" height="1px"></canvas>
-<canvas id="stencilOff" width="1px" height="1px"></canvas>
-<canvas id="antialiasOn" width="2px" height="2px"></canvas>
-<canvas id="antialiasOff" width="2px" height="2px"></canvas>
 <div id="description"></div>
 <div id="console"></div>
 </body>
 </html>
--- a/content/canvas/test/webgl/conformance/context-lost-restored.html
+++ b/content/canvas/test/webgl/conformance/context-lost-restored.html
@@ -1,50 +1,95 @@
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 <script src="resources/webgl-test-utils.js"></script>
 <script>
 var wtu = WebGLTestUtils;
 var canvas;
 var gl;
 var shouldGenerateGLError;
 var extension_name = "WEBKIT_lose_context";
 var extension;
 var bufferObjects;
 var program;
 var texture;
 var texColor = [255, 10, 20, 255];
+var allowRestore;
 
 function init()
 {
     if (window.initNonKhronosFramework) {
         window.initNonKhronosFramework(true);
     }
 
-    description("Tests behavior under a restored context");
+    description("Tests behavior under a restored context.");
+
+    shouldGenerateGLError = wtu.shouldGenerateGLError;
+    runTests();
+}
 
-    canvas = document.getElementById("canvas");
-    canvas.addEventListener("webglcontextlost", testLostContext, false);
-    canvas.addEventListener("webglcontextrestored", testRestoredContext, false);
+function runTests()
+{
+    testLosingContext();
+    testLosingAndRestoringContext();
 
+    finish();
+}
+
+function setupTest()
+{
+    canvas = document.createElement("canvas");
+    canvas.width = 1;
+    canvas.height = 1;
     gl = wtu.create3DContext(canvas);
-    shouldGenerateGLError = wtu.shouldGenerateGLError;
-
     extension = gl.getExtension(extension_name);
     if (!extension) {
         debug(extension_name + " extension not found.");
-        finish();
+        return false;
+    }
+    return true;
+}
+
+function testLosingContext()
+{
+    if (!setupTest())
         return;
-    }
+
+    debug("Test losing a context and inability to restore it.");
+
+    canvas.addEventListener("webglcontextlost", testLostContext);
+    canvas.addEventListener("webglcontextrestored", testShouldNotRestoreContext);
+    allowRestore = false;
 
     testOriginalContext();
     extension.loseContext();
+    shouldGenerateGLError(gl, gl.INVALID_OPERATION, "extension.restoreContext()");
+    debug("");
+}
+
+function testLosingAndRestoringContext()
+{
+    if (!setupTest())
+        return;
+
+    debug("Test losing and restoring a context.");
+
+    canvas.addEventListener("webglcontextlost", testLostContext);
+    canvas.addEventListener("webglcontextrestored", testRestoredContext);
+    allowRestore = true;
+
+    testOriginalContext();
+    extension.loseContext();
+    shouldGenerateGLError(gl, gl.NO_ERROR, "extension.restoreContext()");
+    debug("");
 }
 
 function testRendering()
 {
     gl.clearColor(0, 0, 0, 255);
     gl.colorMask(1, 1, 1, 0);
     gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
 
@@ -65,23 +110,31 @@ function testOriginalContext()
 {
     debug("Test valid context");
     shouldBeFalse("gl.isContextLost()");
     shouldBe("gl.getError()", "gl.NO_ERROR");
     testRendering();
     debug("");
 }
 
-function testLostContext()
+function testLostContext(e)
 {
     debug("Test lost context");
     shouldBeTrue("gl.isContextLost()");
     shouldBe("gl.getError()", "gl.CONTEXT_LOST_WEBGL");
     shouldBe("gl.getError()", "gl.NO_ERROR");
     debug("");
+    if (allowRestore)
+        e.preventDefault();
+}
+
+function testShouldNotRestoreContext(e)
+{
+    testFailed("Should not restore the context unless preventDefault is called on the context lost event");
+    debug("");
 }
 
 function testResources(expected)
 {
     var tests = [
         "gl.bindTexture(gl.TEXTURE_2D, texture)",
         "gl.useProgram(program)",
         "gl.bindBuffer(gl.ARRAY_BUFFER, bufferObjects[0])",
@@ -100,18 +153,16 @@ function testRestoredContext()
     // Validate that using old resources fails.
     testResources(gl.INVALID_OPERATION);
 
     testRendering();
 
     // Validate new resources created in testRendering().
     testResources(gl.NO_ERROR);
     debug("");
-
-    finish();
 }
 
 function finish() {
     successfullyParsed = true;
     var epilogue = document.createElement("script");
     epilogue.onload = function() {
         if (window.nonKhronosFrameworkNotifyDone)
             window.nonKhronosFrameworkNotifyDone();
@@ -120,11 +171,10 @@ function finish() {
     document.body.appendChild(epilogue);
 }
 
 </script>
 </head>
 <body onload="init()">
 <div id="description"></div>
 <div id="console"></div>
-<canvas id="canvas" width="1px" height="1px"></canvas>
 </body>
 </html>
--- a/content/canvas/test/webgl/conformance/context-lost.html
+++ b/content/canvas/test/webgl/conformance/context-lost.html
@@ -1,10 +1,12 @@
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 <script src="resources/webgl-test-utils.js"></script>
 <script>
 var wtu;
 var canvas;
 var gl;
@@ -57,16 +59,19 @@ function init()
 
     loseContext();
 }
 
 function loseContext()
 {
     debug("");
     debug("Lose context");
+
+    // Note: this will cause the context to be lost, and the
+    // webglcontextlost event listener to be called, immediately.
     shouldGenerateGLError(gl, gl.NO_ERROR, "extension.loseContext()");
     debug("");
 }
 
 function testValidContext()
 {
     debug("Test valid context");
 
@@ -130,18 +135,18 @@ function testLostContext()
         "gl.attachShader(program, shader)",
         "gl.bindBuffer(gl.ARRAY_BUFFER, buffer)",
         "gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer)",
         "gl.bindRenderbuffer(gl.RENDERBUFFER, renderbuffer)",
         "gl.bindTexture(gl.TEXTURE_2D, texture)",
         "gl.blendColor(1.0, 1.0, 1.0, 1.0)",
         "gl.blendEquation(gl.FUNC_ADD)",
         "gl.blendEquationSeparate(gl.FUNC_ADD, gl.FUNC_ADD)",
-        "gl.blendFunc(gl.ONE)",
-        "gl.blendFuncSeparate(gl.ONE, gl.ONE)",
+        "gl.blendFunc(gl.ONE, gl.ONE)",
+        "gl.blendFuncSeparate(gl.ONE, gl.ONE, gl.ONE, gl.ONE)",
         "gl.bufferData(gl.ARRAY_BUFFER, 0, gl.STATIC_DRAW)",
         "gl.bufferData(gl.ARRAY_BUFFER, arrayBufferView, gl.STATIC_DRAW)",
         "gl.bufferData(gl.ARRAY_BUFFER, arrayBuffer, gl.STATIC_DRAW)",
         "gl.bufferSubData(gl.ARRAY_BUFFRE, 0, arrayBufferView)",
         "gl.bufferSubData(gl.ARRAY_BUFFRE, 0, arrayBuffer)",
         "gl.clear(gl.COLOR_BUFFER_BIT)",
         "gl.clearColor(1, 1, 1, 1)",
         "gl.clearDepth(1)",
@@ -290,16 +295,18 @@ function testLostContext()
     shouldBeFalse("gl.isFramebuffer(framebuffer)");
     shouldBeFalse("gl.isProgram(program)");
     shouldBeFalse("gl.isRenderbuffer(renderbuffer)");
     shouldBeFalse("gl.isShader(shader)");
     shouldBeFalse("gl.isTexture(texture)");
 
     shouldBe("gl.getError()", "gl.NO_ERROR");
 
+    debug("");
+
     finish();
 }
 
 function finish() {
     successfullyParsed = true;
     var epilogue = document.createElement("script");
     epilogue.onload = function() {
         if (window.nonKhronosFrameworkNotifyDone)
--- a/content/canvas/test/webgl/conformance/context-type-test.html
+++ b/content/canvas/test/webgl/conformance/context-type-test.html
@@ -1,18 +1,17 @@
 <!--
-Copyright (c) 2009 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
  -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-  "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE html>
 <html>
 <head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<meta charset="utf-8">
 <title>WebGL Canvas Conformance Tests</title>
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/desktop-gl-constants.js" type="text/javascript"></script>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 </head>
 <body>
 <div id="description"></div>
@@ -20,28 +19,31 @@ found in the LICENSE file.
 <canvas id="canvas" style="width: 50px; height: 50px;"> </canvas>
 <canvas id="canvas2d" width="40" height="40"> </canvas>
 <script>
 description("This test ensures WebGL implementations interact correctly with the canvas tag.");
 
 debug("");
 debug("Canvas.getContext");
 
+assertMsg(window.WebGLRenderingContext,
+          "WebGLRenderingContext should be a member of window");
+assertMsg('WebGLRenderingContext' in window,
+          "WebGLRenderingContext should be 'in' window");
+
 var canvas = document.getElementById("canvas");
 var gl = create3DContext(canvas);
 if (!gl) {
   testFailed("context does not exist");
 } else {
   testPassed("context exists");
 
   debug("Checking context type");
   assertMsg(gl instanceof WebGLRenderingContext,
             "context type should be WebGLRenderingContext");
 }
 debug("");
 successfullyParsed = true;
 </script>
 <script src="../resources/js-test-post.js"></script>
-<script>
-</script>
 
 </body>
 </html>
--- a/content/canvas/test/webgl/conformance/copy-tex-image-and-sub-image-2d.html
+++ b/content/canvas/test/webgl/conformance/copy-tex-image-and-sub-image-2d.html
@@ -1,15 +1,17 @@
 <!--
-Copyright (c) 2010 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
  -->
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 <script src="resources/webgl-test-utils.js"></script>
 
 <script>
 var successfullyParsed = false;
 
--- a/content/canvas/test/webgl/conformance/draw-arrays-out-of-bounds.html
+++ b/content/canvas/test/webgl/conformance/draw-arrays-out-of-bounds.html
@@ -1,10 +1,10 @@
 <!--
-Copyright (C) 2009 Apple Computer, Inc.  All rights reserved.
+Copyright (C) 2011 Apple Computer, Inc.  All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions
 are met:
 1. Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
 2. Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
@@ -17,18 +17,20 @@ PURPOSE ARE DISCLAIMED.  IN NO EVENT SHA
 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 -->
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 </head>
 <body>
 <div id="description"></div>
 <div id="console"></div>
 
--- a/content/canvas/test/webgl/conformance/draw-elements-out-of-bounds.html
+++ b/content/canvas/test/webgl/conformance/draw-elements-out-of-bounds.html
@@ -1,10 +1,10 @@
 <!--
-Copyright (C) 2009 Apple Computer, Inc.  All rights reserved.
+Copyright (C) 2011 Apple Computer, Inc.  All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions
 are met:
 1. Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
 2. Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
@@ -17,18 +17,20 @@ PURPOSE ARE DISCLAIMED.  IN NO EVENT SHA
 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 -->
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 </head>
 <body>
 <div id="description"></div>
 <div id="console"></div>
 
new file mode 100644
--- /dev/null
+++ b/content/canvas/test/webgl/conformance/drawingbuffer-static-canvas-test.html
@@ -0,0 +1,61 @@
+<!--
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
+Use of this source code is governed by a BSD-style license that can be
+found in the LICENSE file.
+ -->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL Canvas Conformance Tests</title>
+<link rel="stylesheet" href="../resources/js-test-style.css"/>
+<script src="../resources/js-test-pre.js"></script>
+<script src="resources/webgl-test.js"></script>
+<script src="resources/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" style="width: 50px; height: 50px;"> </canvas>
+<script>
+description("This test ensures WebGL implementations correctly implement drawingbufferWidth/Height with compositing.");
+
+debug("");
+
+var wtu = WebGLTestUtils;
+var err;
+var maxSize;
+var canvas = document.getElementById("canvas");
+var gl = wtu.create3DContext(canvas);
+if (!gl) {
+  testFailed("context does not exist");
+} else {
+  testPassed("context exists");
+
+  debug("");
+  debug("Checking drawingBufferWidth/drawingBufferHeight");
+
+  // Check that a canvas with no width or height is 300x150 pixels
+  shouldBe('gl.drawingBufferWidth', 'canvas.width');
+  shouldBe('gl.drawingBufferHeight', 'canvas.height');
+
+  // Check that changing the canvas size to something too large falls back to reasonable values.
+  maxSize = gl.getParameter(gl.MAX_VIEWPORT_DIMS);
+  shouldBeTrue('maxSize[0] > 0');
+  shouldBeTrue('maxSize[1] > 0');
+
+  // debug("MAX_VIEWPORT_DIMS = " + maxSize[0] + "x" + maxSize[1]);
+  canvas.width = maxSize[0] * 4;
+  canvas.height = maxSize[1] * 4;
+  shouldBeTrue('gl.drawingBufferWidth > 0');
+  shouldBeTrue('gl.drawingBufferHeight > 0');
+  shouldBeTrue('gl.drawingBufferWidth <= maxSize[0]');
+  shouldBeTrue('gl.drawingBufferHeight <= maxSize[1]');
+  shouldBe('gl.getError()', 'gl.NO_ERROR');
+}
+debug("")
+successfullyParsed = true;
+</script>
+<script src="../resources/js-test-post.js"></script>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/content/canvas/test/webgl/conformance/drawingbuffer-test.html
@@ -0,0 +1,60 @@
+<!--
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
+Use of this source code is governed by a BSD-style license that can be
+found in the LICENSE file.
+ -->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL Canvas Conformance Tests</title>
+<link rel="stylesheet" href="../resources/js-test-style.css"/>
+<script src="../resources/js-test-pre.js"></script>
+<script src="resources/webgl-test.js"></script>
+<script src="resources/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+description("This test ensures WebGL implementations correctly implement drawingbufferWidth/Height.");
+
+debug("");
+
+var wtu = WebGLTestUtils;
+var err;
+var maxSize;
+var canvas = document.createElement("canvas");
+var gl = wtu.create3DContext(canvas);
+if (!gl) {
+  testFailed("context does not exist");
+} else {
+  testPassed("context exists");
+
+  debug("");
+  debug("Checking drawingBufferWidth/drawingBufferHeight");
+
+  // Check that a canvas with no width or height is 300x150 pixels
+  shouldBe('gl.drawingBufferWidth', 'canvas.width');
+  shouldBe('gl.drawingBufferHeight', 'canvas.height');
+
+  // Check that changing the canvas size to something too large falls back to reasonable values.
+  maxSize = gl.getParameter(gl.MAX_VIEWPORT_DIMS);
+  shouldBeTrue('maxSize[0] > 0');
+  shouldBeTrue('maxSize[1] > 0');
+
+  // debug("MAX_VIEWPORT_DIMS = " + maxSize[0] + "x" + maxSize[1]);
+  canvas.width = maxSize[0] * 4;
+  canvas.height = maxSize[1] * 4;
+  shouldBeTrue('gl.drawingBufferWidth > 0');
+  shouldBeTrue('gl.drawingBufferHeight > 0');
+  shouldBeTrue('gl.drawingBufferWidth <= maxSize[0]');
+  shouldBeTrue('gl.drawingBufferHeight <= maxSize[1]');
+  shouldBe('gl.getError()', 'gl.NO_ERROR');
+}
+debug("")
+successfullyParsed = true;
+</script>
+<script src="../resources/js-test-post.js"></script>
+</body>
+</html>
--- a/content/canvas/test/webgl/conformance/error-reporting.html
+++ b/content/canvas/test/webgl/conformance/error-reporting.html
@@ -1,10 +1,10 @@
 <!--
-Copyright (c) 2009 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions are
 met:
 
    * Redistributions of source code must retain the above copyright
 notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above
@@ -22,18 +22,20 @@ A PARTICULAR PURPOSE ARE DISCLAIMED. IN 
 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 -->
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 </head>
 <body>
 <div id="description"></div>
 <div id="console"></div>
 
--- a/content/canvas/test/webgl/conformance/framebuffer-object-attachment.html
+++ b/content/canvas/test/webgl/conformance/framebuffer-object-attachment.html
@@ -1,42 +1,50 @@
 <!--
-Copyright (c) 2010 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
  -->
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 </head>
 <body>
 <div id="description"></div>
 <div id="console"></div>
 
 <script>
 
 var gl;
 var fbo;
 var depthBuffer;
 var stencilBuffer;
 var depthStencilBuffer;
 var colorBuffer;
-var width = 2;
-var height = 2;
+var width;
+var height;
 
 function testAttachment(attachment, buffer, isConflicted)
 {
     shouldBeNonNull("fbo = gl.createFramebuffer()");
     gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
     gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, colorBuffer);
     gl.framebufferRenderbuffer(gl.FRAMEBUFFER, attachment, gl.RENDERBUFFER, buffer);
     glErrorShouldBe(gl, gl.NO_ERROR);
-    if (isConflicted) {
+    // If the framebuffer is in an error state for multiple reasons,
+    // we can't guarantee which one will be reported.
+    if ((width == 0 || height == 0) && !isConflicted) {
+        // Zero-sized renderbuffers are supposed to result in an incomplete attachment.
+        // However, certain combination may violate implementation specific restrictions.
+        shouldBeTrue("gl.checkFramebufferStatus(gl.FRAMEBUFFER) == gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT || gl.checkFramebufferStatus(gl.FRAMEBUFFER) == gl.FRAMEBUFFER_UNSUPPORTED");
+    } else if (isConflicted) {
         shouldBe("gl.checkFramebufferStatus(gl.FRAMEBUFFER)", "gl.FRAMEBUFFER_UNSUPPORTED");
         gl.clear(gl.COLOR_BUFFER_BIT);
         glErrorShouldBe(gl, gl.INVALID_FRAMEBUFFER_OPERATION);
         gl.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, new Uint8Array(width * height * 4));
         glErrorShouldBe(gl, gl.INVALID_FRAMEBUFFER_OPERATION);
     }
 }
 
@@ -44,18 +52,25 @@ function testAttachments(attachment0, bu
 {
     shouldBeNonNull("fbo = gl.createFramebuffer()");
     gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
     gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, colorBuffer);
     gl.framebufferRenderbuffer(gl.FRAMEBUFFER, attachment0, gl.RENDERBUFFER, buffer0);
     glErrorShouldBe(gl, gl.NO_ERROR);
     gl.framebufferRenderbuffer(gl.FRAMEBUFFER, attachment1, gl.RENDERBUFFER, buffer1);
     glErrorShouldBe(gl, gl.NO_ERROR);
-    if (isConflicted)
+    // If the framebuffer is in an error state for multiple reasons,
+    // we can't guarantee which one will be reported.
+    if ((width == 0 || height == 0) && !isConflicted) {
+        // Zero-sized renderbuffers are supposed to result in an incomplete attachment.
+        // However, certain combination may violate implementation specific restrictions.
+        shouldBeTrue("gl.checkFramebufferStatus(gl.FRAMEBUFFER) == gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT || gl.checkFramebufferStatus(gl.FRAMEBUFFER) == gl.FRAMEBUFFER_UNSUPPORTED");
+    } else if (isConflicted) {
         shouldBe("gl.checkFramebufferStatus(gl.FRAMEBUFFER)", "gl.FRAMEBUFFER_UNSUPPORTED");
+    }
 }
 
 function testColorRenderbuffer(internalformat)
 {
     shouldBeNonNull("colorBuffer = gl.createRenderbuffer()");
     gl.bindRenderbuffer(gl.RENDERBUFFER, colorBuffer);
     gl.renderbufferStorage(gl.RENDERBUFFER, internalformat, width, height);
     glErrorShouldBe(gl, gl.NO_ERROR);
@@ -63,92 +78,109 @@ function testColorRenderbuffer(internalf
 }
 
 function testDepthStencilRenderbuffer()
 {
     shouldBeNonNull("depthStencilBuffer = gl.createRenderbuffer()");
     gl.bindRenderbuffer(gl.RENDERBUFFER, depthStencilBuffer);
     gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_STENCIL, width, height);
     glErrorShouldBe(gl, gl.NO_ERROR);
-    shouldBe("gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_WIDTH)", "width");
-    shouldBe("gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_HEIGHT)", "height");
+
+    // OpenGL itself doesn't seem to guarantee that e.g. a 2 x 0
+    // renderbuffer will report 2 for its width when queried.
+    if (!(height == 0 && width > 0))
+        shouldBe("gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_WIDTH)", "width");
+    if (!(width == 0 && height > 0))
+        shouldBe("gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_HEIGHT)", "height");
     shouldBe("gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_INTERNAL_FORMAT)", "gl.DEPTH_STENCIL");
     shouldBe("gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_RED_SIZE)", "0");
     shouldBe("gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_GREEN_SIZE)", "0");
     shouldBe("gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_BLUE_SIZE)", "0");
     shouldBe("gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_ALPHA_SIZE)", "0");
-    shouldBeTrue("gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_DEPTH_SIZE) > 0");
-    shouldBeTrue("gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_STENCIL_SIZE) > 0");
+    // Avoid verifying these for zero-sized renderbuffers for the time
+    // being since it appears that even OpenGL doesn't guarantee them.
+    if (width > 0 && height > 0) {
+        shouldBeTrue("gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_DEPTH_SIZE) > 0");
+        shouldBeTrue("gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_STENCIL_SIZE) > 0");
+    }
     glErrorShouldBe(gl, gl.NO_ERROR);
     testAttachment(gl.DEPTH_STENCIL_ATTACHMENT, depthStencilBuffer, false);
 }
 
 description("Test framebuffer object attachment behaviors");
 
-debug("Create renderbuffers");
-shouldBeNonNull("gl = create3DContext()");
-shouldBeNonNull("colorBuffer = gl.createRenderbuffer()");
-gl.bindRenderbuffer(gl.RENDERBUFFER, colorBuffer);
-gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA4, width, height);
-glErrorShouldBe(gl, gl.NO_ERROR);
-shouldBeNonNull("depthBuffer = gl.createRenderbuffer()");
-gl.bindRenderbuffer(gl.RENDERBUFFER, depthBuffer);
-gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_COMPONENT16, width, height);
-glErrorShouldBe(gl, gl.NO_ERROR);
-shouldBeNonNull("stencilBuffer = gl.createRenderbuffer()");
-gl.bindRenderbuffer(gl.RENDERBUFFER, stencilBuffer);
-gl.renderbufferStorage(gl.RENDERBUFFER, gl.STENCIL_INDEX8, width, height);
-glErrorShouldBe(gl, gl.NO_ERROR);
-shouldBeNonNull("depthStencilBuffer = gl.createRenderbuffer()");
-gl.bindRenderbuffer(gl.RENDERBUFFER, depthStencilBuffer);
-gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_STENCIL, width, height);
-glErrorShouldBe(gl, gl.NO_ERROR);
+for (width = 0; width <= 2; width += 2)
+{
+    for (height = 0; height <= 2; height += 2)
+    {
+        debug("Dimensions " + width + " x " + height);
+
+        debug("Create renderbuffers");
+        shouldBeNonNull("gl = create3DContext()");
+        shouldBeNonNull("colorBuffer = gl.createRenderbuffer()");
+        gl.bindRenderbuffer(gl.RENDERBUFFER, colorBuffer);
+        gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA4, width, height);
+        glErrorShouldBe(gl, gl.NO_ERROR);
+        shouldBeNonNull("depthBuffer = gl.createRenderbuffer()");
+        gl.bindRenderbuffer(gl.RENDERBUFFER, depthBuffer);
+        gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_COMPONENT16, width, height);
+        glErrorShouldBe(gl, gl.NO_ERROR);
+        shouldBeNonNull("stencilBuffer = gl.createRenderbuffer()");
+        gl.bindRenderbuffer(gl.RENDERBUFFER, stencilBuffer);
+        gl.renderbufferStorage(gl.RENDERBUFFER, gl.STENCIL_INDEX8, width, height);
+        glErrorShouldBe(gl, gl.NO_ERROR);
+        shouldBeNonNull("depthStencilBuffer = gl.createRenderbuffer()");
+        gl.bindRenderbuffer(gl.RENDERBUFFER, depthStencilBuffer);
+        gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_STENCIL, width, height);
+        glErrorShouldBe(gl, gl.NO_ERROR);
 
-debug("Attach depth using DEPTH_ATTACHMENT");
-testAttachment(gl.DEPTH_ATTACHMENT, depthBuffer, false);
-debug("Attach depth using STENCIL_ATTACHMENT");
-testAttachment(gl.STENCIL_ATTACHMENT, depthBuffer, true);
-debug("Attach depth using DEPTH_STENCIL_ATTACHMENT");
-testAttachment(gl.DEPTH_STENCIL_ATTACHMENT, depthBuffer, true);
-debug("Attach stencil using STENCIL_ATTACHMENT");
-testAttachment(gl.STENCIL_ATTACHMENT, stencilBuffer, false);
-debug("Attach stencil using DEPTH_ATTACHMENT");
-testAttachment(gl.DEPTH_ATTACHMENT, stencilBuffer, true);
-debug("Attach stencil using DEPTH_STENCIL_ATTACHMENT");
-testAttachment(gl.DEPTH_STENCIL_ATTACHMENT, stencilBuffer, true);
-debug("Attach depthStencil using DEPTH_STENCIL_ATTACHMENT");
-testAttachment(gl.DEPTH_STENCIL_ATTACHMENT, depthStencilBuffer, false);
-debug("Attach depthStencil using DEPTH_ATTACHMENT");
-testAttachment(gl.DEPTH_ATTACHMENT, depthStencilBuffer, true);
-debug("Attach depthStencil using STENCIL_ATTACHMENT");
-testAttachment(gl.STENCIL_ATTACHMENT, depthStencilBuffer, true);
+        debug("Attach depth using DEPTH_ATTACHMENT");
+        testAttachment(gl.DEPTH_ATTACHMENT, depthBuffer, false);
+        debug("Attach depth using STENCIL_ATTACHMENT");
+        testAttachment(gl.STENCIL_ATTACHMENT, depthBuffer, true);
+        debug("Attach depth using DEPTH_STENCIL_ATTACHMENT");
+        testAttachment(gl.DEPTH_STENCIL_ATTACHMENT, depthBuffer, true);
+        debug("Attach stencil using STENCIL_ATTACHMENT");
+        testAttachment(gl.STENCIL_ATTACHMENT, stencilBuffer, false);
+        debug("Attach stencil using DEPTH_ATTACHMENT");
+        testAttachment(gl.DEPTH_ATTACHMENT, stencilBuffer, true);
+        debug("Attach stencil using DEPTH_STENCIL_ATTACHMENT");
+        testAttachment(gl.DEPTH_STENCIL_ATTACHMENT, stencilBuffer, true);
+        debug("Attach depthStencil using DEPTH_STENCIL_ATTACHMENT");
+        testAttachment(gl.DEPTH_STENCIL_ATTACHMENT, depthStencilBuffer, false);
+        debug("Attach depthStencil using DEPTH_ATTACHMENT");
+        testAttachment(gl.DEPTH_ATTACHMENT, depthStencilBuffer, true);
+        debug("Attach depthStencil using STENCIL_ATTACHMENT");
+        testAttachment(gl.STENCIL_ATTACHMENT, depthStencilBuffer, true);
 
-debug("Attach depth, then stencil, causing conflict");
-testAttachments(gl.DEPTH_ATTACHMENT, depthBuffer, gl.STENCIL_ATTACHMENT, stencilBuffer, true);
-debug("Attach stencil, then depth, causing conflict");
-testAttachments(gl.STENCIL_ATTACHMENT, stencilBuffer, gl.DEPTH_ATTACHMENT, depthBuffer, true);
-debug("Attach depth, then depthStencil, causing conflict");
-testAttachments(gl.DEPTH_ATTACHMENT, depthBuffer, gl.DEPTH_STENCIL_ATTACHMENT, depthStencilBuffer, true);
-debug("Attach depthStencil, then depth, causing conflict");
-testAttachments(gl.DEPTH_STENCIL_ATTACHMENT, depthStencilBuffer, gl.DEPTH_ATTACHMENT, depthBuffer, true);
-debug("Attach stencil, then depthStencil, causing conflict");
-testAttachments(gl.DEPTH_ATTACHMENT, depthBuffer, gl.DEPTH_STENCIL_ATTACHMENT, depthStencilBuffer, true);
-debug("Attach depthStencil, then stencil, causing conflict");
-testAttachments(gl.DEPTH_STENCIL_ATTACHMENT, depthStencilBuffer, gl.STENCIL_ATTACHMENT, stencilBuffer, true);
+        debug("Attach depth, then stencil, causing conflict");
+        testAttachments(gl.DEPTH_ATTACHMENT, depthBuffer, gl.STENCIL_ATTACHMENT, stencilBuffer, true);
+        debug("Attach stencil, then depth, causing conflict");
+        testAttachments(gl.STENCIL_ATTACHMENT, stencilBuffer, gl.DEPTH_ATTACHMENT, depthBuffer, true);
+        debug("Attach depth, then depthStencil, causing conflict");
+        testAttachments(gl.DEPTH_ATTACHMENT, depthBuffer, gl.DEPTH_STENCIL_ATTACHMENT, depthStencilBuffer, true);
+        debug("Attach depthStencil, then depth, causing conflict");
+        testAttachments(gl.DEPTH_STENCIL_ATTACHMENT, depthStencilBuffer, gl.DEPTH_ATTACHMENT, depthBuffer, true);
+        debug("Attach stencil, then depthStencil, causing conflict");
+        testAttachments(gl.DEPTH_ATTACHMENT, depthBuffer, gl.DEPTH_STENCIL_ATTACHMENT, depthStencilBuffer, true);
+        debug("Attach depthStencil, then stencil, causing conflict");
+        testAttachments(gl.DEPTH_STENCIL_ATTACHMENT, depthStencilBuffer, gl.STENCIL_ATTACHMENT, stencilBuffer, true);
 
-debug("Attach color renderbuffer with internalformat == RGBA4");
-testColorRenderbuffer(gl.RGBA4);
+        debug("Attach color renderbuffer with internalformat == RGBA4");
+        testColorRenderbuffer(gl.RGBA4);
 
-debug("Attach color renderbuffer with internalformat == RGB5_A1");
-testColorRenderbuffer(gl.RGB5_A1);
+        debug("Attach color renderbuffer with internalformat == RGB5_A1");
+        testColorRenderbuffer(gl.RGB5_A1);
 
-debug("Attach color renderbuffer with internalformat == RGB565");
-testColorRenderbuffer(gl.RGB565);
+        debug("Attach color renderbuffer with internalformat == RGB565");
+        testColorRenderbuffer(gl.RGB565);
 
-debug("Create and attach depthStencil renderbuffer");
-testDepthStencilRenderbuffer();
+        debug("Create and attach depthStencil renderbuffer");
+        testDepthStencilRenderbuffer();
+    }
+}
 
 successfullyParsed = true;
 </script>
 
 <script src="../resources/js-test-post.js"></script>
 </body>
 </html>
--- a/content/canvas/test/webgl/conformance/framebuffer-test.html
+++ b/content/canvas/test/webgl/conformance/framebuffer-test.html
@@ -1,18 +1,17 @@
 <!--
-Copyright (c) 2009 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
  -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-  "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE html>
 <html>
 <head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<meta charset="utf-8">
 <title>WebGL Framebuffer Test</title>
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 </head>
 <body>
 <div id="description"></div>
 <div id="console"></div>
@@ -163,13 +162,11 @@ if (!gl) {
             "binding default (null) framebuffer should succeed.");
 }
 
 debug("");
 successfullyParsed = true;
 
 </script>
 <script src="../resources/js-test-post.js"></script>
-<script>
-</script>
 
 </body>
 </html>
--- a/content/canvas/test/webgl/conformance/get-active-test.html
+++ b/content/canvas/test/webgl/conformance/get-active-test.html
@@ -1,10 +1,10 @@
 <!--
-Copyright (C) 2009 Apple Computer, Inc.  All rights reserved.
+Copyright (C) 2011 Apple Computer, Inc.  All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions
 are met:
 1. Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
 2. Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
@@ -17,19 +17,20 @@ PURPOSE ARE DISCLAIMED.  IN NO EVENT SHA
 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 -->
-
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 </head>
 <body>
 <div id="description"></div>
 <div id="console"></div>
 
--- a/content/canvas/test/webgl/conformance/gl-bind-attrib-location-test.html
+++ b/content/canvas/test/webgl/conformance/gl-bind-attrib-location-test.html
@@ -1,18 +1,17 @@
 <!--
-Copyright (c) 2009 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
  -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-  "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE html>
 <html>
 <head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<meta charset="utf-8">
 <title>WebGL BindAttribLocation Conformance Tests</title>
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 </head>
 <body>
 <div id="description"></div>
 <div id="console"></div>
@@ -23,19 +22,18 @@ attribute vec4 vColor;
 varying vec4 color;
 void main()
 {
   gl_Position = vPosition;
   color = vColor;
 }
 </script>
 <script id="fshader" type="text/something-not-javascript">
-#ifdef GL_ES
-precision highp float;
-#endif
+precision mediump float;
+
 varying vec4 color;
 void main()
 {
   gl_FragColor = color;
 }
 </script>
 <script>
 description("This test ensures WebGL implementations don't allow names that start with 'gl_' when calling bindAttribLocation.");
--- a/content/canvas/test/webgl/conformance/gl-clear.html
+++ b/content/canvas/test/webgl/conformance/gl-clear.html
@@ -1,17 +1,17 @@
 <!--
-Copyright (c) 2009 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
   found in the LICENSE file.
  -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-  "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <title>WebGL clear conformance test.</title>
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"> </script>
 <script src="resources/webgl-test-utils.js"> </script>
 </head>
 <body>
 <canvas id="example" width="1" height="1" style="width: 256px; height: 48px;"></canvas>
--- a/content/canvas/test/webgl/conformance/gl-drawelements.html
+++ b/content/canvas/test/webgl/conformance/gl-drawelements.html
@@ -1,17 +1,17 @@
 <!--
-Copyright (c) 2009 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
 -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-  "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE html>
 <html>
   <head>
+<meta charset="utf-8">
     <title>WebGL drawElements Test</title>
     <link rel="stylesheet" href="../resources/js-test-style.css"/>
     <script src="../resources/js-test-pre.js"></script>
     <script src="resources/webgl-test.js"> </script>
     <script src="../resources/desktop-gl-constants.js" type="text/javascript"></script>
 </head>
 <body>
 <canvas id="example" width="50" height="50"></canvas>
@@ -85,16 +85,12 @@ found in the LICENSE file.
                 gl.TRIANGLES, 3, gl.UNSIGNED_INT,
                 gl.INVALID_ENUM, "gl.DrawElements should return INVALID_ENUM with UNSIGNED_INT");
 
        }
 
        init();
        successfullyParsed = true;
     </script>
-</body>
 <script src="../resources/js-test-post.js"></script>
 
-<script>
-</script>
-
 </body>
 </html>
--- a/content/canvas/test/webgl/conformance/gl-enable-enum-test.html
+++ b/content/canvas/test/webgl/conformance/gl-enable-enum-test.html
@@ -1,18 +1,17 @@
 <!--
-Copyright (c) 2009 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
  -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-  "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE html>
 <html>
 <head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<meta charset="utf-8">
 <title>WebGL gl.ENABLE enums Conformance Tests</title>
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/desktop-gl-constants.js" type="text/javascript"></script>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 </head>
 <body>
 <div id="description"></div>
@@ -125,13 +124,10 @@ if (!gl) {
 }
 
 debug("");
 successfullyParsed = true;
 
 </script>
 <script src="../resources/js-test-post.js"></script>
 
-<script>
-</script>
-
 </body>
 </html>
--- a/content/canvas/test/webgl/conformance/gl-enable-vertex-attrib.html
+++ b/content/canvas/test/webgl/conformance/gl-enable-vertex-attrib.html
@@ -1,16 +1,17 @@
 <!--
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 -->
 <!DOCTYPE html>
 <html>
   <head>
+<meta charset="utf-8">
     <title>WebGL Enable Vertex Attrib Test</title>
     <link rel="stylesheet" href="../resources/js-test-style.css"/>
     <script src="../resources/js-test-pre.js"></script>
     <script src="resources/webgl-test.js"> </script>
 </head>
 <body>
 <canvas id="example" width="50" height="50">
 </canvas>
@@ -44,17 +45,13 @@ gl.vertexAttribPointer(0, 3, gl.FLOAT, f
 gl.enableVertexAttribArray(3);
 glErrorShouldBe(gl, gl.NO_ERROR);
 
 gl.drawArrays(gl.TRIANGLES, 0, 3);
 glErrorShouldBe(gl, gl.INVALID_OPERATION);
 
 successfullyParsed = true;
 </script>
-</body>
 <script src="../resources/js-test-post.js"></script>
 
-<script>
-</script>
-
 </body>
 </html>
 
--- a/content/canvas/test/webgl/conformance/gl-enum-tests.html
+++ b/content/canvas/test/webgl/conformance/gl-enum-tests.html
@@ -1,18 +1,17 @@
 <!--
-Copyright (c) 2009 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
  -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-  "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE html>
 <html>
 <head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<meta charset="utf-8">
 <title>WebGL gl enums Conformance Tests</title>
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/desktop-gl-constants.js" type="text/javascript"></script>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 </head>
 <body>
 <div id="description"></div>
@@ -78,14 +77,11 @@ if (!gl) {
 }
 
 debug("");
 successfullyParsed = true;
 
 </script>
 <script src="../resources/js-test-post.js"></script>
 
-<script>
-</script>
-
 </body>
 </html>
 
new file mode 100755
--- /dev/null
+++ b/content/canvas/test/webgl/conformance/gl-fragcoord.html
@@ -0,0 +1,84 @@
+<!--
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
+Use of this source code is governed by a BSD-style license that can be
+found in the LICENSE file.
+ -->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+  <title>gl-fragcoord Test</title>
+  <link rel="stylesheet" href="../resources/js-test-style.css"/>
+  <script src="../resources/js-test-pre.js"></script>
+  <script src="resources/webgl-test.js"> </script>
+  <script src="resources/webgl-test-utils.js"> </script>
+</head>
+<body>
+<canvas id="example" width="32" height="32">
+</canvas>
+<div id="description"></div>
+<div id="console"></div>
+  <script id="vshader" type="x-shader/x-vertex">
+    attribute vec4 vPosition;
+    void main()
+    {
+      gl_Position = vPosition;
+    }
+  </script>
+
+  <script id="fshader" type="x-shader/x-fragment">
+    precision mediump float;
+    void main()
+    {
+      gl_FragColor = vec4(
+        floor(gl_FragCoord.x * 4.0 / 32.0) / 4.0,
+        floor(gl_FragCoord.y * 4.0 / 32.0) / 4.0,
+        floor(gl_FragCoord.z * 4.0) / 4.0,
+        1);
+    }
+  </script>
+
+  <script>
+    function init()
+    {
+      if (window.initNonKhronosFramework) {
+        window.initNonKhronosFramework(false);
+      }
+
+      wtu = WebGLTestUtils;
+      gl = initWebGL("example", "vshader", "fshader", [ "vPosition"], [ 0, 0, 0, 1 ], 1);
+
+      var vertexObject = gl.createBuffer();
+      gl.bindBuffer(gl.ARRAY_BUFFER, vertexObject);
+      gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(
+        [-1, -1, -1,  1, -1,  0, -1,  1,  0,
+         -1,  1,  0,  1, -1,  0,  1,  1,  1]),
+                    gl.STATIC_DRAW);
+      gl.enableVertexAttribArray(0);
+      gl.vertexAttribPointer(0, 3, gl.FLOAT, false, 0, 0);
+
+      gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+      gl.drawArrays(gl.TRIANGLES, 0, 6);
+
+      for (var xx = 0; xx < 32; xx += 4) {
+        for (var yy = 0; yy < 32; yy += 4) {
+          var zz = (xx / 64) + (yy / 64);
+          var color = [
+             Math.floor(Math.floor(xx * 4.0 / 32.0) / 4 * 256),
+             Math.floor(Math.floor(yy * 4.0 / 32.0) / 4 * 256),
+             Math.floor(Math.floor(zz * 4.0) / 4 * 256)
+          ];
+          var msg = "should be " + color;
+          wtu.checkCanvasRect(
+              gl, xx, yy, 1, 1, color, msg, 4);
+        }
+      }
+    }
+
+    init();
+    successfullyParsed = true;
+  </script>
+<script src="../resources/js-test-post.js"></script>
+
+</body>
+</html>
--- a/content/canvas/test/webgl/conformance/gl-get-active-attribute.html
+++ b/content/canvas/test/webgl/conformance/gl-get-active-attribute.html
@@ -1,17 +1,17 @@
 <!--
-Copyright (c) 2009 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
  -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-  "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <title>WebGL getActiveAttrib conformance test.</title>
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"> </script>
 <script src="resources/webgl-test-utils.js"> </script>
 </head>
 <body>
 <canvas id="example" width="16" height="16"></canvas>
@@ -72,18 +72,14 @@ for (var tt = 0; tt < tests.length; ++tt
   }
   if (!found) {
     testFailed("attrib 'attr0' not found");
   }
 }
 
 successfullyParsed = true;
 </script>
-</body>
 <script src="../resources/js-test-post.js"></script>
 
-<script>
-</script>
-
 </body>
 </html>
 
 
--- a/content/canvas/test/webgl/conformance/gl-get-active-uniform.html
+++ b/content/canvas/test/webgl/conformance/gl-get-active-uniform.html
@@ -1,17 +1,17 @@
 <!--
-Copyright (c) 2009 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
  -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-  "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <title>WebGL getActiveUniform conformance test.</title>
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"> </script>
 <script src="resources/webgl-test-utils.js"> </script>
 </head>
 <body>
 <canvas id="example" width="16" height="16"></canvas>
@@ -133,18 +133,14 @@ gl.useProgram(p2);
 gl.uniform1f(l2, 1);
 glErrorShouldBe(gl, gl.NO_ERROR, "no errors setting uniform 0");
 gl.uniform1f(l1, 2);
 glErrorShouldBe(gl, gl.INVALID_OPERATION,
                 "setting a uniform using a location from another program");
 
 successfullyParsed = true;
 </script>
-</body>
 <script src="../resources/js-test-post.js"></script>
 
-<script>
-</script>
-
 </body>
 </html>
 
 
--- a/content/canvas/test/webgl/conformance/gl-get-calls.html
+++ b/content/canvas/test/webgl/conformance/gl-get-calls.html
@@ -1,10 +1,10 @@
 <!--
-Copyright (C) 2009 Apple Computer, Inc.  All rights reserved.
+Copyright (C) 2011 Apple Computer, Inc.  All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions
 are met:
 1. Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
 2. Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
@@ -18,19 +18,20 @@ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, I
 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 -->
 
-<html xmlns="http://www.w3.org/1999/xhtml">
+<!DOCTYPE html>
+<html>
 <head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<meta charset="utf-8">
 <title>WebGL gl calls Conformance Tests</title>
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 </head>
 <body>
 <div id="description"></div>
 <div id="console"></div>
@@ -142,13 +143,10 @@ else {
 }
 
 debug("");
 successfullyParsed = true;
 
 </script>
 <script src="../resources/js-test-post.js"></script>
 
-<script>
-</script>
-
 </body>
 </html>
new file mode 100644
--- /dev/null
+++ b/content/canvas/test/webgl/conformance/gl-geterror.html
@@ -0,0 +1,77 @@
+<!--
+Copyright (c) 2009 The Chromium Authors. All rights reserved.
+Use of this source code is governed by a BSD-style license that can be
+  found in the LICENSE file.
+ -->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+  "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<title>WebGL get error conformance test.</title>
+<link rel="stylesheet" href="../resources/js-test-style.css"/>
+<script src="../resources/desktop-gl-constants.js" type="text/javascript"></script>
+<script src="../resources/js-test-pre.js"></script>
+<script src="resources/webgl-test.js"> </script>
+<script src="resources/webgl-test-utils.js"> </script>
+</head>
+<body>
+<canvas id="example" width="1" height="1" style="width: 256px; height: 48px;"></canvas>
+<div id="description"></div><div id="console"></div>
+<script>
+description("Test getError.");
+var wtu = WebGLTestUtils;
+var canvas = document.getElementById("example");
+var gl = wtu.create3DContext(canvas);
+var tex = gl.createTexture();
+gl.bindTexture(gl.TEXTURE_2D, tex);
+
+gl.enable(desktopGL.ALPHA_TEST);
+glErrorShouldBe(gl, gl.INVALID_ENUM, "should generate INVALID_ENUM");
+gl.viewport(-1, -1, -1, -1);
+glErrorShouldBe(gl, gl.INVALID_VALUE, "should generate INVALID_VALUE");
+gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+glErrorShouldBe(gl, gl.INVALID_OPERATION, "should generate INVALID_OPERATION");
+
+// Generate 2 errors of each type for 6 total possible errors.
+// The OpenGL ES 2.0 spec section 2.5 says the implementation is allowed to
+// either return the first error or many errors in an unspecied order.
+gl.viewport(-1, -1, -1, -1);
+gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+gl.enable(desktopGL.ALPHA_TEST);
+gl.viewport(-1, -1, -1, -1);
+gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+// Note: This error is specifically last because we know it will be synthasized
+// by WebGL at least when implemented on top of Desktop OpenGL
+gl.enable(desktopGL.ALPHA_TEST);
+
+var err1 = gl.getError();
+var err2 = gl.getError();
+var err3 = gl.getError();
+var err4 = gl.getError();
+var err5 = gl.getError();
+var err6 = gl.getError();
+
+debug("");
+if (err2 == gl.NO_ERROR) {
+  debug("This WebGL implementation looks like it uses the 'first error' method");
+  debug("There should be 1 error, the first one generated");
+  shouldBeTrue('err1 == gl.INVALID_VALUE && err2 == gl.NO_ERROR && err3 == gl.NO_ERROR');
+} else {
+  debug("This WebGL implementation looks like it uses the many error method");
+  debug("Check is that at least one of the errors is the first error");
+  shouldBeTrue('err1 == gl.INVALID_VALUE || ' +
+               'err2 == gl.INVALID_VALUE || ' +
+               'err3 == gl.INVALID_VALUE || ' +
+               'err4 == gl.INVALID_VALUE || ' +
+               'err5 == gl.INVALID_VALUE || ' +
+               'err6 == gl.INVALID_VALUE');
+  shouldBeTrue('gl.getError() == gl.NO_ERROR');
+}
+
+debug("");
+successfullyParsed = true;
+</script>
+<script src="../resources/js-test-post.js"></script>
+</body>
+</html>
+
--- a/content/canvas/test/webgl/conformance/gl-getshadersource.html
+++ b/content/canvas/test/webgl/conformance/gl-getshadersource.html
@@ -1,18 +1,17 @@
 <!--
-Copyright (c) 2009 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
  -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-  "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE html>
 <html>
 <head>
-<meta content='text/html; charset=UTF-8' http-equiv='Content-Type'/>
+<meta charset="utf-8">
    <title>WebGL getShaderSource conformance test.</title>
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"> </script>
 <script src="resources/webgl-test-utils.js"> </script>
 </head>
 <body>
 <canvas id="example" width="4" height="4" style="width: 40px; height: 30px;"></canvas>
@@ -27,19 +26,14 @@ var gl = wtu.create3DContext(canvas);
 var original = document.getElementById("vshader").text;
 var shader = gl.createShader(gl.VERTEX_SHADER);
 gl.shaderSource(shader, original);
 var source = gl.getShaderSource(shader);
 shouldBe("source", "original");
 glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors.");
 successfullyParsed = true;
 </script>
-</body>
-</body>
 <script src="../resources/js-test-post.js"></script>
 
-<script>
-</script>
-
 </body>
 </html>
 
 
--- a/content/canvas/test/webgl/conformance/gl-getstring.html
+++ b/content/canvas/test/webgl/conformance/gl-getstring.html
@@ -1,18 +1,17 @@
 <!--
-Copyright (c) 2009 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
  -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-  "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE html>
 <html>
 <head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<meta charset="utf-8">
 <title>WebGL gl.getParameter Strings Conformance Tests</title>
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/desktop-gl-constants.js" type="text/javascript"></script>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 </head>
 <body>
 <div id="description"></div>
@@ -50,13 +49,10 @@ function checkPrefix(expected, enum_val)
 }
 
 debug("");
 successfullyParsed = true;
 
 </script>
 <script src="../resources/js-test-post.js"></script>
 
-<script>
-</script>
-
 </body>
 </html>
--- a/content/canvas/test/webgl/conformance/gl-min-attribs.html
+++ b/content/canvas/test/webgl/conformance/gl-min-attribs.html
@@ -1,17 +1,17 @@
 <!--
-Copyright (c) 2009 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
  -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-  "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <title>WebGL the minimum number of attributes are supported.</title>
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"> </script>
 <script src="resources/webgl-test-utils.js"> </script>
 </head>
 <body>
 <canvas id="example" width="4" height="4" style="width: 40px; height: 30px;"></canvas>
@@ -30,19 +30,17 @@ varying vec4 color;
 void main()
 {
     gl_Position = vPosition;
     color = v0 + v1 + v2 + v3 + v4 + v5 + v6;
 }
 </script>
 
 <script id="fshader" type="x-shader/x-fragment">
-#ifdef GL_ES
 precision mediump float;
-#endif
 varying vec4 color;
 void main()
 {
     gl_FragColor = color;
 }
 </script>
 <script>
 var wtu = WebGLTestUtils;
@@ -77,15 +75,12 @@ glErrorShouldBe(gl, gl.NO_ERROR, "Should
 wtu.checkCanvasRect(gl, 0, 0, canvas.width, canvas.height, [255, 127, 64, 32], "Should render 255,127,64,32 (+/-1)", 1);
 
 successfullyParsed = true;
 
 </script>
 </body>
 <script src="../resources/js-test-post.js"></script>
 
-<script>
-</script>
-
 </body>
 </html>
 
 
deleted file mode 100644
--- a/content/canvas/test/webgl/conformance/gl-min-textures-unroll.html
+++ /dev/null
@@ -1,86 +0,0 @@
-<!--
-Copyright (c) 2009 The Chromium Authors. All rights reserved.
-Use of this source code is governed by a BSD-style license that can be
-found in the LICENSE file.
- -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-  "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<title>WebGL the minimum number of uniforms are supported.</title>
-<link rel="stylesheet" href="../resources/js-test-style.css"/>
-<script src="../resources/js-test-pre.js"></script>
-<script src="resources/webgl-test.js"> </script>
-<script src="resources/webgl-test-utils.js"> </script>
-</head>
-<body>
-<canvas id="example" width="4" height="4" style="width: 40px; height: 30px;"></canvas>
-<div id="description"></div>
-<div id="console"></div>
-<script id="vshader" type="x-shader/x-vertex">
-attribute vec4 vPosition;
-void main()
-{
-    gl_Position = vPosition;
-}
-</script>
-
-<script id="fshader" type="x-shader/x-fragment">
-#define NUM_TEXTURES 8 // See spec
-#ifdef GL_ES
-precision mediump float;
-#endif
-uniform sampler2D uni[8];
-void main()
-{
-    vec4 c = vec4(0,0,0,0);
-    c += texture2D(uni[0], vec2(0.5, 0.5));
-    c += texture2D(uni[1], vec2(0.5, 0.5));
-    c += texture2D(uni[2], vec2(0.5, 0.5));
-    c += texture2D(uni[3], vec2(0.5, 0.5));
-    c += texture2D(uni[4], vec2(0.5, 0.5));
-    c += texture2D(uni[5], vec2(0.5, 0.5));
-    c += texture2D(uni[6], vec2(0.5, 0.5));
-    c += texture2D(uni[7], vec2(0.5, 0.5));
-    gl_FragColor = c;
-}
-</script>
-<script>
-var wtu = WebGLTestUtils;
-var canvas = document.getElementById("example");
-var gl = wtu.create3DContext(canvas);
-var program = wtu.setupTexturedQuad(gl);
-
-//------------------------------------------------------------------------------
-var program = wtu.setupProgram(
-    gl,
-    [wtu.loadShaderFromScript(gl, 'vshader', gl.VERTEX_SHADER),
-     wtu.loadShaderFromScript(gl, 'fshader', gl.FRAGMENT_SHADER)],
-    ['vPosition'], [0]);
-
-for (var ii = 0; ii < 8; ++ii) {
-  var loc = gl.getUniformLocation(program, "uni[" + ii + "]");
-  gl.activeTexture(gl.TEXTURE0 + ii);
-  var tex = gl.createTexture();
-  wtu.fillTexture(gl, tex, 1, 1, [32, 16, 8, ii * 9], 0);
-  gl.uniform1i(loc, ii);
-}
-
-wtu.drawQuad(gl);
-glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from setup.");
-wtu.checkCanvas(gl, [255, 128, 64, 252],
-                "Should render using all texture units");
-
-successfullyParsed = true;
-
-</script>
-</body>
-<script src="../resources/js-test-post.js"></script>
-
-<script>
-</script>
-
-</body>
-</html>
-
-
--- a/content/canvas/test/webgl/conformance/gl-min-textures.html
+++ b/content/canvas/test/webgl/conformance/gl-min-textures.html
@@ -1,17 +1,17 @@
 <!--
-Copyright (c) 2009 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
  -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-  "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <title>WebGL the minimum number of uniforms are supported.</title>
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"> </script>
 <script src="resources/webgl-test-utils.js"> </script>
 </head>
 <body>
 <canvas id="example" width="4" height="4" style="width: 40px; height: 30px;"></canvas>
@@ -22,19 +22,17 @@ attribute vec4 vPosition;
 void main()
 {
     gl_Position = vPosition;
 }
 </script>
 
 <script id="fshader" type="x-shader/x-fragment">
 #define NUM_TEXTURES 8 // See spec
-#ifdef GL_ES
 precision mediump float;
-#endif
 uniform sampler2D uni[8];
 void main()
 {
     vec4 c = vec4(0,0,0,0);
     for (int ii = 0; ii < NUM_TEXTURES; ++ii) {
       c += texture2D(uni[ii], vec2(0.5, 0.5));
     }
     gl_FragColor = c;
@@ -64,18 +62,14 @@ for (var ii = 0; ii < 8; ++ii) {
 wtu.drawQuad(gl);
 glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from setup.");
 wtu.checkCanvas(gl, [255, 128, 64, 252],
                 "Should render using all texture units");
 
 successfullyParsed = true;
 
 </script>
-</body>
 <script src="../resources/js-test-post.js"></script>
 
-<script>
-</script>
-
 </body>
 </html>
 
 
--- a/content/canvas/test/webgl/conformance/gl-min-uniforms.html
+++ b/content/canvas/test/webgl/conformance/gl-min-uniforms.html
@@ -1,17 +1,17 @@
 <!--
-Copyright (c) 2009 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
  -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-  "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <title>WebGL the minimum number of uniforms are supported.</title>
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"> </script>
 <script src="resources/webgl-test-utils.js"> </script>
 </head>
 <body>
 <canvas id="example" width="4" height="4" style="width: 40px; height: 30px;"></canvas>
@@ -29,37 +29,33 @@ void main()
     for (int ii = 0; ii < NUM_UNIFORMS; ++ii) {
       c += uni[ii];
     }
     color = c;
 }
 </script>
 
 <script id="fshader" type="x-shader/x-fragment">
-#ifdef GL_ES
 precision mediump float;
-#endif
 varying vec4 color;
 void main()
 {
     gl_FragColor = color;
 }
 </script>
 <script id="vshader2" type="x-shader/x-vertex">
 attribute vec4 vPosition;
 void main()
 {
     gl_Position = vPosition;
 }
 </script>
 
 <script id="fshader2" type="x-shader/x-fragment">
-#ifdef GL_ES
 precision mediump float;
-#endif
 #define NUM_UNIFORMS 16 // See spec
 uniform vec4 uni[NUM_UNIFORMS];
 void main()
 {
     vec4 c = vec4(0,0,0,0);
     for (int ii = 0; ii < NUM_UNIFORMS; ++ii) {
        c += uni[ii];
     }
@@ -103,18 +99,14 @@ for (var ii = 0; ii < 16; ++ii) {
 glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from setup.");
 wtu.drawQuad(gl);
 glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from setup.");
 wtu.checkCanvasRect(gl, 0, 0, canvas.width, canvas.height, [32, 64, 127, 255], "Should render 32,64,127,255 (+/-1)", 1);
 
 successfullyParsed = true;
 
 </script>
-</body>
 <script src="../resources/js-test-post.js"></script>
 
-<script>
-</script>
-
 </body>
 </html>
 
 
--- a/content/canvas/test/webgl/conformance/gl-object-get-calls.html
+++ b/content/canvas/test/webgl/conformance/gl-object-get-calls.html
@@ -1,10 +1,10 @@
 <!--
-Copyright (C) 2009 Apple Computer, Inc.  All rights reserved.
+Copyright (C) 2011 Apple Computer, Inc.  All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions
 are met:
 1. Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
 2. Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
@@ -17,18 +17,20 @@ PURPOSE ARE DISCLAIMED.  IN NO EVENT SHA
 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 -->
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 </head>
 <body>
 <div id="description"></div>
 <div id="console"></div>
 
@@ -254,19 +256,19 @@ shouldBe('gl.getVertexAttribOffset(1, gl
 gl.disableVertexAttribArray(1);
 shouldBe('gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_ENABLED)', 'false');
 gl.vertexAttrib4f(1, 5, 6, 7, 8);
 shouldBe('gl.getVertexAttrib(1, gl.CURRENT_VERTEX_ATTRIB)', '[5, 6, 7, 8]');
 glErrorShouldBe(gl, gl.NO_ERROR);
 
 // Test cases where name == 0
 gl.deleteTexture(texture);
-shouldBeNull('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)');
+shouldBe('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE)', 'gl.NONE');
 gl.deleteRenderbuffer(renderbuffer);
-shouldBeNull('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)');
+shouldBe('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE)', 'gl.NONE');
 gl.deleteBuffer(buffer);
 shouldBeNull('gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING)');
 glErrorShouldBe(gl, gl.NO_ERROR);
 
 successfullyParsed = true;
 </script>
 
 <script src="../resources/js-test-post.js"></script>
--- a/content/canvas/test/webgl/conformance/gl-pixelstorei.html
+++ b/content/canvas/test/webgl/conformance/gl-pixelstorei.html
@@ -1,17 +1,17 @@
 <!--
-Copyright (c) 2009 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
 -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-  "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <title>WebGL pixelStorei Test</title>
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"> </script>
 <script src="../resources/desktop-gl-constants.js" type="text/javascript"></script>
 </head>
 <body>
 <canvas id="example" width="50" height="50"></canvas>
@@ -114,16 +114,12 @@ function init() {
     assertMsg(gl.getParameter(gl.PACK_ALIGNMENT) == table[ii],
         "PACK_ALIGNMENT is " + table[ii]);
   }
 }
 
 init();
 successfullyParsed = true;
 </script>
-</body>
 <script src="../resources/js-test-post.js"></script>
 
-<script>
-</script>
-
 </body>
 </html>
--- a/content/canvas/test/webgl/conformance/gl-scissor-test.html
+++ b/content/canvas/test/webgl/conformance/gl-scissor-test.html
@@ -1,18 +1,17 @@
 <!--
-Copyright (c) 2009 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
  -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-  "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE html>
 <html>
 <head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<meta charset="utf-8">
 <title>WebGL Scissor Test</title>
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/desktop-gl-constants.js" type="text/javascript"></script>
 <script src="../../debug/webgl-debug.js"></script>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test-utils.js"></script>
 </head>
 <body>
@@ -65,13 +64,10 @@ if (!gl) {
 }
 
 debug("");
 successfullyParsed = true;
 
 </script>
 <script src="../resources/js-test-post.js"></script>
 
-<script>
-</script>
-
 </body>
 </html>
--- a/content/canvas/test/webgl/conformance/gl-shader-test.html
+++ b/content/canvas/test/webgl/conformance/gl-shader-test.html
@@ -1,18 +1,17 @@
 <!--
-Copyright (c) 2009 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
 -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-  "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE html>
 <html>
 <head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<meta charset="utf-8">
 <title>WebGL ShaderL Conformance Tests</title>
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/desktop-gl-constants.js" type="text/javascript"></script>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 </head>
 <body>
 <div id="description"></div>
@@ -40,13 +39,10 @@ if (!gl) {
 }
 
 debug("");
 successfullyParsed = true;
 
 </script>
 <script src="../resources/js-test-post.js"></script>
 
-<script>
-</script>
-
 </body>
 </html>
--- a/content/canvas/test/webgl/conformance/gl-teximage.html
+++ b/content/canvas/test/webgl/conformance/gl-teximage.html
@@ -1,17 +1,17 @@
 <!--
-Copyright (c) 2009 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
   found in the LICENSE file.
  -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-  "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <title>WebGL texImage2D conformance test.</title>
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"> </script>
 <script src="resources/webgl-test-utils.js"> </script>
 </head>
 <body>
 <canvas id="example" width="256" height="16" style="width: 256px; height: 48px;"></canvas>
--- a/content/canvas/test/webgl/conformance/gl-uniform-arrays.html
+++ b/content/canvas/test/webgl/conformance/gl-uniform-arrays.html
@@ -1,18 +1,17 @@
 <!--
-Copyright (c) 2009 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
  -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-  "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE html>
 <html>
 <head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<meta charset="utf-8">
 <title>WebGL uniform array Conformance Tests</title>
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 </head>
 <body>
 <div id="description"></div>
 <div id="console"></div>
@@ -21,19 +20,17 @@ found in the LICENSE file.
     attribute vec4 vPosition;
     void main()
     {
         gl_Position = vPosition;
     }
 </script>
 
 <script id="fshader" type="x-shader/x-fragment">
-    #ifdef GL_ES
     precision mediump float;
-    #endif
     uniform $type color[3];
     void main()
     {
         gl_FragColor = vec4(color[0]$elem, color[1]$elem, color[2]$elem, 1);
     }
 </script>
 <script>
 function loadShader(ctx, shaderType, shaderSource) {
@@ -296,13 +293,10 @@ for (var tt = 0; tt < typeInfos.length; 
                   "can call gl.useProgram(null)");
 }
 debug("");
 successfullyParsed = true;
 
 </script>
 <script src="../resources/js-test-post.js"></script>
 
-<script>
-</script>
-
 </body>
 </html>
--- a/content/canvas/test/webgl/conformance/gl-uniform-bool.html
+++ b/content/canvas/test/webgl/conformance/gl-uniform-bool.html
@@ -1,18 +1,17 @@
 <!--
-Copyright (c) 2009 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
  -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-  "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE html>
 <html>
 <head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<meta charset="utf-8">
 <title>WebGL uniformMatrix Conformance Tests</title>
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/desktop-gl-constants.js" type="text/javascript"></script>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 </head>
 <body>
 <div id="description"></div>
@@ -48,13 +47,10 @@ glErrorShouldBe(gl, gl.NO_ERROR,
                 "should be able to set bool with gl.uniform1f");
 
 debug("");
 successfullyParsed = true;
 
 </script>
 <script src="../resources/js-test-post.js"></script>
 
-<script>
-</script>
-
 </body>
 </html>
--- a/content/canvas/test/webgl/conformance/gl-uniformmatrix4fv.html
+++ b/content/canvas/test/webgl/conformance/gl-uniformmatrix4fv.html
@@ -1,18 +1,17 @@
 <!--
-Copyright (c) 2009 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
  -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-  "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE html>
 <html>
 <head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<meta charset="utf-8">
 <title>WebGL uniformMatrix Conformance Tests</title>
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 </head>
 <body>
 <div id="description"></div>
 <div id="console"></div>
--- a/content/canvas/test/webgl/conformance/gl-unknown-uniform.html
+++ b/content/canvas/test/webgl/conformance/gl-unknown-uniform.html
@@ -1,18 +1,17 @@
 <!--
-Copyright (c) 2009 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
 -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-  "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE html>
 <html>
 <head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<meta charset="utf-8">
 <title>WebGL Unknown Uniform Conformance Test</title>
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/desktop-gl-constants.js" type="text/javascript"></script>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 </head>
 <body>
 <div id="description"></div>
@@ -57,13 +56,10 @@ if (!gl) {
 }
 
 debug("");
 successfullyParsed = true;
 
 </script>
 <script src="../resources/js-test-post.js"></script>
 
-<script>
-</script>
-
 </body>
 </html>
--- a/content/canvas/test/webgl/conformance/gl-vertex-attrib-zero-issues.html
+++ b/content/canvas/test/webgl/conformance/gl-vertex-attrib-zero-issues.html
@@ -1,16 +1,17 @@
 <!--
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 -->
 <!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <title>WebGL Enable Vertex Attrib Zero Test</title>
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"> </script>
 <script src="resources/webgl-test-utils.js"> </script>
 </head>
 <body>
 <canvas id="example" width="50" height="50">
@@ -84,14 +85,11 @@ for (var ii = 0; ii < 5; ++ii) {
 }
 
 wtu.checkCanvas(gl, [0, 0, 0, 0], "canvas should be 0, 0, 0, 0");
 
 successfullyParsed = true;
 </script>
 <script src="../resources/js-test-post.js"></script>
 
-<script>
-</script>
-
 </body>
 </html>
 
--- a/content/canvas/test/webgl/conformance/gl-vertex-attrib.html
+++ b/content/canvas/test/webgl/conformance/gl-vertex-attrib.html
@@ -1,18 +1,17 @@
 <!--
-Copyright (c) 2009 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
  -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-  "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE html>
 <html>
 <head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<meta charset="utf-8">
 <title>WebGL vertexAttrib Conformance Tests</title>
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 </head>
 <body>
 <div id="description"></div>
 <div id="console"></div>
new file mode 100755
--- /dev/null
+++ b/content/canvas/test/webgl/conformance/gl-vertexattribpointer-offsets.html
@@ -0,0 +1,192 @@
+<!--
+Copyright (C) 2011 Apple Computer, Inc.  All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+
+<!DOCTYPE html>
+<html>
+  <head>
+<meta charset="utf-8">
+    <title>Rendering Test</title>
+    <link rel="stylesheet" href="../resources/js-test-style.css"/>
+    <script src="../resources/js-test-pre.js"></script>
+    <script src="resources/webgl-test.js"> </script>
+    <script src="resources/webgl-test-utils.js"> </script>
+</head>
+<body>
+<canvas id="example" width="50" height="50">
+There is supposed to be an example drawing here, but it's not important.
+</canvas>
+<div id="description"></div>
+<div id="console"></div>
+    <script id="vshader" type="x-shader/x-vertex">
+        attribute vec4 vPosition;
+        void main()
+        {
+            gl_Position = vPosition;
+        }
+    </script>
+
+    <script id="fshader" type="x-shader/x-fragment">
+        precision mediump float;
+        uniform vec4 color;
+        void main()
+        {
+            gl_FragColor = color;
+        }
+    </script>
+
+    <script>
+        function fail(x,y, buf, shouldBe)
+        {
+            var i = (y*50+x) * 4;
+            var reason = "pixel at ("+x+","+y+") is ("+buf[i]+","+buf[i+1]+","+buf[i+2]+","+buf[i+3]+"), should be "+shouldBe;
+            testFailed(reason);
+        }
+
+        function pass()
+        {
+            testPassed("drawing is correct");
+        }
+
+        function init()
+        {
+            if (window.initNonKhronosFramework) {
+                window.initNonKhronosFramework(false);
+            }
+
+            wtu = WebGLTestUtils;
+            gl = initWebGL("example", "vshader", "fshader", [ "vPosition"], [ 0, 0, 0, 1 ], 1);
+
+            var tests = [
+              { data: new Float32Array([ 0, 1, 0, 1, 0, 0, 0, 0, 0 ]),
+                type: gl.FLOAT,
+                componentSize: 4,
+                normalize: false,
+              },
+              { data: new Float32Array([ 0, 1, 0, 1, 0, 0, 0, 0, 0 ]),
+                type: gl.FLOAT,
+                componentSize: 4,
+                normalize: false,
+              },
+              { data: new Uint16Array([ 0, 32767, 0, 32767, 0, 0, 0, 0, 0 ]),
+                type: gl.SHORT,
+                componentSize: 2,
+                normalize: true,
+              },
+              { data: new Uint16Array([ 0, 65535, 0, 65535, 0, 0, 0, 0, 0 ]),
+                type: gl.UNSIGNED_SHORT,
+                componentSize: 2,
+                normalize: true,
+              },
+              { data: new Uint16Array([ 0, 1, 0, 1, 0, 0, 0, 0, 0 ]),
+                type: gl.UNSIGNED_SHORT,
+                componentSize: 2,
+                normalize: false,
+              },
+              { data: new Uint16Array([ 0, 1, 0, 1, 0, 0, 0, 0, 0 ]),
+                type: gl.SHORT,
+                componentSize: 2,
+                normalize: false,
+              },
+              { data: new Uint8Array([ 0, 127, 0, 127, 0, 0, 0, 0, 0 ]),
+                type: gl.BYTE,
+                componentSize: 1,
+                normalize: true,
+              },
+              { data: new Uint8Array([ 0, 255, 0, 255, 0, 0, 0, 0, 0 ]),
+                type: gl.UNSIGNED_BYTE,
+                componentSize: 1,
+                normalize: true,
+              },
+              { data: new Uint8Array([ 0, 1, 0, 1, 0, 0, 0, 0, 0 ]),
+                type: gl.BYTE,
+                componentSize: 1,
+                normalize: false,
+              },
+              { data: new Uint8Array([ 0, 1, 0, 1, 0, 0, 0, 0, 0 ]),
+                type: gl.UNSIGNED_BYTE,
+                componentSize: 1,
+                normalize: false,
+              }
+            ];
+
+            var vertexObject = gl.createBuffer();
+            gl.bindBuffer(gl.ARRAY_BUFFER, vertexObject);
+            gl.bufferData(gl.ARRAY_BUFFER, 1024, gl.STATIC_DRAW);
+            gl.enableVertexAttribArray(0);
+
+            var colorLoc = gl.getUniformLocation(gl.program, "color");
+            var kNumVerts = 3;
+            var kNumComponents = 3;
+
+            var count = 0;
+            for (var tt = 0; tt < tests.length; ++tt) {
+              var test = tests[tt];
+              for (var oo = 0; oo < 3; ++oo) {
+                for (var ss = 0; ss < 3; ++ss) {
+                  var offset = (oo + 1) * test.componentSize;
+                  var color = (count % 2) ? [1, 0, 0, 1] : [0, 1, 0, 1];
+                  var stride = test.componentSize * kNumComponents + test.componentSize * ss;
+                  debug("");
+                  debug("check with " + wtu.glEnumToString(gl, test.type) + " at offset: " + offset + " with stride:" + stride + " normalize: " + test.normalize);
+                  gl.uniform4fv(colorLoc, color);
+                  var data = new Uint8Array(test.componentSize * kNumVerts * kNumComponents + stride * (kNumVerts - 1));
+                  var view = new Uint8Array(test.data.buffer);
+                  var size = test.componentSize * kNumComponents;
+                  for (var jj = 0; jj < kNumVerts; ++jj) {
+                    var off1 = jj * size;
+                    var off2 = jj * stride;
+                    for (var zz = 0; zz < size; ++zz) {
+                      data[off2 + zz] = view[off1 + zz];
+                    }
+                  }
+                  gl.bufferSubData(gl.ARRAY_BUFFER, offset, data);
+                  gl.vertexAttribPointer(0, 3, test.type, test.normalize, stride, offset);
+                  gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+                  gl.drawArrays(gl.TRIANGLES, 0, 3);
+
+                  var buf = new Uint8Array(50 * 50 * 4);
+                  gl.readPixels(0, 0, 50, 50, gl.RGBA, gl.UNSIGNED_BYTE, buf);
+
+                  var black = [0, 0, 0, 255];
+                  var other = [color[0] * 255, color[1] * 255, color[2] * 255, color[3] * 255];
+                  var otherMsg = "should be " + ((count % 2) ? "red" : "green")
+                  wtu.checkCanvasRect(gl, 0, 0, 1, 1, black, "should be black", 0);
+                  wtu.checkCanvasRect(gl, 0, 49, 1, 1, black, "should be black", 0);
+                  wtu.checkCanvasRect(gl, 26, 40, 1, 1, other, otherMsg, 0);
+                  wtu.checkCanvasRect(gl, 26, 27, 1, 1, other, otherMsg, 0);
+                  wtu.checkCanvasRect(gl, 40, 27, 1, 1, other, otherMsg, 0);
+                  ++count;
+                }
+              }
+            }
+       }
+
+       init();
+       successfullyParsed = true;
+    </script>
+<script src="../resources/js-test-post.js"></script>
+
+</body>
+</html>
--- a/content/canvas/test/webgl/conformance/gl-vertexattribpointer.html
+++ b/content/canvas/test/webgl/conformance/gl-vertexattribpointer.html
@@ -1,18 +1,17 @@
 <!--
-Copyright (c) 2009 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
  -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-  "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE html>
 <html>
 <head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<meta charset="utf-8">
 <title>WebGL vertexAttribPointer Conformance Tests</title>
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/desktop-gl-constants.js" type="text/javascript"></script>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 <script src="resources/webgl-test-utils.js"></script>
 </head>
 <body>
@@ -125,13 +124,10 @@ if (!gl) {
 }
 
 debug("");
 successfullyParsed = true;
 
 </script>
 <script src="../resources/js-test-post.js"></script>
 
-<script>
-</script>
-
 </body>
 </html>
--- a/content/canvas/test/webgl/conformance/glsl-2types-of-textures-on-same-unit.html
+++ b/content/canvas/test/webgl/conformance/glsl-2types-of-textures-on-same-unit.html
@@ -1,17 +1,17 @@
 <!--
-Copyright (c) 2009 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
  -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-  "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE html>
 <html>
   <head>
+<meta charset="utf-8">
     <title>WebGL GLSL 2 types of textures on same unit conformance test.</title>
     <link rel="stylesheet" href="../resources/js-test-style.css"/>
     <script src="../resources/js-test-pre.js"></script>
     <script src="resources/webgl-test.js"> </script>
     <script src="../../debug/webgl-debug.js"> </script>
 </head>
 <body>
 <canvas id="example" width="2" height="2" style="width: 40px; height: 40px;"></canvas>
@@ -25,19 +25,18 @@ varying vec2 texCoord;
 void main()
 {
   gl_Position = vPosition;
   texCoord = texCoord0;
 }
 </script>
 
 <script id="fshader" type="x-shader/x-fragment">
-#ifdef GL_ES
-precision highp float;
-#endif
+precision mediump float;
+
 uniform sampler2D tex2d;
 uniform samplerCube texCube;
 varying vec2 texCoord;
 void main()
 {
   gl_FragColor =  texture2D(tex2d, texCoord) +
                   textureCube(texCube, vec3(0,1,0));
 }
@@ -126,17 +125,13 @@ function init()
     glErrorShouldBe(gl, gl.INVALID_OPERATION,
               "drawing with 2 different targets on the same texture unit should generate INVALID_VALUE");
   }
 }
 
 init();
 successfullyParsed = true;
 </script>
-</body>
 <script src="../resources/js-test-post.js"></script>
 
-<script>
-</script>
-
 </body>
 </html>
 
--- a/content/canvas/test/webgl/conformance/glsl-conformance.html
+++ b/content/canvas/test/webgl/conformance/glsl-conformance.html
@@ -1,18 +1,17 @@
 <!--
-Copyright (c) 2009 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
 -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-  "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE html>
 <html>
 <head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<meta charset="utf-8">
 <title>WebGL GLSL Conformance Tests</title>
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/desktop-gl-constants.js" type="text/javascript"></script>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test-utils.js"></script>
 </head>
 <body>
 <div id="description"></div>
@@ -29,17 +28,18 @@ precision mediump float;
 void main()
 {
     gl_FragColor = vec4(1.0,0.0,0.0,1.0);
 }
 </script>
 <script id="fshaderWithPrecision" type="text/something-not-javascript">
 void main()
 {
-    gl_FragColor = mediump vec4(1.0,0.0,0.0,1.0);
+    mediump vec4 color = vec4(1.0, 0.0, 0.0, 1.0);
+    gl_FragColor = color;
 }
 </script>
 <script id="vshaderWithDefaultPrecision" type="text/something-not-javascript">
 precision mediump float;
 attribute vec4 vPosition;
 void main()
 {
     gl_Position = vPosition;
@@ -186,17 +186,17 @@ void main()
 {
     gl_Position = _webgl_vPosition;
 }
 </script>
 <script id="vshaderWithImplicitVec3Cast" type="text/something-not-javascript">
 attribute vec4 vPosition;
 void main()
 {
-    highp vec3 k = vec3(1, 2, 3);
+    mediump vec3 k = vec3(1, 2, 3);
     gl_Position = k;
 }
 </script>
 <script id="vshaderWithExplicitIntCast" type="text/something-not-javascript">
 attribute vec4 vPosition;
 void main()
 {
     int k = 123;
@@ -302,16 +302,153 @@ void main()
 </script>
 <script id="fshaderWithNonASCIIErrorDirective" type="text/something-not-javascript">
 #error ͂`rbhhł͂Ȃ // will return INVALID_VALUE. See WebGL 6.18
 void main()
 {
     gl_FragColor = vec4(0,0,0,0);
 }
 </script>
+<script id="fshaderWithFunctionRecursion" type="text/something-not-javascript">
+void a();
+void b();
+void main()
+{
+    a();
+}
+void a()
+{
+    b();
+}
+void b()
+{
+    a();
+}
+</script>
+<script id="fshaderWithIntReturnValue" type="text/something-not-javascript">
+int functionResult();
+
+void main()
+{
+    int r = functionResult();
+    gl_FragColor = vec4(r, r, r, r);
+}
+
+int functionResult()
+{
+    return 1;
+}
+</script>
+<script id="fshaderWithIVec2ReturnValue" type="text/something-not-javascript">
+ivec2 functionResult();
+
+void main()
+{
+    ivec2 r = functionResult();
+    gl_FragColor = vec4(r.x, r.y, r.x, r.y);
+}
+
+ivec2 functionResult()
+{
+    return ivec2(1, 1);
+}
+</script>
+<script id="fshaderWithIVec3ReturnValue" type="text/something-not-javascript">
+ivec3 functionResult();
+
+void main()
+{
+    ivec3 r = functionResult();
+    gl_FragColor = vec4(r.x, r.y, r.z, r.x);
+}
+
+ivec3 functionResult()
+{
+    return ivec3(1, 1, 1);
+}
+</script>
+<script id="fshaderWithIVec4ReturnValue" type="text/something-not-javascript">
+ivec4 functionResult();
+
+void main()
+{
+    ivec4 r = functionResult();
+    gl_FragColor = vec4(r.x, r.y, r.z, r.w);
+}
+
+ivec4 functionResult()
+{
+    return ivec4(1, 1, 1, 1);
+}
+
+</script>
+<script id="fshaderWithFloatReturnValue" type="text/something-not-javascript">
+precision mediump float;
+
+float functionResult();
+
+void main()
+{
+    float r = functionResult();
+    gl_FragColor = vec4(r, r, r, r);
+}
+
+float functionResult()
+{
+    return 1.0;
+}
+</script>
+<script id="fshaderWithVec2ReturnValue" type="text/something-not-javascript">
+precision mediump float;
+
+vec2 functionResult();
+
+void main()
+{
+    vec2 r = functionResult();
+    gl_FragColor = vec4(r.x, r.y, r.x, r.y);
+}
+
+vec2 functionResult()
+{
+    return vec2(1.0, 1.0);
+}
+</script>
+<script id="fshaderWithVec3ReturnValue" type="text/something-not-javascript">
+precision mediump float;
+
+vec3 functionResult();
+
+void main()
+{
+    vec3 r = functionResult();
+    gl_FragColor = vec4(r.x, r.y, r.z, r.x);
+}
+
+vec3 functionResult()
+{
+    return vec3(1.0, 1.0, 1.0);
+}
+</script>
+<script id="fshaderWithVec4ReturnValue" type="text/something-not-javascript">
+precision mediump float;
+
+vec4 functionResult();
+
+void main()
+{
+    vec4 r = functionResult();
+    gl_FragColor = vec4(r.x, r.y, r.z, r.w);
+}
+
+vec4 functionResult()
+{
+    return vec4(1.0, 1.0, 1.0, 1.0);
+}
+</script>
 <canvas id="canvas" width="2" height="2"> </canvas>
 <script>
 description("This test ensures WebGL implementations allow proper GLES2 shaders compile and improper ones fail.");
 
 debug("");
 debug("Canvas.getContext");
 
 var wtu = WebGLTestUtils;
@@ -523,43 +660,44 @@ if (!gl) {
     },
     { vShaderId: 'vshaderWithIncludeDirective',
       vShaderSuccess: false,
       fShaderId: 'fshader',
       fShaderSuccess: true,
       linkSuccess: false,
       passMsg: 'vertex shader uses #include should fail',
     },
-    //{ vShaderId: 'vshader',
-    //  vShaderSuccess: true,
-    //  fShaderId: 'fshaderWith257CharacterIdentifier',
-    //  fShaderSuccess: false,
-    //  linkSuccess: false,
-    //  passMsg: 'shader that uses 257 character identifier should fail',
-    //},
-    //{ vShaderId: 'vshader',
-    //  vShaderSuccess: true,
-    //  fShaderId: 'fshaderWith256CharacterIdentifier',
-    //  fShaderSuccess: true,
-    //  linkSuccess: true,
-    //  passMsg: 'shader that uses 256 character identifier should succeed',
-    //},
+    { vShaderId: 'vshader',
+      vShaderSuccess: true,
+      fShaderId: 'fshaderWith257CharacterIdentifier',
+      fShaderSuccess: false,
+      linkSuccess: false,
+      passMsg: 'shader that uses 257 character identifier should fail',
+    },
+    { vShaderId: 'vshader',
+      vShaderSuccess: true,
+      fShaderId: 'fshaderWith256CharacterIdentifier',
+      fShaderSuccess: true,
+      linkSuccess: true,
+      passMsg: 'shader that uses 256 character identifier should succeed',
+    },
     { vShaderId: 'vshader',
       vShaderSuccess: true,
       fShaderId: 'fshaderWithLongLine',
       fShaderSuccess: true,
       fShaderPrep: function(str) {
         function expand(str, re, replacement, count) {
           for (var ii = 0; ii < count; ++ii) {
             str = str.replace(re, replacement);
           }
           return str;
         }
         str = expand(str, new RegExp(" ", 'g'), "  ", 12);
-        str = expand(str, new RegExp("0", 'g'), "00", 8);
+        var manyZeros = expand("0", new RegExp("0", 'g'), "00", 8).substring(2);
+        str = expand(str, new RegExp("0", 'g'), manyZeros, 1);
         str = expand(str, new RegExp("fooo", 'g'), "fooofooo", 6);
         str = expand(str, new RegExp("long", 'g'), "longlong", 6);
         //debug("len:" + str.length);
         //debug(str);
         return str;
       },
       linkSuccess: true,
       passMsg: 'shader that uses long lines should succeed',
@@ -581,113 +719,203 @@ if (!gl) {
       passMsg: "error directive using quotes fails",
     },
     { vShaderId: 'vshader',
       vShaderSuccess: true,
       fShaderId: 'fshaderWithNonASCIIErrorDirective',
       fShaderSuccess: false,
       linkSuccess: false,
       passMsg: "error directive using characters outside of allowed set fails",
-    }
+    },
+    { vShaderId: 'vshader',
+      vShaderSuccess: true,
+      fShaderId: 'fshaderWithFunctionRecursion',
+      fShaderSuccess: false,
+      linkSuccess: false,
+      passMsg: "Shaders with recursive function calls should fail",
+    },
+    { vShaderId: 'vshader',
+      vShaderSuccess: true,
+      fShaderId: 'fshaderWithIntReturnValue',
+      fShaderSuccess: true,
+      linkSuccess: true,
+      passMsg: "Shader with int return value from function call should succeed",
+    },
+    { vShaderId: 'vshader',
+      vShaderSuccess: true,
+      fShaderId: 'fshaderWithIVec2ReturnValue',
+      fShaderSuccess: true,
+      linkSuccess: true,
+      passMsg: "Shader with ivec2 return value from function call should succeed",
+    },
+    { vShaderId: 'vshader',
+      vShaderSuccess: true,
+      fShaderId: 'fshaderWithIVec3ReturnValue',
+      fShaderSuccess: true,
+      linkSuccess: true,
+      passMsg: "Shader with ivec3 return value from function call should succeed",
+    },
+    { vShaderId: 'vshader',
+      vShaderSuccess: true,
+      fShaderId: 'fshaderWithIVec4ReturnValue',
+      fShaderSuccess: true,
+      linkSuccess: true,
+      passMsg: "Shader with ivec4 return value from function call should succeed",
+    },
+    { vShaderId: 'vshader',
+      vShaderSuccess: true,
+      fShaderId: 'fshaderWithFloatReturnValue',
+      fShaderSuccess: true,
+      linkSuccess: true,
+      passMsg: "Shader with float return value from function call should succeed",
+    },
+    { vShaderId: 'vshader',
+      vShaderSuccess: true,
+      fShaderId: 'fshaderWithVec2ReturnValue',
+      fShaderSuccess: true,
+      linkSuccess: true,
+      passMsg: "Shader with vec2 return value from function call should succeed",
+    },
+    { vShaderId: 'vshader',
+      vShaderSuccess: true,
+      fShaderId: 'fshaderWithVec3ReturnValue',
+      fShaderSuccess: true,
+      linkSuccess: true,
+      passMsg: "Shader with vec3 return value from function call should succeed",
+    },
+    { vShaderId: 'vshader',
+      vShaderSuccess: true,
+      fShaderId: 'fshaderWithVec4ReturnValue',
+      fShaderSuccess: true,
+      linkSuccess: true,
+      passMsg: "Shader with vec4 return value from function call should succeed",
+    },
   ];
 
   // Read in all the shader source.
   for (var ii = 0; ii < shaderInfo.length; ++ii) {
     var si = shaderInfo[ii];
     si.vShaderSource = document.getElementById(si.vShaderId).text;
     si.fShaderSource = document.getElementById(si.fShaderId).text;
   }
 
   // Add more tests from external file
   var simpleVertShader = document.getElementById('vshader').text;
   var simpleFragShader = document.getElementById('fshader').text;
 
   function addExternalShaders(filename, passMsg) {
-    var files = wtu.readFileList(filename);
-    for (var ii = 0; ii < files.length; ++ii) {
-      var file = files[ii];
-      var shaderSource = wtu.readFile(file);
-      var firstLine = shaderSource.split("\n")[0];
-      var success = undefined;
-      if (wtu.endsWith(firstLine, " fail") ||
-          wtu.endsWith(firstLine, " fail.")) {
-        success = false;
-      } else if (wtu.endsWith(firstLine, " succeed") ||
-                 wtu.endsWith(firstLine, " succeed.")) {
-        success = true;
-      }
-      if (success === undefined) {
-        testFailed("bad first line in " + file);
-        continue;
-      }
-      if (!wtu.startsWith(firstLine, "// ")) {
-        testFailed("bad first line in " + file);
-        continue;
+    var lines = wtu.readFileList(filename);
+    for (var ii = 0; ii < lines.length; ++ii) {
+      var info = {
+        vShaderId:      'vshader',
+        vShaderSource:  simpleVertShader,
+        vShaderSuccess: true,
+        fShaderId:      'fshader',
+        fShaderSource:  simpleFragShader,
+        fShaderSuccess: true,
+        linkSuccess:    true,
+      };
+
+      var line = lines[ii];
+      var files = line.split(/ +/);
+      var passMsg = "";
+      for (var jj = 0; jj < files.length; ++jj) {
+        var file = files[jj];
+        var shaderSource = wtu.readFile(file);
+        var firstLine = shaderSource.split("\n")[0];
+        var success = undefined;
+        if (wtu.endsWith(firstLine, " fail") ||
+            wtu.endsWith(firstLine, " fail.")) {
+          success = false;
+        } else if (wtu.endsWith(firstLine, " succeed") ||
+                   wtu.endsWith(firstLine, " succeed.")) {
+          success = true;
+        }
+        if (success === undefined) {
+          testFailed("bad first line in " + file + ":" + firstLine);
+          continue;
+        }
+        if (!wtu.startsWith(firstLine, "// ")) {
+          testFailed("bad first line in " + file + ":" + firstLine);
+          continue;
+        }
+        passMsg = passMsg + (passMsg.length ? ", " : "") + firstLine.substr(3);
+        if (wtu.endsWith(file, ".vert")) {
+          info.vShaderId = file;
+          info.vShaderSource = shaderSource;
+          info.vShaderSuccess = success;
+        } else if (wtu.endsWith(file, ".frag")) {
+          info.fShaderId = file;
+          info.fShaderSource = shaderSource;
+          info.fShaderSuccess = success;
+        }
       }
-      var passMsg = firstLine.substr(3);
-      if (wtu.endsWith(file, ".vert")) {
-        shaderInfo.push({
-            vShaderId: file,
-            vShaderSource: shaderSource,
-            vShaderSuccess: success,
-            fShaderId: 'fshader',
-            fShaderSource: simpleFragShader,
-            fShaderSuccess: true,
-            linkSuccess: success,
-            passMsg: passMsg,
-          });
-      } else if (wtu.endsWith(file, ".frag")) {
-        shaderInfo.push({
-            vShaderId: 'vshader',
-            vShaderSource: simpleVertShader,
-            vShaderSuccess: true,
-            fShaderId: file,
-            fShaderSource: shaderSource,
-            fShaderSuccess: success,
-            linkSuccess: success,
-            passMsg: passMsg,
-          });
-      }
+      info.linkSuccess = info.vShaderSuccess && info.fShaderSuccess;
+      info.passMsg = passMsg;
+      shaderInfo.push(info);
     }
   }
 
   addExternalShaders('shaders/00_shaders.txt');
 
+  var vShaderDB = { };
+  var fShaderDB = { };
+
   for (var ii = 0; ii < shaderInfo.length; ++ii) {
     var info = shaderInfo[ii];
     var passMsg = '[' + info.vShaderId + '/' + info.fShaderId + ']: ' +
                   info.passMsg
     log(passMsg);
+
     //debug(info.fShaderId);
     var vSource = info.vShaderPrep ? info.vShaderPrep(info.vShaderSource) :
       info.vShaderSource;
-    var vShader = wtu.loadShader(gl, vSource, gl.VERTEX_SHADER);
-    if (info.vShaderTest) {
-      if (!info.vShaderTest(vShader)) {
+
+    // Reuse identical shaders so we test shared shader.
+    var vShader = vShaderDB[vSource];
+    if (!vShader) {
+      vShader = wtu.loadShader(gl, vSource, gl.VERTEX_SHADER);
+      if (info.vShaderTest) {
+        if (!info.vShaderTest(vShader)) {
+          testFailed(passMsg);
+          continue;
+        }
+      }
+      if ((vShader != null) != info.vShaderSuccess) {
         testFailed(passMsg);
         continue;
       }
+      // Save the shaders so we test shared shader.
+      if (vShader) {
+        vShaderDB[vSource] = vShader;
+      }
     }
-    if ((vShader != null) != info.vShaderSuccess) {
-      testFailed(passMsg);
-      continue;
-    }
+
     var fSource = info.fShaderPrep ? info.fShaderPrep(info.fShaderSource) :
       info.fShaderSource;
-    var fShader = wtu.loadShader(gl, fSource, gl.FRAGMENT_SHADER);
-    if (info.fShaderTest) {
-      if (!info.fShaderTest(fShader)) {
+
+    // Reuse identical shaders so we test shared shader.
+    var fShader = fShaderDB[fSource];
+    if (!fShader) {
+      fShader = wtu.loadShader(gl, fSource, gl.FRAGMENT_SHADER);
+      if (info.fShaderTest) {
+        if (!info.fShaderTest(fShader)) {
+          testFailed(passMsg);
+          continue;
+        }
+      }
+      //debug(fShader == null ? "fail" : "succeed");
+      if ((fShader != null) != info.fShaderSuccess) {
         testFailed(passMsg);
         continue;
       }
-    }
-    //debug(fShader == null ? "fail" : "succeed");
-    if ((fShader != null) != info.fShaderSuccess) {
-      testFailed(passMsg);
-      continue;
+      // Safe the shaders so we test shared shader.
+      if (fShader) {
+        fShaderDB[fSource] = fShader;
+      }
     }
 
     if (vShader && fShader) {
       var program = gl.createProgram();
       gl.attachShader(program, vShader);
       gl.attachShader(program, fShader);
       gl.linkProgram(program);
       var linked = (gl.getProgramParameter(program, gl.LINK_STATUS) != 0);
@@ -710,13 +938,10 @@ if (!gl) {
 }
 
 debug("");
 successfullyParsed = true;
 
 </script>
 <script src="../resources/js-test-post.js"></script>
 
-<script>
-</script>
-
 </body>
 </html>
new file mode 100755
--- /dev/null
+++ b/content/canvas/test/webgl/conformance/glsl-features.html
@@ -0,0 +1,234 @@
+<!--
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
+Use of this source code is governed by a BSD-style license that can be
+found in the LICENSE file.
+
+Note: To use this sample pass arguments through the URL.
+
+Arguments:
+  feature:  name of the feature being testing
+
+  res:      number of subdivisions in quad. default: 2
+
+  refvs:    relative url to reference vertex shader
+            default shaders/glsl-features/base.vert
+
+  reffs:    relative url to reference fragment shader
+            default shaders/glsl-features/base.frag
+
+  testvs:   relative url to test vertex shader
+            default shaders/glsl-features/base.vert
+
+  testfs:   relative url to test fragment shader
+            default shaders/glsl-features/base.frag
+
+Example:
+glsl-feature.html?feature=abs&refvs=shader/abs-ref.vert&testvs=shader/abs-test.vert
+
+The idea is to provide 2 shaders that should generate the same image. One shader
+uses the actual feature you want to test. Another emluates that feature to
+provide a reference image.
+
+For example, a test of abs would use "abs" in the test and "v < 0 ? -v : v" in
+the reference.
+
+Both shaders are passed a unit square that covers the entire canvas and 
+texcoords that go from 0.0 to 1.0 over the canvas. A vColor value is also passed
+from the vertex shader to the fragment shader to give the vertex shader
+a chance to generate something.
+ -->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+  <title>GLSL feature Test</title>
+  <link rel="stylesheet" href="../resources/js-test-style.css"/>
+  <script src="../resources/js-test-pre.js"></script>
+  <script src="resources/webgl-test.js"> </script>
+  <script src="resources/webgl-test-utils.js"> </script>
+  <style>
+canvas {
+  background-color: white;
+  background-image: linear-gradient(0, rgba(200, 200, 200, .5) 50%, transparent 50%), linear-gradient(rgba(200, 200, 200, .5) 50%, transparent 50%);
+  background-size: 8px 8px;
+}
+  </style>
+</head>
+<body>
+<table>
+<tr><td>ref</td><td>test</td><td>diff</td></tr>
+<tr>
+<td><canvas id="canvas1" width="32" height="32"></canvas></td>
+<td><canvas id="canvas2" width="32" height="32"></canvas></td>
+<td><canvas id="diff" width="32" height="32"></canvas></td>
+</tr>
+</table>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+function init()
+{
+  if (window.initNonKhronosFramework) {
+    window.initNonKhronosFramework(false);
+  }
+
+  wtu = WebGLTestUtils;
+  var args = wtu.getUrlArguments();
+  var feature = args.feature || "**unset**";
+  var refVS = args.refvs || "shaders/glsl-features/base.vert";
+  var refFS = args.reffs || "shaders/glsl-features/base.frag";
+  var testVS = args.testvs || "shaders/glsl-features/base.vert";
+  var testFS = args.testfs || "shaders/glsl-features/base.frag";
+  var gridRes = args.res ? parseInt(args.res) : 2;
+
+  description("Testing GLSL feature: " + feature);
+  debug("");
+  debug("using reference shaders:");
+  debug("  " + makeLink(refVS));
+  debug("  " + makeLink(refFS));
+  debug("");
+  debug("using test shaders:");
+  debug("  " + makeLink(testVS));
+  debug("  " + makeLink(testFS));
+  debug("");
+
+  function makeLink(url) {
+    return '<a target="_blank" href="' + url + '">' + url + '</a>';
+  }
+
+  var canvas1 = document.getElementById("canvas1");
+  var canvas2 = document.getElementById("canvas2");
+  var diff = document.getElementById("diff");
+
+  var width = canvas1.width;
+  var height = canvas1.height;
+
+  function draw(canvas, vsURL, fsURL) {
+    var gl = wtu.create3DContext(canvas);
+    if (!gl) {
+      testFailed("context does not exist");
+      return;
+    }
+
+    var program = wtu.loadProgramFromFile(gl, vsURL, fsURL);
+
+    var posLoc = gl.getAttribLocation(program, "aPosition");
+    var refLoc = gl.getAttribLocation(program, "aTexcoord");
+    setupQuad(gl, posLoc, refLoc);
+
+    gl.useProgram(program);
+    gl.clearColor(0, 0, 1, 1);
+    gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+    gl.drawElements(gl.TRIANGLES, gridRes * gridRes * 6, gl.UNSIGNED_SHORT, 0);
+    wtu.glErrorShouldBe(gl, gl.NO_ERROR, "no errors from draw");
+
+    var img = new Uint8Array(width * height * 4);
+    gl.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, img);
+    return img;
+  }
+
+  function setupQuad(gl, positionLocation, texcoordLocation) {
+    var objects = [];
+
+    var vertsAcross = gridRes + 1;
+    var numVerts = vertsAcross * vertsAcross;
+    var positions = new Float32Array(numVerts * 3);
+    var texcoords = new Float32Array(numVerts * 2);
+    var indices = new Uint16Array(6 * gridRes * gridRes);
+
+    var poffset = 0;
+    var toffset = 0;
+
+    for (var yy = 0; yy <= gridRes; ++yy) {
+      for (var xx = 0; xx <= gridRes; ++xx) {
+        positions[poffset + 0] = -1 + 2 * xx / gridRes;
+        positions[poffset + 1] = -1 + 2 * yy / gridRes;
+        positions[poffset + 2] = 0;
+
+        texcoords[toffset + 0] = xx / gridRes;
+        texcoords[toffset + 1] = yy / gridRes;
+
+        poffset += 3;
+        toffset += 2;
+      }
+    }
+
+    var tbase = 0;
+    for (var yy = 0; yy < gridRes; ++yy) {
+      var index = yy * vertsAcross;
+      for (var xx = 0; xx < gridRes; ++xx) {
+        indices[tbase + 0] = index + 0;
+        indices[tbase + 1] = index + 1;
+        indices[tbase + 2] = index + vertsAcross;
+        indices[tbase + 3] = index + vertsAcross;
+        indices[tbase + 4] = index + 1;
+        indices[tbase + 5] = index + vertsAcross + 1;
+
+        index += 1;
+        tbase += 6;
+      }
+    }
+
+    var buf = gl.createBuffer();
+    gl.bindBuffer(gl.ARRAY_BUFFER, buf);
+    gl.bufferData(gl.ARRAY_BUFFER, positions, gl.STATIC_DRAW);
+    gl.enableVertexAttribArray(positionLocation);
+    gl.vertexAttribPointer(positionLocation, 3, gl.FLOAT, false, 0, 0);
+    objects.push(buf);
+  
+    var buf = gl.createBuffer();
+    gl.bindBuffer(gl.ARRAY_BUFFER, buf);
+    gl.bufferData(gl.ARRAY_BUFFER, texcoords, gl.STATIC_DRAW);
+    gl.enableVertexAttribArray(texcoordLocation);
+    gl.vertexAttribPointer(texcoordLocation, 2, gl.FLOAT, false, 0, 0);
+    objects.push(buf);
+
+    var buf = gl.createBuffer();
+    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, buf);
+    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, indices, gl.STATIC_DRAW);
+    objects.push(buf);
+
+    return objects;
+  }
+
+  var refImage = draw(canvas1, refVS, refFS);
+  var testImage = draw(canvas2, testVS, testFS);
+
+  var ctx = diff.getContext("2d");
+  var imgData = ctx.getImageData(0, 0, width, height);
+
+  var same = true;
+  for (var yy = 0; yy < height; ++yy) {
+    for (var xx = 0; xx < width; ++xx) {
+      var offset = (yy * width + xx) * 4;
+      var imgOffset = ((height - yy - 1) * width + xx) * 4;
+      imgData.data[imgOffset + 0] = 0;
+      imgData.data[imgOffset + 1] = 0;
+      imgData.data[imgOffset + 2] = 0;
+      imgData.data[imgOffset + 3] = 255;
+      if (refImage[offset + 0] != testImage[offset + 0] ||
+          refImage[offset + 1] != testImage[offset + 1] ||
+          refImage[offset + 2] != testImage[offset + 2] ||
+          refImage[offset + 3] != testImage[offset + 3]) {
+        imgData.data[imgOffset] = 255;
+        same = false;
+      }
+    }
+  }
+
+  if (!same) {
+    ctx.putImageData(imgData, 0, 0);
+    testFailed("images are different");
+  } else {
+    testPassed("images are the same");
+  }
+}
+
+init();
+successfullyParsed = true;
+</script>
+<script src="../resources/js-test-post.js"></script>
+
+</body>
+</html>
+
new file mode 100644
--- /dev/null
+++ b/content/canvas/test/webgl/conformance/glsl-long-variable-names.html
@@ -0,0 +1,130 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <meta charset="utf-8">
+    <title>glsl long variable name mapping tests</title>
+    <link rel="stylesheet" href="../resources/js-test-style.css"/>
+    <script src="../resources/js-test-pre.js"></script>
+    <script src="resources/webgl-test.js"> </script>
+</head>
+<body>
+    <canvas id="example" width="50" height="50">
+    There is supposed to be an example drawing here, but it's not important.
+    </canvas>
+    <div id="description">Verify that shader long variable names works fine if they are within 256 characters.</div>
+    <div id="console"></div>
+    <script id="vshader" type="x-shader/x-vertex">
+        attribute vec4 vPosition0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456;
+        varying float alpha01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890;
+        void main()
+        {
+            alpha01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 = 1.0;
+            gl_Position = vPosition0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456;
+        }
+    </script>
+
+    <script id="fshader" type="x-shader/x-fragment">
+        precision mediump float;
+        varying float alpha01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890;
+        uniform float color01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567[3];
+        void main()
+        {
+            for (int i012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234 = 0; i012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234 < 1; ++i012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234)
+            {
+                gl_FragColor = vec4(color01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567[0], color01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567[1], color01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567[2], alpha01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890);
+            }
+        }
+    </script>
+
+    <script>
+        function fail(x,y, buf, shouldBe)
+        {
+            var i = (y*50+x) * 4;
+            var reason = "pixel at ("+x+","+y+") is ("+buf[i]+","+buf[i+1]+","+buf[i+2]+","+buf[i+3]+"), should be "+shouldBe;
+            testFailed(reason);
+        }
+
+        function pass()
+        {
+            testPassed("drawing is correct");
+        }
+
+        if (window.initNonKhronosFramework) {
+            window.initNonKhronosFramework(false);
+        }
+
+        gl = initWebGL("example", "vshader", "fshader", [ "vPosition0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456"], [ 0, 0, 0, 1 ], 1);
+
+        var prog = gl.getParameter(gl.CURRENT_PROGRAM);
+        shouldBeNonNull(prog);
+        var redLoc = gl.getUniformLocation(prog, "color01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567[0]");
+        shouldBeNonNull(redLoc);
+        var greenLoc = gl.getUniformLocation(prog, "color01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567[1]");
+        shouldBeNonNull(greenLoc);
+        var blueLoc = gl.getUniformLocation(prog, "color01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567[2]");
+        shouldBeNonNull(blueLoc);
+
+        shouldBe("gl.getProgramParameter(prog, gl.ACTIVE_ATTRIBUTES)", "1");
+        var activeAttrib = gl.getActiveAttrib(prog, 0);
+        shouldBeNonNull(activeAttrib);
+        shouldBe("activeAttrib.size", "1");
+        shouldBe("activeAttrib.type", "gl.FLOAT_VEC4");
+        shouldBe("activeAttrib.name", "'vPosition0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456'");
+
+        shouldBe("gl.getProgramParameter(prog, gl.ACTIVE_UNIFORMS)", "1");
+        var activeUniform = gl.getActiveUniform(prog, 0);
+        shouldBeNonNull(activeUniform);
+        shouldBe("activeUniform.size", "3");
+        shouldBe("activeUniform.type", "gl.FLOAT");
+        shouldBe("activeUniform.name", "'color01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567[0]'");
+
+        gl.uniform1f(redLoc, 1.0); 
+        gl.uniform1f(greenLoc, 0.0);
+        gl.uniform1f(blueLoc, 1.0);
+
+        var vertexObject = gl.createBuffer();
+        gl.bindBuffer(gl.ARRAY_BUFFER, vertexObject);
+        gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([ 0,0.5,0, -0.5,-0.5,0, 0.5,-0.5,0 ]), gl.STATIC_DRAW);
+        gl.enableVertexAttribArray(0);
+        gl.vertexAttribPointer(0, 3, gl.FLOAT, false, 0, 0);
+
+        gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+        gl.drawArrays(gl.TRIANGLES, 0, 3);
+
+        var buf = new Uint8Array(50 * 50 * 4);
+        gl.readPixels(0, 0, 50, 50, gl.RGBA, gl.UNSIGNED_BYTE, buf);
+        shouldBe("gl.getError()", "gl.NO_ERROR");
+
+        function checkPixels()
+        {
+            // Test several locations
+            // First line should be all black
+            for (var i = 0; i < 50; ++i)
+                if (buf[i*4] != 0 || buf[i*4+1] != 0 || buf[i*4+2] != 0 || buf[i*4+3] != 255) {
+                    fail(i, 0, buf, "(0,0,0,255)");
+                    return;
+                }
+
+            // Line 15 should be red for at least 10 red pixels starting 20 pixels in
+            var offset = (15*50+20) * 4;
+            for (var i = 0; i < 10; ++i)
+                if (buf[offset+i*4] != 255 || buf[offset+i*4+1] != 0 || buf[offset+i*4+2] != 255 || buf[offset+i*4+3] != 255) {
+                    fail(20 + i, 15, buf, "(255,0,255,255)");
+                    return;
+                }
+            // Last line should be all black
+            offset = (49*50) * 4;
+            for (var i = 0; i < 50; ++i)
+                if (buf[offset+i*4] != 0 || buf[offset+i*4+1] != 0 || buf[offset+i*4+2] != 0 || buf[offset+i*4+3] != 255) {
+                    fail(i, 49, buf, "(0,0,0,255)");
+                    return;
+                }
+
+            pass();
+        }
+        checkPixels();
+        successfullyParsed = true;
+    </script>
+    <script src="../resources/js-test-post.js"></script>
+</body>
+</html>
--- a/content/canvas/test/webgl/conformance/incorrect-context-object-behaviour.html
+++ b/content/canvas/test/webgl/conformance/incorrect-context-object-behaviour.html
@@ -1,10 +1,10 @@
 <!--
-Copyright (C) 2009 Apple Computer, Inc.  All rights reserved.
+Copyright (C) 2011 Apple Computer, Inc.  All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions
 are met:
 1. Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
 2. Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
@@ -17,18 +17,20 @@ PURPOSE ARE DISCLAIMED.  IN NO EVENT SHA
 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 -->
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 </head>
 <body>
 <div id="description"></div>
 <div id="console"></div>
 
--- a/content/canvas/test/webgl/conformance/index-validation-copies-indices.html
+++ b/content/canvas/test/webgl/conformance/index-validation-copies-indices.html
@@ -1,10 +1,10 @@
 <!--
-Copyright (c) 2009 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions are
 met:
 
    * Redistributions of source code must retain the above copyright
 notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above
@@ -22,18 +22,20 @@ A PARTICULAR PURPOSE ARE DISCLAIMED. IN 
 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 -->
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 </head>
 <body>
 <div id="description"></div>
 <div id="console"></div>
 
--- a/content/canvas/test/webgl/conformance/index-validation-crash-with-buffer-sub-data.html
+++ b/content/canvas/test/webgl/conformance/index-validation-crash-with-buffer-sub-data.html
@@ -1,15 +1,17 @@
 <!--
-Copyright (c) 2010 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
  -->
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 </head>
 <body>
 <div id="description"></div>
 <div id="console"></div>
 
--- a/content/canvas/test/webgl/conformance/index-validation-verifies-too-many-indices.html
+++ b/content/canvas/test/webgl/conformance/index-validation-verifies-too-many-indices.html
@@ -1,15 +1,17 @@
 <!--
-Copyright (c) 2010 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
  -->
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 </head>
 <body>
 <div id="description"></div>
 <div id="console"></div>
 
--- a/content/canvas/test/webgl/conformance/index-validation-with-resized-buffer.html
+++ b/content/canvas/test/webgl/conformance/index-validation-with-resized-buffer.html
@@ -1,15 +1,17 @@
 <!--
-Copyright (c) 2010 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
  -->
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 </head>
 <body>
 <canvas id="example" width="1px" height="1px"></canvas>
 <div id="description"></div>
 <div id="console"></div>
@@ -19,19 +21,17 @@ attribute vec4 vPosition;
 attribute vec4 vColor;
 varying vec4 color;
 void main() {
     gl_Position = vPosition;
     color = vColor;
 }
 </script>
 <script id="fs" type="x-shader/x-fragment">
-#if defined(GL_ES)
 precision mediump float;
-#endif
 varying vec4 color;
 void main() {
   gl_FragColor = color;
 }
 </script>
 <script>
 description('Test that updating the size of a vertex buffer is properly noticed by the WebGL implementation.')
 
--- a/content/canvas/test/webgl/conformance/index-validation.html
+++ b/content/canvas/test/webgl/conformance/index-validation.html
@@ -1,10 +1,10 @@
 <!--
-Copyright (c) 2009 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions are
 met:
 
    * Redistributions of source code must retain the above copyright
 notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above
@@ -22,18 +22,20 @@ A PARTICULAR PURPOSE ARE DISCLAIMED. IN 
 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 -->
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 </head>
 <body>
 <div id="description"></div>
 <div id="console"></div>
 
--- a/content/canvas/test/webgl/conformance/instanceof-test.html
+++ b/content/canvas/test/webgl/conformance/instanceof-test.html
@@ -1,17 +1,17 @@
 <!--
-Copyright (c) 2009 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
  -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-  "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <title>WebGL instanceof test.</title>
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"> </script>
 <script src="resources/webgl-test-utils.js"> </script>
 </head>
 <body>
 <canvas id="canvas" width="2" height="2" style="width: 40px; height: 40px;"></canvas>
@@ -22,19 +22,17 @@ attribute vec4 vPosition;
 varying vec2 texCoord;
 void main()
 {
     gl_Position = vPosition;
 }
 </script>
 
 <script id="fshader" type="x-shader/x-fragment">
-#ifdef GL_ES
 precision mediump float;
-#endif
 uniform vec4 color;
 void main()
 {
     gl_FragColor = color;
 }
 </script>
 <script>
 var wtu = WebGLTestUtils;
@@ -80,18 +78,14 @@ shouldThrowWithNew(WebGLFramebuffer, 'We
 shouldThrowWithNew(WebGLProgram, 'WebGLProgram');
 shouldThrowWithNew(WebGLRenderbuffer, 'WebGLRenderbuffer');
 shouldThrowWithNew(WebGLShader, 'WebGLShader');
 shouldThrowWithNew(WebGLTexture, 'WebGLTexture');
 shouldThrowWithNew(WebGLUniformLocation, 'WebGLUniformLocation');
 
 successfullyParsed = true;
 </script>
-</body>
 <script src="../resources/js-test-post.js"></script>
 
-<script>
-</script>
-
 </body>
 </html>
 
 
--- a/content/canvas/test/webgl/conformance/invalid-UTF-16.html
+++ b/content/canvas/test/webgl/conformance/invalid-UTF-16.html
@@ -1,15 +1,17 @@
 <!--
-Copyright (c) 2010 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
  -->
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <link rel="stylesheet" href="../resources/js-test-style.css">
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 </head>
 <body>
 <p id="description"></p>
 <div id="console"></div>
 <script>
--- a/content/canvas/test/webgl/conformance/invalid-passed-params.html
+++ b/content/canvas/test/webgl/conformance/invalid-passed-params.html
@@ -1,10 +1,10 @@
 <!--
-Copyright (C) 2009 Apple Computer, Inc.  All rights reserved.
+Copyright (C) 2011 Apple Computer, Inc.  All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions
 are met:
 1. Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
 2. Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
@@ -17,18 +17,20 @@ PURPOSE ARE DISCLAIMED.  IN NO EVENT SHA
 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 -->
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 <script src="../resources/desktop-gl-constants.js"></script>
 </head>
 <body>
 <div id="description"></div>
 <div id="console"></div>
@@ -120,17 +122,17 @@ function generateShaderSource(opt_invali
                           + "gl_Position = vec4(0.0, 0.0, 0.0, 1.0); }\n";
                           + "//.+-/*%<>[](){}^|&~=!:;,?# " + invalidCommentString;
 }
 var vShader = context.createShader(context.VERTEX_SHADER);
 context.shaderSource(vShader, generateShaderSource());
 context.compileShader(vShader);
 shouldBe("context.getError()", "context.NO_ERROR");
 var fShader = context.createShader(context.FRAGMENT_SHADER);
-context.shaderSource(fShader, "precision highp float;\n"
+context.shaderSource(fShader, "precision mediump float;\n"
                               + "varying float " + validAttribName + ";\n"
                               + "void main() {\n"
                               + "gl_FragColor = vec4(" + validAttribName + ", 0.0, 0.0, 1.0); }");
 context.compileShader(fShader);
 shouldBe("context.getError()", "context.NO_ERROR");
 var program = context.createProgram();
 context.attachShader(program, vShader);
 context.attachShader(program, fShader);
--- a/content/canvas/test/webgl/conformance/is-object.html
+++ b/content/canvas/test/webgl/conformance/is-object.html
@@ -1,10 +1,12 @@
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 <script src="resources/webgl-test-utils.js"></script>
 </head>
 <body>
 <div id="description"></div>
 <div id="console"></div>
--- a/content/canvas/test/webgl/conformance/methods.html
+++ b/content/canvas/test/webgl/conformance/methods.html
@@ -1,16 +1,17 @@
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <!--
-Copyright (c) 2009 Ilmari Heikkinen. All rights reserved.
+Copyright (c) 2011 Ilmari Heikkinen. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
 -->
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
 <title>WebGL Methods Test</title>
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/desktop-gl-constants.js" type="text/javascript"></script>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 </head>
 <body>
 <div id="description"></div>
@@ -189,13 +190,11 @@ for (var i in gl) {
     debug(i);
   }
 }
 
 debug("");
 successfullyParsed = true;
 </script>
 <script src="../resources/js-test-post.js"></script>
-<script>
-</script>
 
 </body>
 </html>
--- a/content/canvas/test/webgl/conformance/more-than-65536-points.html
+++ b/content/canvas/test/webgl/conformance/more-than-65536-points.html
@@ -1,17 +1,17 @@
 <!--
-Copyright (c) 2009 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
  -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-  "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <title>WebGL More than 65536 points.</title>
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"> </script>
 <script src="resources/webgl-test-utils.js"> </script>
 </head>
 <body>
 <canvas id="example" width="40" height="40" style="width: 40px; height: 40px;"></canvas>
@@ -22,19 +22,17 @@ attribute vec4 vPosition;
 attribute vec4 vColor;
 varying vec4 color;
 void main() {
     gl_Position = vPosition;
     color = vColor;
 }
 </script>
 <script id="fs" type="text/something-not-javascript">
-#if defined(GL_ES)
 precision mediump float;
-#endif
 varying vec4 color;
 void main() {
     gl_FragColor = color;
 }
 </script>
 <script>
 var wtu = WebGLTestUtils;
 var gl = initWebGL("example", "vs", "fs", ["vPosition", "vColor"], [0, 0, 0, 1], 1);
--- a/content/canvas/test/webgl/conformance/more/00_test_list.txt
+++ b/content/canvas/test/webgl/conformance/more/00_test_list.txt
@@ -1,11 +1,14 @@
 conformance/constants.html
 conformance/getContext.html
 conformance/methods.html
+#this test causes whichever comes after to intermittently time out.
+#forcing a GC run doesn't solve this issue. Could be something about using a random amount of memory that
+#can be too high, causing e.g. swapping.
 #conformance/quickCheckAPI.html
 conformance/webGLArrays.html
 functions/bindBuffer.html
 functions/bindBufferBadArgs.html
 functions/bindFramebufferLeaveNonZero.html
 functions/bufferData.html
 functions/bufferDataBadArgs.html
 functions/bufferSubData.html
--- a/content/canvas/test/webgl/conformance/more/all_tests.html
+++ b/content/canvas/test/webgl/conformance/more/all_tests.html
@@ -1,14 +1,15 @@
 <html>
 <head>
+<meta charset="utf-8">
 <!--
 Tests for the OpenGL ES 2.0 HTML Canvas context
 
-Copyright (C) 2009  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
+Copyright (C) 2011  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
 
 Permission is hereby granted, free of charge, to any person
 obtaining a copy of this software and associated documentation
 files (the "Software"), to deal in the Software without
 restriction, including without limitation the rights to use,
 copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the
 Software is furnished to do so, subject to the following
--- a/content/canvas/test/webgl/conformance/more/all_tests_linkonly.html
+++ b/content/canvas/test/webgl/conformance/more/all_tests_linkonly.html
@@ -1,14 +1,15 @@
 <html>
 <head>
+<meta charset="utf-8">
 <!--
 Tests for the OpenGL ES 2.0 HTML Canvas context
 
-Copyright (C) 2009  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
+Copyright (C) 2011  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
 
 Permission is hereby granted, free of charge, to any person
 obtaining a copy of this software and associated documentation
 files (the "Software"), to deal in the Software without
 restriction, including without limitation the rights to use,
 copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the
 Software is furnished to do so, subject to the following
--- a/content/canvas/test/webgl/conformance/more/all_tests_sequential.html
+++ b/content/canvas/test/webgl/conformance/more/all_tests_sequential.html
@@ -1,14 +1,15 @@
 <html>
 <head>
+<meta charset="utf-8">
 <!--
 Tests for the OpenGL ES 2.0 HTML Canvas context
 
-Copyright (C) 2009  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
+Copyright (C) 2011  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
 
 Permission is hereby granted, free of charge, to any person
 obtaining a copy of this software and associated documentation
 files (the "Software"), to deal in the Software without
 restriction, including without limitation the rights to use,
 copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the
 Software is furnished to do so, subject to the following
--- a/content/canvas/test/webgl/conformance/more/conformance/badArgsArityLessThanArgc.html
+++ b/content/canvas/test/webgl/conformance/more/conformance/badArgsArityLessThanArgc.html
@@ -1,14 +1,15 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
 <html><head>
+<meta charset="utf-8">
 <!--
 Tests for the OpenGL ES 2.0 HTML Canvas context
 
-Copyright (C) 2009  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
+Copyright (C) 2011  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
 
 Permission is hereby granted, free of charge, to any person
 obtaining a copy of this software and associated documentation
 files (the "Software"), to deal in the Software without
 restriction, including without limitation the rights to use,
 copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the
 Software is furnished to do so, subject to the following
@@ -23,17 +24,16 @@ OF MERCHANTABILITY, FITNESS FOR A PARTIC
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 OTHER DEALINGS IN THE SOFTWARE.
 
 
 -->
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 <script type="application/x-javascript" src="../util.js"></script>
 <script type="application/x-javascript">
 
 /*
   The following tests are generated from
   http://www.khronos.org/registry/gles/api/2.0/gl2.h
--- a/content/canvas/test/webgl/conformance/more/conformance/constants.html
+++ b/content/canvas/test/webgl/conformance/more/conformance/constants.html
@@ -1,14 +1,15 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
 <html><head>
+<meta charset="utf-8">
 <!--
 Tests for the OpenGL ES 2.0 HTML Canvas context
 
-Copyright (C) 2009  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
+Copyright (C) 2011  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
 
 Permission is hereby granted, free of charge, to any person
 obtaining a copy of this software and associated documentation
 files (the "Software"), to deal in the Software without
 restriction, including without limitation the rights to use,
 copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the
 Software is furnished to do so, subject to the following
@@ -23,17 +24,16 @@ OF MERCHANTABILITY, FITNESS FOR A PARTIC
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 OTHER DEALINGS IN THE SOFTWARE.
 
 
 -->
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 <script type="application/x-javascript" src="../util.js"></script>
 <script type="application/x-javascript">
 
 /*
   The following tests are generated from
   http://www.khronos.org/registry/gles/api/2.0/gl2.h
--- a/content/canvas/test/webgl/conformance/more/conformance/fuzzTheAPI.html
+++ b/content/canvas/test/webgl/conformance/more/conformance/fuzzTheAPI.html
@@ -1,11 +1,11 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
 <html><head>
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<meta charset="utf-8">
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 <script type="application/x-javascript" src="../util.js"></script>
 
 <script type="application/x-javascript">
 
 Tests.autorun = false;
 Tests.message = "This will fuzz the API with random inputs for a [long] while."
--- a/content/canvas/test/webgl/conformance/more/conformance/getContext.html
+++ b/content/canvas/test/webgl/conformance/more/conformance/getContext.html
@@ -1,11 +1,11 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
 <html><head>
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<meta charset="utf-8">
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 <script type="application/x-javascript" src="../util.js"></script>
 
 <script type="application/x-javascript">
 
 Tests.testGetWebGL = function() {
   var canvas = document.getElementById('webgl');
--- a/content/canvas/test/webgl/conformance/more/conformance/methods.html
+++ b/content/canvas/test/webgl/conformance/more/conformance/methods.html
@@ -1,14 +1,15 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
 <html><head>
+<meta charset="utf-8">
 <!--
 Tests for the OpenGL ES 2.0 HTML Canvas context
 
-Copyright (C) 2009  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
+Copyright (C) 2011  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
 
 Permission is hereby granted, free of charge, to any person
 obtaining a copy of this software and associated documentation
 files (the "Software"), to deal in the Software without
 restriction, including without limitation the rights to use,
 copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the
 Software is furnished to do so, subject to the following
@@ -23,17 +24,16 @@ OF MERCHANTABILITY, FITNESS FOR A PARTIC
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 OTHER DEALINGS IN THE SOFTWARE.
 
 
 -->
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 <script type="application/x-javascript" src="../util.js"></script>
 <script type="application/x-javascript">
 
 /*
   The following tests are generated from
   http://www.khronos.org/registry/gles/api/2.0/gl2.h
--- a/content/canvas/test/webgl/conformance/more/conformance/quickCheckAPI.html
+++ b/content/canvas/test/webgl/conformance/more/conformance/quickCheckAPI.html
@@ -1,11 +1,11 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
 <html><head>
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<meta charset="utf-8">
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 <script type="application/x-javascript" src="../util.js"></script>
 <script type="application/x-javascript" src="quickCheckAPI.js"></script>
 
 <script type="application/x-javascript">
 
 // Test that all GL functions specified in ArgGenerators work
--- a/content/canvas/test/webgl/conformance/more/conformance/quickCheckAPIBadArgs.html
+++ b/content/canvas/test/webgl/conformance/more/conformance/quickCheckAPIBadArgs.html
@@ -1,11 +1,11 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
 <html><head>
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<meta charset="utf-8">
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 <script type="application/x-javascript" src="../util.js"></script>
 <script type="application/x-javascript" src="quickCheckAPI.js"></script>
 
 <script type="application/x-javascript">
 
 // Test that all GL functions specified in ArgGenerators fail
--- a/content/canvas/test/webgl/conformance/more/conformance/webGLArrays.html
+++ b/content/canvas/test/webgl/conformance/more/conformance/webGLArrays.html
@@ -1,11 +1,11 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
 <html><head>
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<meta charset="utf-8">
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 <script type="application/x-javascript" src="../util.js"></script>
 
 <script type="application/x-javascript">
 
 function assertIdxs(name, arr, length) {
 //   assertOk(name+": Read with negative idx should work", function(){ return arr[-1] });
@@ -140,19 +140,18 @@ Tests.testThatWritesChangeDrawing = func
 <script id="vert" type="x-shader/x-vertex">
   attribute vec2 Vertex;
   void main()
   {
     gl_Position = vec4(Vertex, 0.0, 1.0);
   }
 </script>
 <script id="frag" type="x-shader/x-fragment">
-  #ifdef GL_ES
-precision highp float;
-#endif
+  precision mediump float;
+
   uniform vec4 c;
   void main()
   {
     gl_FragColor = c;
   }
 </script>
 <style>canvas{border: 1px solid black}</style>
 </head><body>
--- a/content/canvas/test/webgl/conformance/more/demos/opengl_web.html
+++ b/content/canvas/test/webgl/conformance/more/demos/opengl_web.html
@@ -1,13 +1,13 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
 <html><head>
+<meta charset="utf-8">
 
 <title>OpenGL for the web</title>
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
 
 <script type="application/x-javascript" src="../util.js"></script>
 
     <script type="application/x-javascript">
 
 function log(msg) {
   document.getElementById('note').textContent += "\n"+msg;
 }
@@ -244,19 +244,18 @@ window.addEventListener("load", init, fa
         ambient = MaterialAmbient * LightAmbient;
         ambientGlobal = GlobalAmbient * MaterialAmbient;
 
         gl_Position = PMatrix * worldPos;
       }
     </script>
 
     <script id="ppix-frag" type="x-shader/x-fragment">
-      #ifdef GL_ES
-precision highp float;
-#endif
+      precision mediump float;
+
       uniform vec4 LightSpecular;
       uniform vec4 MaterialSpecular;
       uniform float MaterialShininess;
 
       uniform float LightConstantAtt;
       uniform float LightLinearAtt;
       uniform float LightQuadraticAtt;
 
@@ -297,19 +296,18 @@ precision highp float;
       varying float depth;
       void main()
       {
         gl_Position = PMatrix * (MVMatrix * vec4(Vertex, 1.0));
         depth = 1.0-(gl_Position.z / gl_Position.w);
       }
     </script>
     <script id="depth-frag" type="x-shader/x-fragment">
-      #ifdef GL_ES
-precision highp float;
-#endif
+      precision mediump float;
+
       varying float depth;
       void main()
       {
         vec4 c = vec4(depth, 0.0, 0.0, 1.0);
         gl_FragColor = c;
       }
     </script>
 
@@ -320,65 +318,61 @@ precision highp float;
       varying vec4 texCoord0;
       void main()
       {
         texCoord0 = vec4(Tex,0.0,0.0);
         gl_Position = vec4(Vertex, 1.0);
       }
     </script>
     <script id="identity-frag" type="x-shader/x-fragment">
-      #ifdef GL_ES
-precision highp float;
-#endif
+      precision mediump float;
+
       uniform sampler2D Texture;
 
       varying vec4 texCoord0;
       void main()
       {
         vec4 c = texture2D(Texture, texCoord0.st);
         gl_FragColor = c;
       }
     </script>
     <script id="premult-frag" type="x-shader/x-fragment">
-      #ifdef GL_ES
-precision highp float;
-#endif
+      precision mediump float;
+
       uniform sampler2D Texture;
 
       varying vec4 texCoord0;
       void main()
       {
         vec4 c = texture2D(Texture, texCoord0.st);
         float a = c.a;
         c *= a;
         c.a = a;
         gl_FragColor = c;
       }
     </script>
     <script id="unpremult-frag" type="x-shader/x-fragment">
-      #ifdef GL_ES
-precision highp float;
-#endif
+      precision mediump float;
+
       uniform sampler2D Texture;
 
       varying vec4 texCoord0;
       void main()
       {
         vec4 c = texture2D(Texture, texCoord0.st);
         float a = c.a;
         c /= a;
         c.a = a;
         gl_FragColor = c;
       }
     </script>
 
     <script id="hblur-frag" type="x-shader/x-fragment">
-      #ifdef GL_ES
-precision highp float;
-#endif
+      precision mediump float;
+
       uniform sampler2D Texture;
       uniform float step;
       float kernel[7] = float[](0.046, 0.111, 0.202, 0.283, 0.202, 0.111, 0.046);
 
       varying vec4 texCoord0;
       void main()
       {
         int i=0;
@@ -390,19 +384,18 @@ precision highp float;
           }
           gl_FragColor = sum;
         } else {
           gl_FragColor = texture2D(Texture, texCoord0.st);
         }
       }
     </script>
     <script id="vblur-frag" type="x-shader/x-fragment">
-      #ifdef GL_ES
-precision highp float;
-#endif
+      precision mediump float;
+
       uniform sampler2D Texture;
       uniform float step;
       float kernel[7] = float[](0.046, 0.111, 0.202, 0.283, 0.202, 0.111, 0.046);
 
       varying vec4 texCoord0;
       void main()
       {
         int i=0;
@@ -414,19 +407,18 @@ precision highp float;
           }
           gl_FragColor = sum;
         } else {
           gl_FragColor = texture2D(Texture, texCoord0.st);
         }
       }
     </script>
     <script id="hdof-frag" type="x-shader/x-fragment">
-      #ifdef GL_ES
-precision highp float;
-#endif
+      precision mediump float;
+
       uniform sampler2D Texture;
       uniform sampler2D Depth;
       uniform float step;
       uniform float iter;
       float kernel[7] = { 0.046, 0.111, 0.202, 0.283, 0.202, 0.111, 0.046 };
 
       varying vec4 texCoord0;
       void main()
@@ -447,19 +439,18 @@ precision highp float;
         tmp = texture2D(Texture, texCoord0.st + vec2(float(5-3)*step,0));
         sum += tmp * kernel[5];
         tmp = texture2D(Texture, texCoord0.st + vec2(float(6-3)*step,0));
         sum += tmp * kernel[6];
         gl_FragColor = mix(texture2D(Texture, texCoord0.st), sum, b ? 1.0 : 0.0);
       }
     </script>
     <script id="vdof-frag" type="x-shader/x-fragment">
-      #ifdef GL_ES
-precision highp float;
-#endif
+      precision mediump float;
+
       uniform sampler2D Texture;
       uniform sampler2D Depth;
       uniform float step;
       uniform float iter;
       float kernel[7] = float[7](0.046, 0.111, 0.202, 0.283, 0.202, 0.111, 0.046);
 
       varying vec4 texCoord0;
       void main()
@@ -581,9 +572,9 @@ that it doesn't make policy decisions. T
 use case for it: In addition to 3D graphics, you can also use it for
 filtering images, visualizing fluid dynamics, doing real-time video
 effects, or just crunching a whole lot of FP math. If you can do it on
 the GPU, you're in luck! </p>
     </div>
     <div id="above">
       <p>You can also place content above the canvas</p>
     </div>
-  </body></html>
\ No newline at end of file
+  </body></html>
--- a/content/canvas/test/webgl/conformance/more/demos/video.html
+++ b/content/canvas/test/webgl/conformance/more/demos/video.html
@@ -1,10 +1,11 @@
 <html>
 <head>
+<meta charset="utf-8">
 <script type="application/x-javascript" src="../util.js"></script>
 <script>
 var processor = {
   lastTime : new Date,
   timerCallback: function() {
     if (this.video.paused || this.video.ended) {
       return;
     }
@@ -67,19 +68,18 @@ var processor = {
     varying vec4 texCoord0;
     void main()
     {
         texCoord0 = vec4(Tex.s,1.0-Tex.t,0.0,0.0);
         gl_Position = vec4(Vertex, 1.0);
     }
 </script>
 <script id="greenScreen" type="x-shader/x-fragment">
-    #ifdef GL_ES
-precision highp float;
-#endif
+    precision mediump float;
+
     uniform sampler2D Texture;
     uniform sampler2D Texture2;
 
     varying vec4 texCoord0;
     void main()
     {
         vec4 c = texture2D(Texture, texCoord0.st);
         float r = c.r * 0.5;
--- a/content/canvas/test/webgl/conformance/more/functions/bindBuffer.html
+++ b/content/canvas/test/webgl/conformance/more/functions/bindBuffer.html
@@ -1,14 +1,15 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
 <html><head>
+<meta charset="utf-8">
 <!--
 Tests for the OpenGL ES 2.0 HTML Canvas context
 
-Copyright (C) 2009  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
+Copyright (C) 2011  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
 
 Permission is hereby granted, free of charge, to any person
 obtaining a copy of this software and associated documentation
 files (the "Software"), to deal in the Software without
 restriction, including without limitation the rights to use,
 copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the
 Software is furnished to do so, subject to the following
@@ -22,17 +23,16 @@ EXPRESS OR IMPLIED, INCLUDING BUT NOT LI
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 OTHER DEALINGS IN THE SOFTWARE.
 
 -->
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 <script type="application/x-javascript" src="../util.js"></script>
 <script type="application/x-javascript">
 
 Tests.startUnit = function () {
   var canvas = document.getElementById('gl');
   var gl = wrapGLContext(canvas.getContext(GL_CONTEXT_ID));
--- a/content/canvas/test/webgl/conformance/more/functions/bindBufferBadArgs.html
+++ b/content/canvas/test/webgl/conformance/more/functions/bindBufferBadArgs.html
@@ -1,14 +1,15 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
 <html><head>
+<meta charset="utf-8">
 <!--
 Tests for the OpenGL ES 2.0 HTML Canvas context
 
-Copyright (C) 2009  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
+Copyright (C) 2011  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
 
 Permission is hereby granted, free of charge, to any person
 obtaining a copy of this software and associated documentation
 files (the "Software"), to deal in the Software without
 restriction, including without limitation the rights to use,
 copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the
 Software is furnished to do so, subject to the following
@@ -22,17 +23,16 @@ EXPRESS OR IMPLIED, INCLUDING BUT NOT LI
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 OTHER DEALINGS IN THE SOFTWARE.
 
 -->
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 <script type="application/x-javascript" src="../util.js"></script>
 <script type="application/x-javascript">
 
 Tests.startUnit = function () {
   var canvas = document.getElementById('gl');
   var gl = wrapGLContext(canvas.getContext(GL_CONTEXT_ID));
--- a/content/canvas/test/webgl/conformance/more/functions/bindFramebufferLeaveNonZero.html
+++ b/content/canvas/test/webgl/conformance/more/functions/bindFramebufferLeaveNonZero.html
@@ -1,12 +1,12 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
 <html><head>
+<meta charset="utf-8">
 <title>OpenGL for the web</title>
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
 
 <script type="application/x-javascript" src="../util.js"></script>
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 
     <script type="application/x-javascript">
 Tests.message = "This was segfaulting when the GL context got GC'd (in glXDestroyContext)";
 Tests.testSeg = function () {
--- a/content/canvas/test/webgl/conformance/more/functions/bufferData.html
+++ b/content/canvas/test/webgl/conformance/more/functions/bufferData.html
@@ -1,11 +1,11 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
 <html><head>
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<meta charset="utf-8">
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 <script type="application/x-javascript" src="../util.js"></script>
 <script type="application/x-javascript">
 
 Tests.startUnit = function () {
   var canvas = document.getElementById('gl');
   var gl = wrapGLContext(canvas.getContext(GL_CONTEXT_ID));
--- a/content/canvas/test/webgl/conformance/more/functions/bufferDataBadArgs.html
+++ b/content/canvas/test/webgl/conformance/more/functions/bufferDataBadArgs.html
@@ -1,11 +1,11 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
 <html><head>
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<meta charset="utf-8">
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 <script type="application/x-javascript" src="../util.js"></script>
 <script type="application/x-javascript">
 
 Tests.startUnit = function () {
   var canvas = document.getElementById('gl');
   var gl = wrapGLContext(canvas.getContext(GL_CONTEXT_ID));
--- a/content/canvas/test/webgl/conformance/more/functions/bufferSubData.html
+++ b/content/canvas/test/webgl/conformance/more/functions/bufferSubData.html
@@ -1,11 +1,11 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
 <html><head>
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<meta charset="utf-8">
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 <script type="application/x-javascript" src="../util.js"></script>
 <script type="application/x-javascript">
 
 Tests.startUnit = function () {
     var canvas = document.getElementById('gl');
     var gl = canvas.getContext(GL_CONTEXT_ID);
--- a/content/canvas/test/webgl/conformance/more/functions/bufferSubDataBadArgs.html
+++ b/content/canvas/test/webgl/conformance/more/functions/bufferSubDataBadArgs.html
@@ -1,11 +1,11 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
 <html><head>
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<meta charset="utf-8">
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 <script type="application/x-javascript" src="../util.js"></script>
 <script type="application/x-javascript">
 
 Tests.startUnit = function () {
     var canvas = document.getElementById('gl');
     var gl = wrapGLContext(canvas.getContext(GL_CONTEXT_ID));
--- a/content/canvas/test/webgl/conformance/more/functions/copyTexImage2D.html
+++ b/content/canvas/test/webgl/conformance/more/functions/copyTexImage2D.html
@@ -1,14 +1,15 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
 <html><head>
+<meta charset="utf-8">
 <!--
 Tests for the OpenGL ES 2.0 HTML Canvas context
 
-Copyright (C) 2009  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
+Copyright (C) 2011  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
 
 Permission is hereby granted, free of charge, to any person
 obtaining a copy of this software and associated documentation
 files (the "Software"), to deal in the Software without
 restriction, including without limitation the rights to use,
 copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the
 Software is furnished to do so, subject to the following
@@ -22,17 +23,16 @@ EXPRESS OR IMPLIED, INCLUDING BUT NOT LI
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 OTHER DEALINGS IN THE SOFTWARE.
 
 -->
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 <script type="application/x-javascript" src="../util.js"></script>
 <script type="application/x-javascript">
 
 Tests.startUnit = function () {
   var canvas = document.getElementById('gl');
   var gl = wrapGLContext(canvas.getContext(GL_CONTEXT_ID));
@@ -108,19 +108,18 @@ attribute vec2 Tex;
 varying vec4 texCoord0;
 void main()
 {
     texCoord0 = vec4(Tex.s, 1.0-Tex.t, 0.0, 0.0);
     gl_Position = vec4(Vertex, 1.0);
 }
 </script>
 <script id="identity-frag" type="x-shader/x-fragment">
-#ifdef GL_ES
-precision highp float;
-#endif
+precision mediump float;
+
 uniform sampler2D Texture;
 
 varying vec4 texCoord0;
 void main()
 {
     vec4 c = texture2D(Texture, texCoord0.st);
     gl_FragColor = c;
 }
--- a/content/canvas/test/webgl/conformance/more/functions/copyTexImage2DBadArgs.html
+++ b/content/canvas/test/webgl/conformance/more/functions/copyTexImage2DBadArgs.html
@@ -1,14 +1,15 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
 <html><head>
+<meta charset="utf-8">
 <!--
 Tests for the OpenGL ES 2.0 HTML Canvas context
 
-Copyright (C) 2009  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
+Copyright (C) 2011  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
 
 Permission is hereby granted, free of charge, to any person
 obtaining a copy of this software and associated documentation
 files (the "Software"), to deal in the Software without
 restriction, including without limitation the rights to use,
 copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the
 Software is furnished to do so, subject to the following
@@ -22,17 +23,16 @@ EXPRESS OR IMPLIED, INCLUDING BUT NOT LI
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 OTHER DEALINGS IN THE SOFTWARE.
 
 -->
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 <script type="application/x-javascript" src="../util.js"></script>
 <script type="application/x-javascript">
 
 Tests.startUnit = function () {
     var canvas = document.getElementById('gl');
     var gl = wrapGLContext(canvas.getContext(GL_CONTEXT_ID));
--- a/content/canvas/test/webgl/conformance/more/functions/copyTexSubImage2D.html
+++ b/content/canvas/test/webgl/conformance/more/functions/copyTexSubImage2D.html
@@ -1,14 +1,15 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
 <html><head>
+<meta charset="utf-8">
 <!--
 Tests for the OpenGL ES 2.0 HTML Canvas context
 
-Copyright (C) 2009  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
+Copyright (C) 2011  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
 
 Permission is hereby granted, free of charge, to any person
 obtaining a copy of this software and associated documentation
 files (the "Software"), to deal in the Software without
 restriction, including without limitation the rights to use,
 copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the
 Software is furnished to do so, subject to the following
@@ -22,17 +23,16 @@ EXPRESS OR IMPLIED, INCLUDING BUT NOT LI
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 OTHER DEALINGS IN THE SOFTWARE.
 
 -->
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 <script type="application/x-javascript" src="../util.js"></script>
 <script type="application/x-javascript">
 
 Tests.startUnit = function () {
   var canvas = document.getElementById('gl');
   var gl = wrapGLContext(canvas.getContext(GL_CONTEXT_ID));
@@ -120,19 +120,18 @@ attribute vec2 Tex;
 varying vec4 texCoord0;
 void main()
 {
     texCoord0 = vec4(Tex.s, 1.0-Tex.t, 0.0, 0.0);
     gl_Position = vec4(Vertex, 1.0);
 }
 </script>
 <script id="identity-frag" type="x-shader/x-fragment">
-#ifdef GL_ES
-precision highp float;
-#endif
+precision mediump float;
+
 uniform sampler2D Texture;
 
 varying vec4 texCoord0;
 void main()
 {
     vec4 c = texture2D(Texture, texCoord0.st);
     gl_FragColor = c;
 }
--- a/content/canvas/test/webgl/conformance/more/functions/copyTexSubImage2DBadArgs.html
+++ b/content/canvas/test/webgl/conformance/more/functions/copyTexSubImage2DBadArgs.html
@@ -1,14 +1,15 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
 <html><head>
+<meta charset="utf-8">
 <!--
 Tests for the OpenGL ES 2.0 HTML Canvas context
 
-Copyright (C) 2009  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
+Copyright (C) 2011  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
 
 Permission is hereby granted, free of charge, to any person
 obtaining a copy of this software and associated documentation
 files (the "Software"), to deal in the Software without
 restriction, including without limitation the rights to use,
 copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the
 Software is furnished to do so, subject to the following
@@ -22,17 +23,16 @@ EXPRESS OR IMPLIED, INCLUDING BUT NOT LI
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 OTHER DEALINGS IN THE SOFTWARE.
 
 -->
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 <script type="application/x-javascript" src="../util.js"></script>
 <script type="application/x-javascript">
 
 Tests.startUnit = function () {
     var canvas = document.getElementById('gl');
     var gl = wrapGLContext(canvas.getContext(GL_CONTEXT_ID));
--- a/content/canvas/test/webgl/conformance/more/functions/deleteBufferBadArgs.html
+++ b/content/canvas/test/webgl/conformance/more/functions/deleteBufferBadArgs.html
@@ -1,11 +1,11 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
 <html><head>
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<meta charset="utf-8">
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 <script type="application/x-javascript" src="../util.js"></script>
 <script type="application/x-javascript">
 
 Tests.startUnit = function () {
   var canvas = document.getElementById('gl');
   var gl = canvas.getContext(GL_CONTEXT_ID);
--- a/content/canvas/test/webgl/conformance/more/functions/drawArrays.html
+++ b/content/canvas/test/webgl/conformance/more/functions/drawArrays.html
@@ -1,14 +1,15 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
 <html><head>
+<meta charset="utf-8">
 <!--
 Tests for the OpenGL ES 2.0 HTML Canvas context
 
-Copyright (C) 2009  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
+Copyright (C) 2011  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
 
 Permission is hereby granted, free of charge, to any person
 obtaining a copy of this software and associated documentation
 files (the "Software"), to deal in the Software without
 restriction, including without limitation the rights to use,
 copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the
 Software is furnished to do so, subject to the following
@@ -22,17 +23,16 @@ EXPRESS OR IMPLIED, INCLUDING BUT NOT LI
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 OTHER DEALINGS IN THE SOFTWARE.
 
 -->
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 <script type="application/x-javascript" src="../util.js"></script>
 <script type="application/x-javascript">
 
 var verts = [0.0, 0.0, 0.0,   1.0, 0.0, 0.0,   0.0, 1.0, 0.0];
 var normals = [0.0, 0.0, 1.0,   0.0, 0.0, 1.0,   0.0, 0.0, 1.0];
 var texcoords = [0.0,0.0,  1.0,0.0,  0.0,1.0];
@@ -113,19 +113,18 @@ Tests.testDrawArraysVBOMulti = function(
   varying vec4 texCoord0;
   void main()
   {
     gl_Position = vec4(Vertex * Normal, 1.0);
     texCoord0 = vec4(Tex,0.0,0.0) + gl_Position;
   }
 </script>
 <script id="frag" type="x-shader/x-fragment">
-  #ifdef GL_ES
-precision highp float;
-#endif
+  precision mediump float;
+
   varying vec4 texCoord0;
   void main()
   {
     vec4 c = texCoord0;
     gl_FragColor = c;
   }
 </script>
 
--- a/content/canvas/test/webgl/conformance/more/functions/drawArraysOutOfBounds.html
+++ b/content/canvas/test/webgl/conformance/more/functions/drawArraysOutOfBounds.html
@@ -1,14 +1,15 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
 <html><head>
+<meta charset="utf-8">
 <!--
 Tests for the OpenGL ES 2.0 HTML Canvas context
 
-Copyright (C) 2009  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
+Copyright (C) 2011  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
 
 Permission is hereby granted, free of charge, to any person
 obtaining a copy of this software and associated documentation
 files (the "Software"), to deal in the Software without
 restriction, including without limitation the rights to use,
 copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the
 Software is furnished to do so, subject to the following
@@ -22,17 +23,16 @@ EXPRESS OR IMPLIED, INCLUDING BUT NOT LI
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 OTHER DEALINGS IN THE SOFTWARE.
 
 -->
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 <script type="application/x-javascript" src="../util.js"></script>
 <script type="application/x-javascript">
 
 var verts = [0.0, 0.0, 0.0,   1.0, 0.0, 0.0,   0.0, 1.0, 0.0];
 var normals = [0.0, 0.0, 1.0,   0.0, 0.0, 1.0,   0.0, 0.0, 1.0];
 var texcoords = [0.0,0.0,  1.0,0.0,  0.0,1.0];
@@ -284,19 +284,18 @@ Tests.testDrawArraysOOBShaderJuggle = fu
   varying vec4 texCoord0;
   void main()
   {
     gl_Position = vec4(Vertex * Normal, 1.0);
     texCoord0 = vec4(Tex,0.0,0.0) + gl_Position;
   }
 </script>
 <script id="frag" type="x-shader/x-fragment">
-  #ifdef GL_ES
-precision highp float;
-#endif
+  precision mediump float;
+
   varying vec4 texCoord0;
   void main()
   {
     gl_FragColor = texCoord0;
   }
 </script>
 
 
--- a/content/canvas/test/webgl/conformance/more/functions/drawElements.html
+++ b/content/canvas/test/webgl/conformance/more/functions/drawElements.html
@@ -1,14 +1,15 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
 <html><head>
+<meta charset="utf-8">
 <!--
 Tests for the OpenGL ES 2.0 HTML Canvas context
 
-Copyright (C) 2009  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
+Copyright (C) 2011  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
 
 Permission is hereby granted, free of charge, to any person
 obtaining a copy of this software and associated documentation
 files (the "Software"), to deal in the Software without
 restriction, including without limitation the rights to use,
 copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the
 Software is furnished to do so, subject to the following
@@ -22,17 +23,16 @@ EXPRESS OR IMPLIED, INCLUDING BUT NOT LI
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 OTHER DEALINGS IN THE SOFTWARE.
 
 -->
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 <script type="application/x-javascript" src="../util.js"></script>
 <script type="application/x-javascript">
 
 var verts = [0.0, 0.0, 0.0,   1.0, 0.0, 0.0,   0.0, 1.0, 0.0];
 var normals = [0.0, 0.0, 1.0,   0.0, 0.0, 1.0,   0.0, 0.0, 1.0];
 var texcoords = [0.0,0.0,  1.0,0.0,  0.0,1.0];
@@ -121,19 +121,18 @@ Tests.testDrawElementsVBOMulti = functio
   varying vec4 texCoord0;
   void main()
   {
     gl_Position = vec4(Vertex * Normal, 1.0);
     texCoord0 = vec4(Tex,0.0,0.0) + gl_Position;
   }
 </script>
 <script id="frag" type="x-shader/x-fragment">
-  #ifdef GL_ES
-precision highp float;
-#endif
+  precision mediump float;
+
   varying vec4 texCoord0;
   void main()
   {
     vec4 c = texCoord0;
     gl_FragColor = c;
   }
 </script>
 
--- a/content/canvas/test/webgl/conformance/more/functions/drawElementsBadArgs.html
+++ b/content/canvas/test/webgl/conformance/more/functions/drawElementsBadArgs.html
@@ -1,14 +1,15 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
 <html><head>
+<meta charset="utf-8">
 <!--
 Tests for the OpenGL ES 2.0 HTML Canvas context
 
-Copyright (C) 2009  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
+Copyright (C) 2011  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
 
 Permission is hereby granted, free of charge, to any person
 obtaining a copy of this software and associated documentation
 files (the "Software"), to deal in the Software without
 restriction, including without limitation the rights to use,
 copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the
 Software is furnished to do so, subject to the following
@@ -22,17 +23,16 @@ EXPRESS OR IMPLIED, INCLUDING BUT NOT LI
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 OTHER DEALINGS IN THE SOFTWARE.
 
 -->
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 <script type="application/x-javascript" src="../util.js"></script>
 <script type="application/x-javascript">
 
 // Tests.autorun = false;
 // Tests.message = "Caution: May crash your browser";
 
@@ -187,19 +187,18 @@ Tests.testSharedBuffers = function(gl, p
   varying vec4 texCoord0;
   void main()
   {
     gl_Position = vec4(Vertex * Normal, 1.0);
     texCoord0 = vec4(Tex,0.0,0.0) + gl_Position;
   }
 </script>
 <script id="frag" type="x-shader/x-fragment">
-  #ifdef GL_ES
-precision highp float;
-#endif
+  precision mediump float;
+
   varying vec4 texCoord0;
   void main()
   {
     vec4 c = texCoord0;
     gl_FragColor = c;
   }
 </script>
 
--- a/content/canvas/test/webgl/conformance/more/functions/isTests.html
+++ b/content/canvas/test/webgl/conformance/more/functions/isTests.html
@@ -1,14 +1,15 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
 <html><head>
+<meta charset="utf-8">
 <!--
 Tests for the OpenGL ES 2.0 HTML Canvas context
 
-Copyright (C) 2009  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
+Copyright (C) 2011  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
 
 Permission is hereby granted, free of charge, to any person
 obtaining a copy of this software and associated documentation
 files (the "Software"), to deal in the Software without
 restriction, including without limitation the rights to use,
 copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the
 Software is furnished to do so, subject to the following
@@ -22,17 +23,16 @@ EXPRESS OR IMPLIED, INCLUDING BUT NOT LI
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 OTHER DEALINGS IN THE SOFTWARE.
 
 -->
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 <script type="application/x-javascript" src="../util.js"></script>
 <script type="application/x-javascript">
 
 Tests.startUnit = function () {
   var canvas = document.getElementById('gl');
   var gl = wrapGLContext(canvas.getContext(GL_CONTEXT_ID));
--- a/content/canvas/test/webgl/conformance/more/functions/readPixels.html
+++ b/content/canvas/test/webgl/conformance/more/functions/readPixels.html
@@ -1,14 +1,15 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
 <html><head>
+<meta charset="utf-8">
 <!--
 Tests for the OpenGL ES 2.0 HTML Canvas context
 
-Copyright (C) 2009  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
+Copyright (C) 2011  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
 
 Permission is hereby granted, free of charge, to any person
 obtaining a copy of this software and associated documentation
 files (the "Software"), to deal in the Software without
 restriction, including without limitation the rights to use,
 copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the
 Software is furnished to do so, subject to the following
@@ -22,17 +23,16 @@ EXPRESS OR IMPLIED, INCLUDING BUT NOT LI
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 OTHER DEALINGS IN THE SOFTWARE.
 
 -->
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 <script type="application/x-javascript" src="../util.js"></script>
 <script type="application/x-javascript">
 
 Tests.startUnit = function () {
   var canvas = document.getElementById('gl');
   var gl = wrapGLContext(canvas.getContext(GL_CONTEXT_ID));
--- a/content/canvas/test/webgl/conformance/more/functions/readPixelsBadArgs.html
+++ b/content/canvas/test/webgl/conformance/more/functions/readPixelsBadArgs.html
@@ -1,14 +1,15 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
 <html><head>
+<meta charset="utf-8">
 <!--
 Tests for the OpenGL ES 2.0 HTML Canvas context
 
-Copyright (C) 2009  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
+Copyright (C) 2011  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
 
 Permission is hereby granted, free of charge, to any person
 obtaining a copy of this software and associated documentation
 files (the "Software"), to deal in the Software without
 restriction, including without limitation the rights to use,
 copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the
 Software is furnished to do so, subject to the following
@@ -22,17 +23,16 @@ EXPRESS OR IMPLIED, INCLUDING BUT NOT LI
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 OTHER DEALINGS IN THE SOFTWARE.
 
 -->
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 <script type="application/x-javascript" src="../util.js"></script>
 <script type="application/x-javascript">
 
 Tests.startUnit = function () {
   var canvas = document.getElementById('gl');
   var gl = wrapGLContext(canvas.getContext(GL_CONTEXT_ID));
@@ -70,49 +70,48 @@ Tests.testReadPixels = function(gl) {
           new Uint8Array(4*4));});
   // we can't know if this is going to fail because of negative width
   // or because the buffer size doesn't match the dimensions.
   assertSomeGLError(gl, "bad type",
       function(){gl.readPixels(0,0,1,1, gl.ALPHA, gl.FLOAT,
           new Uint8Array(1*4));});
 }
 
-/* this part is obsolete because of bug 656277
- *
 Tests.testReadPixelsSOPIMG = function(gl) {
     var img = document.getElementById("i");
     while (!img.complete) {}
     var tex = gl.createTexture();
     gl.bindTexture(gl.TEXTURE_2D, tex);
-    gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, img);
-    gl.bindTexture(gl.TEXTURE_2D, null);
     // SOP failure
     assertThrowNoGLError(gl, "throw because img is from another domain",
+      function(){gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, img);});
+    gl.bindTexture(gl.TEXTURE_2D, null);
+    assertOk("canvas still origin-clean",
       function(){gl.readPixels(0,0,1,1, gl.RGBA, gl.UNSIGNED_BYTE,
           new Uint8Array(4));});
     gl.deleteTexture(tex);
 }
 Tests.testReadPixelsSOPCanvas = function(gl) {
     var img = document.getElementById("i");
     while (!img.complete) {}
     var c = document.getElementById("c");
     c.getContext("2d").drawImage(img, 0, 0);
     assertFail("canvas throws because not origin clean",
       function(){c.getContext("2d").getImageData(0,0,1,1);});
     var tex = gl.createTexture();
     gl.bindTexture(gl.TEXTURE_2D, tex);
-    gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, c);
-    gl.bindTexture(gl.TEXTURE_2D, null);
     // SOP failure
     assertThrowNoGLError(gl, "throw because canvas is not origin clean",
+      function(){gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, c);});
+    gl.bindTexture(gl.TEXTURE_2D, null);
+    assertOk("canvas still origin-clean",
       function(){gl.readPixels(0,0,1,1, gl.RGBA, gl.UNSIGNED_BYTE,
           new Uint8Array(4));});
     gl.deleteTexture(tex);
 }
-*/
 
 Tests.endUnit = function(gl) {
 }
 
 </script>
 </head><body>
 <canvas id="gl" width="16" height="16"></canvas>
 <canvas id="c" width="128" height="128"></canvas>
--- a/content/canvas/test/webgl/conformance/more/functions/texImage2D.html
+++ b/content/canvas/test/webgl/conformance/more/functions/texImage2D.html
@@ -1,14 +1,15 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
 <html><head>
+<meta charset="utf-8">
 <!--
 Tests for the OpenGL ES 2.0 HTML Canvas context
 
-Copyright (C) 2009  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
+Copyright (C) 2011  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
 
 Permission is hereby granted, free of charge, to any person
 obtaining a copy of this software and associated documentation
 files (the "Software"), to deal in the Software without
 restriction, including without limitation the rights to use,
 copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the
 Software is furnished to do so, subject to the following
@@ -22,17 +23,16 @@ EXPRESS OR IMPLIED, INCLUDING BUT NOT LI
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 OTHER DEALINGS IN THE SOFTWARE.
 
 -->
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 <script type="application/x-javascript" src="../util.js"></script>
 <script type="application/x-javascript">
 
 Tests.startUnit = function () {
   var canvas = document.getElementById('gl');
   var gl = wrapGLContext(canvas.getContext(GL_CONTEXT_ID));
--- a/content/canvas/test/webgl/conformance/more/functions/texImage2DBadArgs.html
+++ b/content/canvas/test/webgl/conformance/more/functions/texImage2DBadArgs.html
@@ -1,14 +1,15 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
 <html><head>
+<meta charset="utf-8">
 <!--
 Tests for the OpenGL ES 2.0 HTML Canvas context
 
-Copyright (C) 2009  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
+Copyright (C) 2011  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
 
 Permission is hereby granted, free of charge, to any person
 obtaining a copy of this software and associated documentation
 files (the "Software"), to deal in the Software without
 restriction, including without limitation the rights to use,
 copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the
 Software is furnished to do so, subject to the following
@@ -22,17 +23,16 @@ EXPRESS OR IMPLIED, INCLUDING BUT NOT LI
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 OTHER DEALINGS IN THE SOFTWARE.
 
 -->
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 <script type="application/x-javascript" src="../util.js"></script>
 <script type="application/x-javascript">
 
 Tests.startUnit = function () {
     var canvas = document.getElementById('gl');
     var gl = wrapGLContext(canvas.getContext(GL_CONTEXT_ID));
--- a/content/canvas/test/webgl/conformance/more/functions/texImage2DHTML.html
+++ b/content/canvas/test/webgl/conformance/more/functions/texImage2DHTML.html
@@ -1,14 +1,15 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
 <html><head>
+<meta charset="utf-8">
 <!--
 Tests for the OpenGL ES 2.0 HTML Canvas context
 
-Copyright (C) 2009  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
+Copyright (C) 2011  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
 
 Permission is hereby granted, free of charge, to any person
 obtaining a copy of this software and associated documentation
 files (the "Software"), to deal in the Software without
 restriction, including without limitation the rights to use,
 copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the
 Software is furnished to do so, subject to the following
@@ -22,17 +23,16 @@ EXPRESS OR IMPLIED, INCLUDING BUT NOT LI
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 OTHER DEALINGS IN THE SOFTWARE.
 
 -->
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 <script type="application/x-javascript" src="../util.js"></script>
 <script type="application/x-javascript">
 
 Tests.startUnit = function () {
     var canvas = document.getElementById('gl');
     var gl = wrapGLContext(canvas.getContext(GL_CONTEXT_ID));
@@ -94,18 +94,20 @@ Tests.testTexImage2D = function(gl) {
 }
 
 Tests.testTexImage2DNonSOP = function(gl) {
     var img = document.getElementById('i2');
     while (!img.complete) {}
     var c = document.getElementById('c');
     var ctx = c.getContext('2d');
     ctx.drawImage(img,0,0);
-    gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, img);
-    gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, c);
+    assertThrowNoGLError(gl, "texImage2D with cross-origin image should throw exception.",
+      function(){gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, img);});
+    assertThrowNoGLError(gl, "texImage2D with dirty origin canvas should throw exception.",
+      function(){gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, c);});
 }
 
 Tests.endUnit = function(gl) {
 }
 
 </script>
 <script id="identity-flip-vert" type="x-shader/x-vertex">
 attribute vec3 Vertex;
@@ -125,27 +127,26 @@ attribute vec2 Tex;
 varying vec4 texCoord0;
 void main()
 {
     texCoord0 = vec4(1.0-Tex.s, Tex.t, 0.0, 0.0);
     gl_Position = vec4(Vertex, 1.0);
 }
 </script>
 <script id="identity-frag" type="x-shader/x-fragment">
-#ifdef GL_ES
-precision highp float;
-#endif
+precision mediump float;
+
 uniform sampler2D Texture;
 
 varying vec4 texCoord0;
 void main()
 {
     vec4 c = texture2D(Texture, texCoord0.st);
     gl_FragColor = c;
 }
 </script>
 </head><body>
 <canvas id="gl" width="256" height="256"></canvas>
 <canvas id="c" width="256" height="256"></canvas>
 <img id="i" width="256" height="256"  src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAATVElEQVR4nO3d+VPUd57Hcf2b9k9Y+z44+qK7OZoGFVA5VfBGzah9cxpNzGEOoRua5lBEue/DK4fZ7MapmSm3Mlshu8xOdCpDJt3v/aEBAUHAOMG4z0fV53fqU/V6fd7fT/e32bEDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwOvBkar7l+3+GwBsk8xUrT0rTb8vx2Q45janlu7YsWPnsgXgTeYwak85U3Xv5ZiM3+XbUh/l2dICBc6080WZ1ur92baSHRQB8GayGdUWu1HzoSNFO+ZM1f2cbTLM51lT5woc5rkDObbZ/Vm2SEm23VvsyjhV5nJQBsCbxGZQVtmN6p4Mo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LoV8KvvQ3e+MDzd4f+ps9/9Ef9rYNRHyObd4DAAtWFMJoW7B2uDUYHooGYkPRQGyoxf9oqMU3OxTxzQ1FfHNDLb75oYgvPhjxJpZWeO3gJ8PvSfQ3eX8aCHtn+5u9M33NXP4Br7MVhTDcGqgdbvWHB1v9scFWf2ww4n80GPHNDoa9c4MR39xg2Ds3EPbOD4S98YGwJzEQ9iT6m73S3+yVvmbPfH+zZ76vyfO0v9n7p75mb29/M5d/wG/Jc4Uw1OIP90f8scGIP9Yf8ccGwr5HA2Hv7ECzd26g2TvXlwx9vK/Z821/s+e/+po83/Y3eT7ra/Y0cfkH/LbtXL2GWny1A2FfuC/sjfWHvbH+Zs+jvrD3Zm+TZ6i3yTPW1+yZ7GvyXO9r9vi3908H8M+wohB6m7xlt695Tw6EfecGw15ff5Pnnb5mT6D32oUD2/x3AvgV7dyxY8fOgSavu7/Jk9V3zave7j8IAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAICV/g9tPJEQu1XvmQAAAABJRU5ErkJggg==">
-<img id="i2" src="http://mochi.test:8888/tests/content/canvas/test/webgl/resources/thunderbird-logo-64x64.png">
+<img id="i2" src="http://example.com/tests/content/canvas/test/webgl/resources/thunderbird-logo-64x64.png">
 
 </body></html>
--- a/content/canvas/test/webgl/conformance/more/functions/texImage2DHTMLBadArgs.html
+++ b/content/canvas/test/webgl/conformance/more/functions/texImage2DHTMLBadArgs.html
@@ -1,11 +1,11 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
 <html><head>
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<meta charset="utf-8">
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 <script type="application/x-javascript" src="../util.js"></script>
 <script type="application/x-javascript">
 
 Tests.startUnit = function () {
   var canvas = document.getElementById('gl');
   var gl = wrapGLContext(canvas.getContext(GL_CONTEXT_ID));
--- a/content/canvas/test/webgl/conformance/more/functions/texSubImage2D.html
+++ b/content/canvas/test/webgl/conformance/more/functions/texSubImage2D.html
@@ -1,14 +1,15 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
 <html><head>
+<meta charset="utf-8">
 <!--
 Tests for the OpenGL ES 2.0 HTML Canvas context
 
-Copyright (C) 2009  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
+Copyright (C) 2011  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
 
 Permission is hereby granted, free of charge, to any person
 obtaining a copy of this software and associated documentation
 files (the "Software"), to deal in the Software without
 restriction, including without limitation the rights to use,
 copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the
 Software is furnished to do so, subject to the following
@@ -22,17 +23,16 @@ EXPRESS OR IMPLIED, INCLUDING BUT NOT LI
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 OTHER DEALINGS IN THE SOFTWARE.
 
 -->
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 <script type="application/x-javascript" src="../util.js"></script>
 <script type="application/x-javascript">
 
 Tests.startUnit = function () {
   var canvas = document.getElementById('gl');
   var gl = wrapGLContext(canvas.getContext(GL_CONTEXT_ID));
--- a/content/canvas/test/webgl/conformance/more/functions/texSubImage2DBadArgs.html
+++ b/content/canvas/test/webgl/conformance/more/functions/texSubImage2DBadArgs.html
@@ -1,14 +1,15 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
 <html><head>
+<meta charset="utf-8">
 <!--
 Tests for the OpenGL ES 2.0 HTML Canvas context
 
-Copyright (C) 2009  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
+Copyright (C) 2011  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
 
 Permission is hereby granted, free of charge, to any person
 obtaining a copy of this software and associated documentation
 files (the "Software"), to deal in the Software without
 restriction, including without limitation the rights to use,
 copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the
 Software is furnished to do so, subject to the following
@@ -22,17 +23,16 @@ EXPRESS OR IMPLIED, INCLUDING BUT NOT LI
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 OTHER DEALINGS IN THE SOFTWARE.
 
 -->
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 <script type="application/x-javascript" src="../util.js"></script>
 <script type="application/x-javascript">
 
 Tests.startUnit = function () {
     var canvas = document.getElementById('gl');
     var gl = wrapGLContext(canvas.getContext(GL_CONTEXT_ID));
--- a/content/canvas/test/webgl/conformance/more/functions/texSubImage2DHTML.html
+++ b/content/canvas/test/webgl/conformance/more/functions/texSubImage2DHTML.html
@@ -1,14 +1,15 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
 <html><head>
+<meta charset="utf-8">
 <!--
 Tests for the OpenGL ES 2.0 HTML Canvas context
 
-Copyright (C) 2009  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
+Copyright (C) 2011  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
 
 Permission is hereby granted, free of charge, to any person
 obtaining a copy of this software and associated documentation
 files (the "Software"), to deal in the Software without
 restriction, including without limitation the rights to use,
 copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the
 Software is furnished to do so, subject to the following
@@ -22,17 +23,16 @@ EXPRESS OR IMPLIED, INCLUDING BUT NOT LI
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 OTHER DEALINGS IN THE SOFTWARE.
 
 -->
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 <script type="application/x-javascript" src="../util.js"></script>
 <script type="application/x-javascript">
 
 Tests.startUnit = function () {
     var canvas = document.getElementById('gl');
     var gl = wrapGLContext(canvas.getContext(GL_CONTEXT_ID));
@@ -102,20 +102,24 @@ Tests.testTexImage2D = function(gl) {
 }
 
 Tests.testTexImage2DNonSOP = function(gl) {
     var img = document.getElementById('i2');
     while (!img.complete) {}
     var c = document.getElementById('c');
     var ctx = c.getContext('2d');
     ctx.drawImage(img,0,0);
-    gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, img);
-    gl.texSubImage2D(gl.TEXTURE_2D, 0, 0,0, gl.RGBA, gl.UNSIGNED_BYTE, img);
-    gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, c);
-    gl.texSubImage2D(gl.TEXTURE_2D, 0, 0,0, gl.RGBA, gl.UNSIGNED_BYTE, c);
+    assertThrowNoGLError(gl, "texImage2D with cross-origin image should throw exception.",
+      function(){gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, img);});
+    assertThrowNoGLError(gl, "texSubImage2D with cross-origin image should throw exception.",
+      function(){gl.texSubImage2D(gl.TEXTURE_2D, 0, 0,0, gl.RGBA, gl.UNSIGNED_BYTE, img);});
+    assertThrowNoGLError(gl, "texImage2D with dirty origin canvas should throw exception.",
+      function(){gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, c);});
+    assertThrowNoGLError(gl, "texSubImage2D with dirty origin canvas should throw exception.",
+      function(){gl.texSubImage2D(gl.TEXTURE_2D, 0, 0,0, gl.RGBA, gl.UNSIGNED_BYTE, c);});
 }
 
 Tests.endUnit = function(gl) {
 }
 
 </script>
 <script id="identity-flip-vert" type="x-shader/x-vertex">
 attribute vec3 Vertex;
@@ -135,27 +139,26 @@ attribute vec2 Tex;
 varying vec4 texCoord0;
 void main()
 {
     texCoord0 = vec4(1.0-Tex.s, Tex.t, 0.0, 0.0);
     gl_Position = vec4(Vertex, 1.0);
 }
 </script>
 <script id="identity-frag" type="x-shader/x-fragment">
-#ifdef GL_ES
-precision highp float;
-#endif
+precision mediump float;
+
 uniform sampler2D Texture;
 
 varying vec4 texCoord0;
 void main()
 {
     vec4 c = texture2D(Texture, texCoord0.st);
     gl_FragColor = c;
 }
 </script>
 </head><body>
 <canvas id="gl" width="256" height="256"></canvas>
 <canvas id="c" width="256" height="256"></canvas>
 <img id="i" width="256" height="256"  src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAATVElEQVR4nO3d+VPUd57Hcf2b9k9Y+z44+qK7OZoGFVA5VfBGzah9cxpNzGEOoRua5lBEue/DK4fZ7MapmSm3Mlshu8xOdCpDJt3v/aEBAUHAOMG4z0fV53fqU/V6fd7fT/e32bEDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwOvBkar7l+3+GwBsk8xUrT0rTb8vx2Q45janlu7YsWPnsgXgTeYwak85U3Xv5ZiM3+XbUh/l2dICBc6080WZ1ur92baSHRQB8GayGdUWu1HzoSNFO+ZM1f2cbTLM51lT5woc5rkDObbZ/Vm2SEm23VvsyjhV5nJQBsCbxGZQVtmN6p4Mo/YPdqNGHKlayUrXJ9zWlESh0xIvzsmYL3HZ54pzMm6VuRyRMpfTW+pyUAbAm8BmVNVnGNTTdqP6vzOMGrGnaMSZqpNsk17ybKlS6DTL/ixbotRlj5flOubL3I65MpfjVrnbEalYKINSl335vQGA3wKbUW2xGdWRDKP66wyjWhYLwJGiFWeaTrJNBnFbU2SP3ST7s6xSmmuXcrczUe52xstzHfPlbsdcudt5qyzX3lKWlxkszXGeK8mxnyzJySjeQRkArzebQVllM6p7bUb149UF4EjVSmaaTrLS9eKypMgee7ocyLZJmdshFXmZUpHnXFEGB/OzJsrdjqEyt/NmWa49XJbt9Ja6Mk4Vu7hEBF5LNr2q3mZQz9gM6u9XFEBqsgCcaTrJXJgEci0pstdhkv3ZNinNTZbAofwsOZSfJQfzMqU8z5kodzsSZbmOeIXb+XW52zFa5nLcKnPZI2ULl4jFfKIAvB7MOrXFZlBHbAb11zaj+kmGUbNuAWSm65dKYHdGmhRlWqQ8zyFHCn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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAICV/g9tPJEQu1XvmQAAAABJRU5ErkJggg==">
-<img id="i2" src="http://mochi.test:8888/tests/content/canvas/test/webgl/resources/thunderbird-logo-64x64.png">
+<img id="i2" src="http://example.com/tests/content/canvas/test/webgl/resources/thunderbird-logo-64x64.png">
 
 </body></html>
--- a/content/canvas/test/webgl/conformance/more/functions/texSubImage2DHTMLBadArgs.html
+++ b/content/canvas/test/webgl/conformance/more/functions/texSubImage2DHTMLBadArgs.html
@@ -1,11 +1,11 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
 <html><head>
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<meta charset="utf-8">
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 <script type="application/x-javascript" src="../util.js"></script>
 <script type="application/x-javascript">
 
 Tests.startUnit = function () {
   var canvas = document.getElementById('gl');
   var gl = wrapGLContext(canvas.getContext(GL_CONTEXT_ID));
--- a/content/canvas/test/webgl/conformance/more/functions/uniformMatrix.html
+++ b/content/canvas/test/webgl/conformance/more/functions/uniformMatrix.html
@@ -1,11 +1,11 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
 <html><head>
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<meta charset="utf-8">
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 <script type="application/x-javascript" src="../util.js"></script>
 <script type="application/x-javascript">
 
 Tests.startUnit = function () {
   var canvas = document.getElementById('gl');
   var gl = wrapGLContext(canvas.getContext(GL_CONTEXT_ID));
@@ -42,19 +42,17 @@ uniform mat3 bar3;
 varying vec4 texCoord0;
 void main()
 {
     texCoord0 = vec4(Tex.s, 1.0-Tex.t, bar[0][1]+bar3[2][1], 0.0);
     gl_Position = vec4(Vertex, 1.0);
 }
 </script>
 <script id="foobar-frag" type="x-shader/x-fragment">
-#ifdef GL_ES
-precision highp float;
-#endif
+precision mediump float;
 
 uniform mat4 foo;
 
 varying vec4 texCoord0;
 void main()
 {
     gl_FragColor = vec4(foo[0][0]/256.0, foo[1][1]/256.0, foo[2][2]/256.0, foo[3][3]*texCoord0.z/256.0);
 }
--- a/content/canvas/test/webgl/conformance/more/functions/uniformMatrixBadArgs.html
+++ b/content/canvas/test/webgl/conformance/more/functions/uniformMatrixBadArgs.html
@@ -1,11 +1,11 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
 <html><head>
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<meta charset="utf-8">
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 <script type="application/x-javascript" src="../util.js"></script>
 <script type="application/x-javascript">
 
 Tests.startUnit = function () {
   var canvas = document.getElementById('gl');
   var unwrappedGL = canvas.getContext(GL_CONTEXT_ID);
@@ -116,19 +116,17 @@ void main()
 {
     texCoord0 = vec4(Tex.s, 1.0-Tex.t, fm2[0][1]+fm3[2][1], 0.0);
     float d = am2[0][1][1] + am3[0][2][2] + am4[0][3][3] +
               am2[1][1][1] + am3[1][2][2] + am4[1][3][3];
     gl_Position = vec4(Vertex, 1.0 + d * 0.0001);
 }
 </script>
 <script id="foobar-frag" type="x-shader/x-fragment">
-#ifdef GL_ES
-precision highp float;
-#endif
+precision mediump float;
 
 uniform mat4 fm4;
 
 varying vec4 texCoord0;
 void main()
 {
     gl_FragColor = vec4(fm4[0][0]/256.0, fm4[1][1]/256.0, fm4[2][2]/256.0, fm4[3][3]*texCoord0.z/256.0);
 }
--- a/content/canvas/test/webgl/conformance/more/functions/uniformf.html
+++ b/content/canvas/test/webgl/conformance/more/functions/uniformf.html
@@ -1,11 +1,11 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
 <html><head>
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<meta charset="utf-8">
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 <script type="application/x-javascript" src="../util.js"></script>
 <script type="application/x-javascript">
 
 Tests.startUnit = function () {
   var canvas = document.getElementById('gl');
   var gl = wrapGLContext(canvas.getContext(GL_CONTEXT_ID));
@@ -47,19 +47,18 @@ uniform float bar;
 varying vec4 texCoord0;
 void main()
 {
     texCoord0 = vec4(Tex.s, 1.0-Tex.t, bar, 0.0);
     gl_Position = vec4(Vertex, 1.0);
 }
 </script>
 <script id="foobar-frag" type="x-shader/x-fragment">
-#ifdef GL_ES
-precision highp float;
-#endif
+precision mediump float;
+
 uniform vec4 foo;
 
 varying vec4 texCoord0;
 void main()
 {
     gl_FragColor = vec4(foo.r/256.0, foo.g/256.0, foo.b/256.0, foo.a*texCoord0.z/256.0);
 }
 </script>
--- a/content/canvas/test/webgl/conformance/more/functions/uniformfArrayLen1.html
+++ b/content/canvas/test/webgl/conformance/more/functions/uniformfArrayLen1.html
@@ -1,11 +1,11 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
 <html><head>
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<meta charset="utf-8">
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 <script type="application/x-javascript" src="../util.js"></script>
 <script type="application/x-javascript">
 
 Tests.startUnit = function () {
   var canvas = document.getElementById('gl');
   var gl = wrapGLContext(canvas.getContext(GL_CONTEXT_ID));
@@ -69,19 +69,18 @@ uniform float uniFloat[1];
 varying vec4 texCoord0;
 void main()
 {
     texCoord0 = vec4(Tex.s, 1.0-Tex.t, uniFloat[0], 0.0);
     gl_Position = vec4(Vertex, 1.0);
 }
 </script>
 <script id="foobar-frag" type="x-shader/x-fragment">
-#ifdef GL_ES
-precision highp float;
-#endif
+precision mediump float;
+
 uniform vec4 uniV4[1];
 
 varying vec4 texCoord0;
 void main()
 {
     gl_FragColor = vec4(
         uniV4[0].r/256.0,
         uniV4[0].g/256.0,
--- a/content/canvas/test/webgl/conformance/more/functions/uniformfBadArgs.html
+++ b/content/canvas/test/webgl/conformance/more/functions/uniformfBadArgs.html
@@ -1,11 +1,11 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
 <html><head>
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<meta charset="utf-8">
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 <script type="application/x-javascript" src="../util.js"></script>
 <script type="application/x-javascript">
 
 Tests.startUnit = function () {
   var canvas = document.getElementById('gl');
   var gl = wrapGLContext(canvas.getContext(GL_CONTEXT_ID));
@@ -74,19 +74,18 @@ uniform float uniFloat;
 varying vec4 texCoord0;
 void main()
 {
     texCoord0 = vec4(Tex.s, 1.0-Tex.t, uniFloat, 0.0);
     gl_Position = vec4(Vertex, 1.0);
 }
 </script>
 <script id="foobar-frag" type="x-shader/x-fragment">
-#ifdef GL_ES
-precision highp float;
-#endif
+precision mediump float;
+
 uniform vec4 uniV4;
 
 varying vec4 texCoord0;
 void main()
 {
     gl_FragColor = vec4(
         uniV4.r/256.0,
         uniV4.g/256.0,
--- a/content/canvas/test/webgl/conformance/more/functions/uniformi.html
+++ b/content/canvas/test/webgl/conformance/more/functions/uniformi.html
@@ -1,11 +1,11 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
 <html><head>
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<meta charset="utf-8">
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 <script type="application/x-javascript" src="../util.js"></script>
 <script type="application/x-javascript">
 
 Tests.startUnit = function () {
   var canvas = document.getElementById('gl');
   var gl = wrapGLContext(canvas.getContext(GL_CONTEXT_ID));
@@ -47,19 +47,18 @@ uniform int bar;
 varying vec4 texCoord0;
 void main()
 {
     texCoord0 = vec4(Tex.s, 1.0-Tex.t, float(bar), 0.0);
     gl_Position = vec4(Vertex, 1.0);
 }
 </script>
 <script id="foobar-frag" type="x-shader/x-fragment">
-#ifdef GL_ES
-precision highp float;
-#endif
+precision mediump float;
+
 uniform ivec4 foo;
 
 varying vec4 texCoord0;
 void main()
 {
     gl_FragColor = vec4(float(foo.r)/256.0, float(foo.g)/256.0, float(foo.b)/256.0, float(foo.a)*texCoord0.z/256.0);
 }
 </script>
--- a/content/canvas/test/webgl/conformance/more/functions/uniformiBadArgs.html
+++ b/content/canvas/test/webgl/conformance/more/functions/uniformiBadArgs.html
@@ -1,11 +1,11 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
 <html><head>
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<meta charset="utf-8">
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 <script type="application/x-javascript" src="../util.js"></script>
 <script type="application/x-javascript">
 
 Tests.startUnit = function () {
   var canvas = document.getElementById('gl');
   var gl = wrapGLContext(canvas.getContext(GL_CONTEXT_ID));
@@ -70,19 +70,17 @@ uniform int uniInt;
 varying vec4 texCoord0;
 void main()
 {
     texCoord0 = vec4(Tex.s, 1.0-Tex.t, float(uniInt), 0.0);
     gl_Position = vec4(Vertex, 1.0);
 }
 </script>
 <script id="foobar-frag" type="x-shader/x-fragment">
-#ifdef GL_ES
-precision highp float;
-#endif
+precision mediump float;
 
 uniform ivec4 uniIV4;
 
 varying vec4 texCoord0;
 void main()
 {
     gl_FragColor = vec4(
         float(uniIV4.x)/256.0,
--- a/content/canvas/test/webgl/conformance/more/functions/vertexAttrib.html
+++ b/content/canvas/test/webgl/conformance/more/functions/vertexAttrib.html
@@ -1,14 +1,15 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
 <html><head>
+<meta charset="utf-8">
 <!--
 Tests for the OpenGL ES 2.0 HTML Canvas context
 
-Copyright (C) 2009  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
+Copyright (C) 2011  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
 
 Permission is hereby granted, free of charge, to any person
 obtaining a copy of this software and associated documentation
 files (the "Software"), to deal in the Software without
 restriction, including without limitation the rights to use,
 copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the
 Software is furnished to do so, subject to the following
@@ -22,17 +23,16 @@ EXPRESS OR IMPLIED, INCLUDING BUT NOT LI
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 OTHER DEALINGS IN THE SOFTWARE.
 
 -->
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 <script type="application/x-javascript" src="../util.js"></script>
 <script type="application/x-javascript">
 
 var verts = [0.0, 0.0, 0.0,   1.0, 0.0, 0.0,   0.0, 1.0, 0.0];
 var normals = [0.0, 0.0, 1.0,   0.0, 0.0, 1.0,   0.0, 0.0, 1.0];
 var texcoords = [0.0,0.0,  1.0,0.0,  0.0,1.0];
@@ -120,19 +120,18 @@ Tests.testVertexAttribVBO = function(gl,
   varying vec4 texCoord0;
   void main()
   {
     gl_Position = vec4(Vertex * Normal, 1.0);
     texCoord0 = vec4(Tex,0.0,0.0) + gl_Position;
   }
 </script>
 <script id="frag" type="x-shader/x-fragment">
-  #ifdef GL_ES
-  precision highp float;
-  #endif
+  precision mediump float;
+
   varying vec4 texCoord0;
   void main()
   {
     vec4 c = texCoord0;
     gl_FragColor = c;
   }
 </script>
 
--- a/content/canvas/test/webgl/conformance/more/functions/vertexAttribBadArgs.html
+++ b/content/canvas/test/webgl/conformance/more/functions/vertexAttribBadArgs.html
@@ -1,14 +1,15 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
 <html><head>
+<meta charset="utf-8">
 <!--
 Tests for the OpenGL ES 2.0 HTML Canvas context
 
-Copyright (C) 2009  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
+Copyright (C) 2011  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
 
 Permission is hereby granted, free of charge, to any person
 obtaining a copy of this software and associated documentation
 files (the "Software"), to deal in the Software without
 restriction, including without limitation the rights to use,
 copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the
 Software is furnished to do so, subject to the following
@@ -22,17 +23,16 @@ EXPRESS OR IMPLIED, INCLUDING BUT NOT LI
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 OTHER DEALINGS IN THE SOFTWARE.
 
 -->
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 <script type="application/x-javascript" src="../util.js"></script>
 <script type="application/x-javascript">
 
 var verts = [0.0, 0.0, 0.0,   1.0, 0.0, 0.0,   0.0, 1.0, 0.0];
 var normals = [0.0, 0.0, 1.0,   0.0, 0.0, 1.0,   0.0, 0.0, 1.0];
 var texcoords = [0.0,0.0,  1.0,0.0,  0.0,1.0];
@@ -96,19 +96,18 @@ Tests.testVertexAttrib = function(gl, pr
   varying vec4 texCoord0;
   void main()
   {
     gl_Position = vec4(Vertex * Normal, 1.0);
     texCoord0 = vec4(Tex,0.0,0.0) + gl_Position;
   }
 </script>
 <script id="frag" type="x-shader/x-fragment">
-  #ifdef GL_ES
-precision highp float;
-#endif
+  precision mediump float;
+
   varying vec4 texCoord0;
   void main()
   {
     vec4 c = texCoord0;
     gl_FragColor = c;
   }
 </script>
 
--- a/content/canvas/test/webgl/conformance/more/functions/vertexAttribPointer.html
+++ b/content/canvas/test/webgl/conformance/more/functions/vertexAttribPointer.html
@@ -1,14 +1,15 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
 <html><head>
+<meta charset="utf-8">
 <!--
 Tests for the OpenGL ES 2.0 HTML Canvas context
 
-Copyright (C) 2009  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
+Copyright (C) 2011  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
 
 Permission is hereby granted, free of charge, to any person
 obtaining a copy of this software and associated documentation
 files (the "Software"), to deal in the Software without
 restriction, including without limitation the rights to use,
 copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the
 Software is furnished to do so, subject to the following
@@ -22,17 +23,16 @@ EXPRESS OR IMPLIED, INCLUDING BUT NOT LI
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 OTHER DEALINGS IN THE SOFTWARE.
 
 -->
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 <script type="application/x-javascript" src="../util.js"></script>
 <script type="application/x-javascript">
 
 var verts = [0.0, 0.0, 0.0,   1.0, 0.0, 0.0,   0.0, 1.0, 0.0];
 var normals = [0.0, 0.0, 1.0,   0.0, 0.0, 1.0,   0.0, 0.0, 1.0];
 var texcoords = [0.0,0.0,  1.0,0.0,  0.0,1.0];
@@ -84,19 +84,18 @@ Tests.testVertexAttribPointerVBO = funct
   varying vec4 texCoord0;
   void main()
   {
     gl_Position = vec4(Vertex * Normal, 1.0);
     texCoord0 = vec4(Tex,0.0,0.0) + gl_Position;
   }
 </script>
 <script id="frag" type="x-shader/x-fragment">
-  #ifdef GL_ES
-  precision highp float;
-  #endif
+  precision mediump float;
+
   varying vec4 texCoord0;
   void main()
   {
     vec4 c = texCoord0;
     gl_FragColor = c;
   }
 </script>
 
--- a/content/canvas/test/webgl/conformance/more/functions/vertexAttribPointerBadArgs.html
+++ b/content/canvas/test/webgl/conformance/more/functions/vertexAttribPointerBadArgs.html
@@ -1,14 +1,15 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
 <html><head>
+<meta charset="utf-8">
 <!--
 Tests for the OpenGL ES 2.0 HTML Canvas context
 
-Copyright (C) 2009  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
+Copyright (C) 2011  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
 
 Permission is hereby granted, free of charge, to any person
 obtaining a copy of this software and associated documentation
 files (the "Software"), to deal in the Software without
 restriction, including without limitation the rights to use,
 copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the
 Software is furnished to do so, subject to the following
@@ -22,17 +23,16 @@ EXPRESS OR IMPLIED, INCLUDING BUT NOT LI
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 OTHER DEALINGS IN THE SOFTWARE.
 
 -->
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 <script type="application/x-javascript" src="../util.js"></script>
 <script type="application/x-javascript">
 
 var verts = [0.0, 0.0, 0.0,   1.0, 0.0, 0.0,   0.0, 1.0, 0.0];
 var normals = [0.0, 0.0, 1.0,   0.0, 0.0, 1.0,   0.0, 0.0, 1.0];
 var texcoords = [0.0,0.0,  1.0,0.0,  0.0,1.0];
@@ -109,19 +109,18 @@ Tests.testVertexAttribPointerVBO = funct
   varying vec4 texCoord0;
   void main()
   {
     gl_Position = vec4(Vertex * Normal, 1.0);
     texCoord0 = vec4(Tex,0.0,0.0) + gl_Position;
   }
 </script>
 <script id="frag" type="x-shader/x-fragment">
-  #ifdef GL_ES
-  precision highp float;
-  #endif
+  precision mediump float;
+
   varying vec4 texCoord0;
   void main()
   {
     vec4 c = texCoord0;
     gl_FragColor = c;
   }
 </script>
 
--- a/content/canvas/test/webgl/conformance/more/glsl/arrayOutOfBounds.html
+++ b/content/canvas/test/webgl/conformance/more/glsl/arrayOutOfBounds.html
@@ -1,14 +1,15 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
 <html><head>
+<meta charset="utf-8">
 <!--
 Tests for the OpenGL ES 2.0 HTML Canvas context
 
-Copyright (C) 2009  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
+Copyright (C) 2011  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
 
 Permission is hereby granted, free of charge, to any person
 obtaining a copy of this software and associated documentation
 files (the "Software"), to deal in the Software without
 restriction, including without limitation the rights to use,
 copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the
 Software is furnished to do so, subject to the following
@@ -22,17 +23,16 @@ EXPRESS OR IMPLIED, INCLUDING BUT NOT LI
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 OTHER DEALINGS IN THE SOFTWARE.
 
 -->
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 <script type="application/x-javascript" src="../util.js"></script>
 <script type="application/x-javascript">
 
 Tests.startUnit = function () {
   var canvas = document.getElementById('gl');
   var gl = canvas.getContext(GL_CONTEXT_ID);
@@ -164,91 +164,86 @@ arr.forEach(function(e){
     TexCoord = Tex;
     gl_Position = vec4(Vertex, 0.0);
   }
 </script>
 
 <script id="okfrag" type="x-shader/x-fragment">
 
 
-  #ifdef GL_ES
-precision highp float;
-#endif
+  precision mediump float;
+
   varying vec2 TexCoord;
 
   void main()
   {
     float x[3];
     x[0] = 1.0;
     x[1] = 2.0;
     x[2] = 3.0;
     gl_FragColor = vec4(1.0, 0.0, TexCoord.s, x[2]);
   }
 </script>
 <script id="crfrag" type="x-shader/x-fragment">
 
 
-  #ifdef GL_ES
-precision highp float;
-#endif
+  precision mediump float;
+
   varying vec2 TexCoord;
 
   void main()
   {
     float x[3];
     x[0] = 1.0;
     x[1] = 2.0;
     x[2] = 3.0;
     gl_FragColor = vec4(1.0, 0.0, TexCoord.s, x[4]);
   }
 </script>
 <script id="cwfrag" type="x-shader/x-fragment">
 
 
-  #ifdef GL_ES
-precision highp float;
-#endif
+  precision mediump float;
+
   varying vec2 TexCoord;
 
   void main()
   {
     float x[3];
     x[0] = 1.0;
     x[1] = 2.0;
     x[2] = 3.0;
 
     x[4] = 6.0;
     gl_FragColor = vec4(1.0, 0.0, TexCoord.s, x[4]);
   }
 </script>
 <script id="vrfrag" type="x-shader/x-fragment">
 
 
-  #ifdef GL_ES
-precision highp float;
-#endif
+  precision mediump float;
+
   varying vec2 TexCoord;
 
   void main()
   {
     float x[3];
     x[0] = 1.0;
     x[1] = 2.0;
     x[2] = 3.0;
 
     int idx = 4 * int(max(1.0, TexCoord.x*20.0));
     gl_FragColor = vec4(1.0, 0.0, TexCoord.s, x[idx]);
   }
 </script>
 <script id="vwfrag" type="x-shader/x-fragment">
 
 
-  #ifdef GL_ES
-precision highp float;
-#endif
+  precision mediump float;
+
   varying vec2 TexCoord;
 
   void main()
   {
     float x[3];
     x[0] = 1.0;
     x[1] = 2.0;
     x[2] = 3.0;
@@ -256,19 +251,18 @@ precision highp float;
     int idx = 4 * int(max(1.0, TexCoord.x*20.0));
     x[idx] = 6.0;
     gl_FragColor = vec4(1.0, 0.0, TexCoord.s, x[idx]);
   }
 </script>
 <script id="frag" type="x-shader/x-fragment">
 
 
-  #ifdef GL_ES
-precision highp float;
-#endif
+  precision mediump float;
+
   varying vec2 TexCoord;
 
   void main()
   {
     gl_FragColor = vec4(1.0, 0.0, TexCoord.s, 1.0);
   }
 </script>
 
--- a/content/canvas/test/webgl/conformance/more/glsl/longLoops.html
+++ b/content/canvas/test/webgl/conformance/more/glsl/longLoops.html
@@ -1,14 +1,15 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
 <html><head>
+<meta charset="utf-8">
 <!--
 Tests for the OpenGL ES 2.0 HTML Canvas context
 
-Copyright (C) 2009  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
+Copyright (C) 2011  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
 
 Permission is hereby granted, free of charge, to any person
 obtaining a copy of this software and associated documentation
 files (the "Software"), to deal in the Software without
 restriction, including without limitation the rights to use,
 copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the
 Software is furnished to do so, subject to the following
@@ -22,17 +23,16 @@ EXPRESS OR IMPLIED, INCLUDING BUT NOT LI
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 OTHER DEALINGS IN THE SOFTWARE.
 
 -->
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 <script type="application/x-javascript" src="../util.js"></script>
 <script type="application/x-javascript">
 
 Tests.startUnit = function () {
   var canvas = document.getElementById('gl');
   var gl = canvas.getContext(GL_CONTEXT_ID);
@@ -82,19 +82,17 @@ Tests.testMandelbrot = function(gl) {
   varying vec2 texCoord0;
   void main()
   {
     texCoord0 = vec2(Tex.s, Tex.t);
     gl_Position = vec4(Vertex, 1.0);
   }
 </script>
 <script id="mandelbrot-frag" type="x-shader/x-fragment">
-    #ifdef GL_ES
-precision highp float;
-#endif
+    precision mediump float;
 
     uniform float x,y,z;
     varying vec2 texCoord0;
     vec4 iter_z(float cr, float ci) {
         int i;
         float nzr, nzi, zr = 0.0, zi = 0.0;
         vec4 color = vec4(0.0);
         for (i=0; i<2500; i++) {
@@ -179,78 +177,73 @@ precision highp float;
         TexCoord = Tex.st;
         gl_Position = vec4(Vertex, 0.0);
     }
 </script>
 
 <script id="whiletruefrag" type="x-shader/x-fragment">
 
 
-    #ifdef GL_ES
-precision highp float;
-#endif
+    precision mediump float;
+
     varying vec2 TexCoord;
     void main()
     {
         float z = 1.0;
         while(true) { z += 0.1; z *= 0.995; }
         gl_FragColor = vec4(1.0, TexCoord.s, TexCoord.t, z);
     }
 </script>
 <script id="loop100Mfrag" type="x-shader/x-fragment">
 
 
-    #ifdef GL_ES
-precision highp float;
-#endif
+    precision mediump float;
+
     varying vec2 TexCoord;
     void main()
     {
         int i;
         float z = 1.0;
         for (i = 0; i<1000000000; i++) {
             z += 0.1; z *= 0.995;
         }
         gl_FragColor = vec4(1.0, TexCoord.s, TexCoord.t, z);
     }
 </script>
 <script id="loopCompfrag" type="x-shader/x-fragment">
 
 
-    #ifdef GL_ES
-precision highp float;
-#endif
+    precision mediump float;
+
     varying vec2 TexCoord;
     void main()
     {
         float z = TexCoord.s;
         while(z > 0.0) { z += 0.1; z *= 0.995; }
         gl_FragColor = vec4(1.0, TexCoord.s, TexCoord.t, z);
     }
 </script>
 <script id="variablefrag" type="x-shader/x-fragment">
 
 
-    #ifdef GL_ES
-precision highp float;
-#endif
+    precision mediump float;
+
     varying vec2 TexCoord;
     void main()
     {
         float z = 1.0;
         while(z > TexCoord.s) { z += 0.1; z *= 0.995; }
         gl_FragColor = vec4(1.0, TexCoord.s, TexCoord.t, z);
     }
 </script>
 <script id="frag" type="x-shader/x-fragment">
 
 
-  #ifdef GL_ES
-precision highp float;
-#endif
+  precision mediump float;
+
   varying vec2 TexCoord;
   void main()
   {
     gl_FragColor = vec4(1.0, TexCoord.s, TexCoord.t, 1.0);
   }
 </script>
 
 
--- a/content/canvas/test/webgl/conformance/more/glsl/uniformOutOfBounds.html
+++ b/content/canvas/test/webgl/conformance/more/glsl/uniformOutOfBounds.html
@@ -1,14 +1,15 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
 <html><head>
+<meta charset="utf-8">
 <!--
 Tests for the OpenGL ES 2.0 HTML Canvas context
 
-Copyright (C) 2009  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
+Copyright (C) 2011  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
 
 Permission is hereby granted, free of charge, to any person
 obtaining a copy of this software and associated documentation
 files (the "Software"), to deal in the Software without
 restriction, including without limitation the rights to use,
 copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the
 Software is furnished to do so, subject to the following
@@ -22,17 +23,16 @@ EXPRESS OR IMPLIED, INCLUDING BUT NOT LI
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 OTHER DEALINGS IN THE SOFTWARE.
 
 -->
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 <script type="application/x-javascript" src="../util.js"></script>
 <script type="application/x-javascript">
 
 Tests.startUnit = function () {
   var canvas = document.getElementById('gl');
   var gl = canvas.getContext(GL_CONTEXT_ID);
@@ -126,95 +126,89 @@ arr.forEach(function(e){
     TexCoord = Vertex.st;
     gl_Position = vec4(Vertex, Tex.s);
   }
 </script>
 
 <script id="crfrag" type="x-shader/x-fragment">
 
 
-  #ifdef GL_ES
-precision highp float;
-#endif
+  precision mediump float;
+
   uniform float x[3];
 
   varying vec2 TexCoord;
   void main()
   {
     gl_FragColor = vec4(1.0, 0.0, 0.0, x[4]);
   }
 </script>
 <script id="cwfrag" type="x-shader/x-fragment">
 
 
-  #ifdef GL_ES
-precision highp float;
-#endif
+  precision mediump float;
+
   uniform float x[3];
 
   varying vec2 TexCoord;
   void main()
   {
     x[4] = 6.0;
     gl_FragColor = vec4(1.0, 0.0, 0.0, x[4]);
   }
 </script>
 <script id="vrfrag" type="x-shader/x-fragment">
 
 
-  #ifdef GL_ES
-precision highp float;
-#endif
+  precision mediump float;
+
   uniform float x[3];
 
   varying vec2 TexCoord;
   void main()
   {
     int idx = 4 * int(max(1.0, TexCoord.s*20.0));
     gl_FragColor = vec4(1.0, 0.0, 0.0, x[idx]);
   }
 </script>
 <script id="vwfrag" type="x-shader/x-fragment">
 
 
-  #ifdef GL_ES
-precision highp float;
-#endif
+  precision mediump float;
+
   uniform float x[3];
 
   varying vec2 TexCoord;
   void main()
   {
     int idx = 4 * int(max(1.0, TexCoord.s*20.0));
     x[idx] = 6.0;
     gl_FragColor = vec4(1.0, 0.0, 0.0, x[idx]);
   }
 </script>
 <script id="tvwfrag" type="x-shader/x-fragment">
 
 
-  #ifdef GL_ES
-precision highp float;
-#endif
+  precision mediump float;
+
   uniform float x[3];
 
   varying vec2 TexCoord;
   void main()
   {
     int idx = 4 * int(max(1.0, TexCoord.s*20.0));
     x[2] = TexCoord[idx];
     gl_FragColor = vec4(1.0, 0.0, 0.0, x[2]);
   }
 </script>
 <script id="frag" type="x-shader/x-fragment">
 
 
-  #ifdef GL_ES
-precision highp float;
-#endif
+  precision mediump float;
+
   void main()
   {
     gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
   }
 </script>
 
 
 <style>canvas{ position:absolute; }</style>
--- a/content/canvas/test/webgl/conformance/more/glsl/unusedAttribsUniforms.html
+++ b/content/canvas/test/webgl/conformance/more/glsl/unusedAttribsUniforms.html
@@ -1,14 +1,15 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
 <html><head>
+<meta charset="utf-8">
 <!--
 Tests for the OpenGL ES 2.0 HTML Canvas context
 
-Copyright (C) 2009  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
+Copyright (C) 2011  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
 
 Permission is hereby granted, free of charge, to any person
 obtaining a copy of this software and associated documentation
 files (the "Software"), to deal in the Software without
 restriction, including without limitation the rights to use,
 copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the
 Software is furnished to do so, subject to the following
@@ -22,17 +23,16 @@ EXPRESS OR IMPLIED, INCLUDING BUT NOT LI
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 OTHER DEALINGS IN THE SOFTWARE.
 
 -->
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 <script type="application/x-javascript" src="../util.js"></script>
 <script type="application/x-javascript">
 
 Tests.autorun = false;
 Tests.message = "Caution: may crash the browser";
 
@@ -69,19 +69,18 @@ Tests.testPassingTooManyUniforms = funct
     TexCoord = Vertex.st;
     gl_Position = vec4(Vertex, 0.0);
   }
 </script>
 
 <script id="frag" type="x-shader/x-fragment">
 
 
-  #ifdef GL_ES
-precision highp float;
-#endif
+  precision mediump float;
+
   void main()
   {
     gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
   }
 </script>
 <script id="vert2" type="x-shader/x-vertex">
 
 
@@ -93,19 +92,18 @@ precision highp float;
     TexCoord = Tex.st;
     gl_Position = vec4(Vertex, bar);
   }
 </script>
 
 <script id="frag2" type="x-shader/x-fragment">
 
 
-  #ifdef GL_ES
-precision highp float;
-#endif
+  precision mediump float;
+
   uniform float baz;
 
   varying vec2 TexCoord;
   void main()
   {
     gl_FragColor = vec4(1.0, TexCoord.s, 0.0, 1.0);
   }
 </script>
--- a/content/canvas/test/webgl/conformance/more/index.html
+++ b/content/canvas/test/webgl/conformance/more/index.html
@@ -1,10 +1,11 @@
 <html>
   <head>
+<meta charset="utf-8">
     <title>WebGL tests</title>
   </head>
   <body>
     
     <h1>Tests for the WebGL canvas context</h1>
     
     <h2>These tests are intended to serve the following purposes:</h2>
     <ul>
--- a/content/canvas/test/webgl/conformance/more/performance/CPUvsGPU.html
+++ b/content/canvas/test/webgl/conformance/more/performance/CPUvsGPU.html
@@ -1,14 +1,15 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
 <html><head>
+<meta charset="utf-8">
 <!--
 Tests for the OpenGL ES 2.0 HTML Canvas context
 
-Copyright (C) 2009  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
+Copyright (C) 2011  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
 
 Permission is hereby granted, free of charge, to any person
 obtaining a copy of this software and associated documentation
 files (the "Software"), to deal in the Software without
 restriction, including without limitation the rights to use,
 copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the
 Software is furnished to do so, subject to the following
@@ -23,17 +24,16 @@ OF MERCHANTABILITY, FITNESS FOR A PARTIC
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 OTHER DEALINGS IN THE SOFTWARE.
 
 -->
 
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 <script type="application/x-javascript" src="../util.js"></script>
 <script type="application/x-javascript">
 
 Tests.autorun = false;
 Tests.message = "This might take a few seconds to run"
 
@@ -292,32 +292,30 @@ Tests.gpuGaussianBlur = function(gl) {
   void main()
   {
     texCoord0 = vec4(Tex.s, 1.0-Tex.t, 0.0, 0.0);
     gl_Position = vec4(Vertex, 1.0);
   }
 </script>
 <script id="identity-frag" type="x-shader/x-fragment">
 
-  #ifdef GL_ES
-precision highp float;
-#endif
+  precision mediump float;
+
   uniform sampler2D Texture;
 
   varying vec4 texCoord0;
   void main()
   {
     gl_FragColor = texture2D(Texture, texCoord0.st);
   }
 </script>
 <script id="hblur-frag" type="x-shader/x-fragment">
 
-  #ifdef GL_ES
-precision highp float;
-#endif
+  precision mediump float;
+
   uniform sampler2D Texture;
   uniform float width;
 
   varying vec4 texCoord0;
   void main()
   {
     float kernel[7] = float[7](0.006, 0.061, 0.242, 0.383, 0.242, 0.061, 0.006);
     int i;
@@ -327,19 +325,18 @@ precision highp float;
       vec4 tmp = texture2D(Texture, texCoord0.st + vec2(float(i)*step, 0.0));
       sum = (tmp * kernel[i+3]) + sum;
     }
     gl_FragColor = sum;
   }
 </script>
 <script id="vblur-frag" type="x-shader/x-fragment">
 
-  #ifdef GL_ES
-precision highp float;
-#endif
+  precision mediump float;
+
   uniform sampler2D Texture;
   uniform float height;
 
   varying vec4 texCoord0;
   void main()
   {
     float kernel[7] = float[7](0.006, 0.061, 0.242, 0.383, 0.242, 0.061, 0.006);
     int i;
--- a/content/canvas/test/webgl/conformance/more/performance/bandwidth.html
+++ b/content/canvas/test/webgl/conformance/more/performance/bandwidth.html
@@ -1,14 +1,15 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
 <html><head>
+<meta charset="utf-8">
 <!--
 Tests for the OpenGL ES 2.0 HTML Canvas context
 
-Copyright (C) 2009  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
+Copyright (C) 2011  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
 
 Permission is hereby granted, free of charge, to any person
 obtaining a copy of this software and associated documentation
 files (the "Software"), to deal in the Software without
 restriction, including without limitation the rights to use,
 copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the
 Software is furnished to do so, subject to the following
@@ -23,17 +24,16 @@ OF MERCHANTABILITY, FITNESS FOR A PARTIC
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 OTHER DEALINGS IN THE SOFTWARE.
 
 -->
 
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 <script type="application/x-javascript" src="../util.js"></script>
 <script type="application/x-javascript">
 
 Tests.autorun = false;
 Tests.message = "This might take a second or two. Take the upload numbers with a dose of salt, as there's no drawing code using the data.";
 
@@ -163,19 +163,18 @@ Tests.endUnit = function(gl) {
   attribute vec4 Vertex;
   void main()
   {
     gl_Position = Vertex;
   }
 </script>
 <script id="frag-v" type="x-shader/x-fragment">
 
-  #ifdef GL_ES
-precision highp float;
-#endif
+  precision mediump float;
+
   void main()
   {
     gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
   }
 </script>
 <script id="vert-t" type="x-shader/x-vertex">
 
 
@@ -185,19 +184,18 @@ precision highp float;
   void main()
   {
     gl_Position = vec4(Vertex, 1.0);
     texCoord0 = Tex;
   }
 </script>
 <script id="frag-t" type="x-shader/x-fragment">
 
-  #ifdef GL_ES
-precision highp float;
-#endif
+  precision mediump float;
+
   uniform sampler2D Texture;
 
   varying vec2 texCoord0;
   void main()
   {
     gl_FragColor = texture2D(Texture, texCoord0);
   }
 </script>
--- a/content/canvas/test/webgl/conformance/more/performance/jsGCPause.html
+++ b/content/canvas/test/webgl/conformance/more/performance/jsGCPause.html
@@ -1,11 +1,11 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
 <html><head>
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<meta charset="utf-8">
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 <script type="application/x-javascript" src="../util.js"></script>
 <script type="application/x-javascript">
 
 Tests.autorun = false;
 
 Tests.testInterval = function() {
--- a/content/canvas/test/webgl/conformance/more/performance/jsMatrixMult.html
+++ b/content/canvas/test/webgl/conformance/more/performance/jsMatrixMult.html
@@ -1,11 +1,11 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
 <html><head>
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<meta charset="utf-8">
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 <script type="application/x-javascript" src="../util.js"></script>
 <script type="application/x-javascript">
 
 Tests.autorun = false;
 Tests.message = "This might take a second or two (or ten)";
 
--- a/content/canvas/test/webgl/conformance/more/performance/jsToGLOverhead.html
+++ b/content/canvas/test/webgl/conformance/more/performance/jsToGLOverhead.html
@@ -1,11 +1,11 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
 <html><head>
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<meta charset="utf-8">
 <link rel="stylesheet" type="text/css" href="../unit.css" />
 <script type="application/x-javascript" src="../unit.js"></script>
 <script type="application/x-javascript" src="../util.js"></script>
 <script type="application/x-javascript">
 
 Tests.autorun = false;
 Tests.message = "This might take a second or two";
 
--- a/content/canvas/test/webgl/conformance/more/unit.js
+++ b/content/canvas/test/webgl/conformance/more/unit.js
@@ -1,12 +1,12 @@
 /*
 Unit testing library for the OpenGL ES 2.0 HTML Canvas context
 
-Copyright (C) 2009  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
+Copyright (C) 2011  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
 
 Permission is hereby granted, free of charge, to any person
 obtaining a copy of this software and associated documentation
 files (the "Software"), to deal in the Software without
 restriction, including without limitation the rights to use,
 copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the
 Software is furnished to do so, subject to the following
--- a/content/canvas/test/webgl/conformance/more/util.js
+++ b/content/canvas/test/webgl/conformance/more/util.js
@@ -1,12 +1,12 @@
 /*
 Utilities for the OpenGL ES 2.0 HTML Canvas context
 
-Copyright (C) 2009  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
+Copyright (C) 2011  Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
 
 Permission is hereby granted, free of charge, to any person
 obtaining a copy of this software and associated documentation
 files (the "Software"), to deal in the Software without
 restriction, including without limitation the rights to use,
 copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the
 Software is furnished to do so, subject to the following
--- a/content/canvas/test/webgl/conformance/null-object-behaviour.html
+++ b/content/canvas/test/webgl/conformance/null-object-behaviour.html
@@ -1,10 +1,10 @@
 <!--
-Copyright (C) 2009 Apple Computer, Inc.  All rights reserved.
+Copyright (C) 2011 Apple Computer, Inc.  All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions
 are met:
 1. Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
 2. Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
@@ -17,18 +17,20 @@ PURPOSE ARE DISCLAIMED.  IN NO EVENT SHA
 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 -->
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 <script src="resources/webgl-test-utils.js"></script>
 </head>
 <body>
 <div id="description"></div>
 <div id="console"></div>
--- a/content/canvas/test/webgl/conformance/null-uniform-location.html
+++ b/content/canvas/test/webgl/conformance/null-uniform-location.html
@@ -1,15 +1,17 @@
 <!--
-Copyright (c) 2010 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
  -->
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 </head>
 <body>
 <div id="description"></div>
 <div id="console"></div>
 
--- a/content/canvas/test/webgl/conformance/object-deletion-behaviour.html
+++ b/content/canvas/test/webgl/conformance/object-deletion-behaviour.html
@@ -1,15 +1,17 @@
 <!--
-Copyright (c) 2010 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
  -->
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 <script src="resources/webgl-test-utils.js"></script>
 </head>
 <body>
 <div id="description"></div>
 <div id="console"></div>
@@ -59,17 +61,18 @@ shouldGenerateGLError(gl, gl.NO_ERROR, "
 var tex = gl.createTexture();
 shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindTexture(gl.TEXTURE_2D, tex)");
 shouldBe("gl.getParameter(gl.TEXTURE_BINDING_2D)", "tex");
 shouldGenerateGLError(gl, gl.NO_ERROR, "gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex, 0)");
 shouldBe("gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)", "tex");
 shouldGenerateGLError(gl, gl.NO_ERROR, "gl.deleteTexture(tex)");
 // Deleting a texture bound to the currently-bound fbo is the same as
 // detaching the textue from fbo first, then delete the texture.
-shouldBeNull("gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)");
+shouldBe("gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE)", "gl.NONE");
+shouldGenerateGLError(gl, gl.INVALID_ENUM, "gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)");
 shouldBeFalse("gl.isTexture(tex)");
 shouldBeNull("gl.getParameter(gl.TEXTURE_BINDING_2D)");
 shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindTexture(gl.TEXTURE_2D, tex)");
 shouldBeNull("gl.getParameter(gl.TEXTURE_BINDING_2D)");
 
 var texCubeMap = gl.createTexture();
 shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindTexture(gl.TEXTURE_CUBE_MAP, texCubeMap)");
 shouldBe("gl.getParameter(gl.TEXTURE_BINDING_CUBE_MAP)", "texCubeMap");
@@ -85,17 +88,18 @@ debug("renderbuffer deletion");
 var rbo = gl.createRenderbuffer();
 shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindRenderbuffer(gl.RENDERBUFFER, rbo)");
 shouldBe("gl.getParameter(gl.RENDERBUFFER_BINDING)", "rbo");
 shouldGenerateGLError(gl, gl.NO_ERROR, "gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, rbo)");
 shouldBe("gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)", "rbo");
 shouldGenerateGLError(gl, gl.NO_ERROR, "gl.deleteRenderbuffer(rbo)");
 // Deleting a renderbuffer bound to the currently-bound fbo is the same as
 // detaching the renderbuffer from fbo first, then delete the renderbuffer.
-shouldBeNull("gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)");
+shouldBe("gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE)", "gl.NONE");
+shouldGenerateGLError(gl, gl.INVALID_ENUM, "gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)");
 shouldBeFalse("gl.isRenderbuffer(rbo)");
 shouldBeNull("gl.getParameter(gl.RENDERBUFFER_BINDING)");
 shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindRenderbuffer(gl.RENDERBUFFER, rbo)");
 shouldBeNull("gl.getParameter(gl.RENDERBUFFER_BINDING)");
 
 debug("");
 debug("buffer deletion");
 
--- a/content/canvas/test/webgl/conformance/oes-standard-derivatives.html
+++ b/content/canvas/test/webgl/conformance/oes-standard-derivatives.html
@@ -1,18 +1,17 @@
 <!--
 Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
  -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-  "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE html>
 <html>
 <head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<meta charset="utf-8">
 <title>WebGL OES_standard_derivatives Conformance Tests</title>
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/desktop-gl-constants.js" type="text/javascript"></script>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 <script src="resources/webgl-test-utils.js"></script>
 </head>
 <body>
@@ -65,17 +64,17 @@ attribute vec4 vPosition;
 varying vec4 position;
 void main() {
     position = vPosition;
     gl_Position = vPosition;
 }
 </script>
 <script id="outputFragmentShader" type="x-shader/x-fragment">
 #extension GL_OES_standard_derivatives : enable
-precision highp float;
+precision mediump float;
 varying vec4 position;
 void main() {
     float dzdx = dFdx(position.z);
     float dzdy = dFdy(position.z);
     float fw = fwidth(position.z);
     gl_FragColor = vec4(abs(dzdx), abs(dzdy), fw, 1.0);
 }
 </script>
@@ -353,24 +352,24 @@ function attemptToForceGC()
 }
 
 function runUniqueObjectTest()
 {
     debug("Testing that getExtension() returns the same object each time");
     gl.getExtension("OES_standard_derivatives").myProperty = 2;
     if (window.GCController) {
         window.GCController.collect();
+    } else if (window.opera && window.opera.collect) {
+        window.opera.collect();
     } else {
         attemptToForceGC();
     }
     shouldBe('gl.getExtension("OES_standard_derivatives").myProperty', '2');
 }
 
 
 debug("");
 successfullyParsed = true;
 </script>
 <script src="../resources/js-test-post.js"></script>
-<script>
-</script>
 
 </body>
 </html>
--- a/content/canvas/test/webgl/conformance/oes-texture-float.html
+++ b/content/canvas/test/webgl/conformance/oes-texture-float.html
@@ -1,18 +1,17 @@
 <!--
-Copyright (c) 2009 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
  -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-  "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE html>
 <html>
 <head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<meta charset="utf-8">
 <title>WebGL OES_texture_float Conformance Tests</title>
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/desktop-gl-constants.js" type="text/javascript"></script>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 <script src="resources/webgl-test-utils.js"></script>
 </head>
 <body>
@@ -79,21 +78,19 @@ if (!gl) {
   // First verify that allocation of floating-point textures fails if
   // the extension has not been enabled yet.
   runTextureCreationTest(testProgram, false);
 
   if (!gl.getExtension("OES_texture_float")) {
       testPassed("No OES_texture_float support -- this is legal");
   } else {
       testPassed("Successfully enabled OES_texture_float extension");
-      dump('XXXXXX ' + gl.getExtension("OES_texture_float") + '\n');
       runTextureCreationTest(testProgram, true);
       runRenderTargetTest(testProgram);
-      // this sub-test is currently failing, see discussion in bug 630672
-      // runUniqueObjectTest();
+      runUniqueObjectTest();
   }
 }
 
 // Needs to be global for shouldBe to see it.
 var pixels;
 
 function allocateTexture()
 {
@@ -205,24 +202,24 @@ function attemptToForceGC()
 }
 
 function runUniqueObjectTest()
 {
     debug("Testing that getExtension() returns the same object each time");
     gl.getExtension("OES_texture_float").myProperty = 2;
     if (window.GCController) {
         window.GCController.collect();
+    } else if (window.opera && window.opera.collect) {
+        window.opera.collect();
     } else {
         attemptToForceGC();
     }
     shouldBe('gl.getExtension("OES_texture_float").myProperty', '2');
 }
 
 
 debug("");
 successfullyParsed = true;
 </script>
 <script src="../resources/js-test-post.js"></script>
-<script>
-</script>
 
 </body>
 </html>
--- a/content/canvas/test/webgl/conformance/oes-vertex-array-object.html
+++ b/content/canvas/test/webgl/conformance/oes-vertex-array-object.html
@@ -1,18 +1,17 @@
 <!--
 Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
  -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-  "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE html>
 <html>
 <head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<meta charset="utf-8">
 <title>WebGL OES_vertex_array_object Conformance Tests</title>
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/desktop-gl-constants.js" type="text/javascript"></script>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 <script src="resources/webgl-test-utils.js"></script>
 </head>
 <body>
@@ -388,13 +387,11 @@ function runDrawTests() {
     ext.deleteVertexArrayOES(vao0);
     ext.deleteVertexArrayOES(vao1);
 }
 
 debug("");
 successfullyParsed = true;
 </script>
 <script src="../resources/js-test-post.js"></script>
-<script>
-</script>
 
 </body>
 </html>
--- a/content/canvas/test/webgl/conformance/origin-clean-conformance.html
+++ b/content/canvas/test/webgl/conformance/origin-clean-conformance.html
@@ -1,18 +1,17 @@
 <!--
-Copyright (c) 2009 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
 -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-  "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE html>
 <html>
 <head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<meta charset="utf-8">
 <title>WebGL Origin Restrictions Conformance Tests</title>
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/desktop-gl-constants.js" type="text/javascript"></script>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 <script>
 // This function returns the last 2 words of the domain of a URL
 // This is probably not the correct check but it will do for now.
@@ -28,105 +27,102 @@ function getBaseDomain(str) {
 }
 
 // Checks if function throws an exception.
 function causedException(func) {
   var hadException = false;
   try {
     func();
   } catch(e) {
-    //debug(e);
     hadException = true;
   }
-  //debug ("hadException: " + hadException);
   return hadException;
 }
 
 window.onload = function() {
-  description("This test ensures WebGL implementations follow proper origin restrictions.");
-  debug("");
+  description("This test ensures WebGL implementations follow proper same-origin restrictions.");
   var img = document.getElementById("img");
+  assertMsg(img.width > 0 && img.height > 0, "img was loaded");
   imgDomain = getBaseDomain(img.src);
   pageDomain = getBaseDomain(window.location.toString());
   assertMsg(imgDomain != pageDomain,
             "img domain (" + imgDomain + ") and page domain (" + pageDomain + ") are not the same.");
 
+  function makeTexImage2D(gl, src) {
+    return function() {
+      gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, src);
+    };
+  }
+
+  function makeTexSubImage2D(gl, src) {
+    return function() {
+      gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, src);
+    };
+  }
+
   function makeReadPixels(gl) {
     return function() {
       var buf = new Uint8Array(4);
       gl.readPixels(0, 0, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, buf);
     };
   }
 
   function makeToDataURL(canvas) {
     return function() {
       var data = canvas.toDataURL();
     }
   }
 
-  debug("");
-  debug("check that copying an img from another origin clears the origin-clean flag.");
   var canvas1 = document.getElementById("canvas1");
-  var gl1 = create3DContext(canvas1);
-  assertMsg(!causedException(makeReadPixels(gl1)),
-            "should not throw exception by readPixels for origin clean canvas.");
-  assertMsg(!causedException(makeToDataURL(canvas1)),
-            "should not throw exception by toDataURL for origin clean canvas.");
-
-  var tex = gl1.createTexture();
-  gl1.bindTexture(gl1.TEXTURE_2D, tex);
-  gl1.texImage2D(gl1.TEXTURE_2D, 0, gl1.RGBA, gl1.RGBA, gl1.UNSIGNED_BYTE, img);
-
-  assertMsg(causedException(makeReadPixels(gl1)),
-            "should throw exception by readPixels for NON origin clean canvas.");
-  assertMsg(causedException(makeToDataURL(canvas1)),
-            "should throw exception by toDataURL for NON origin clean canvas.");
+  var gl = create3DContext(canvas1);
 
   debug("");
-  debug("check that copying from 1 unclean 3d canvas to another clears the origin-clean flag on the second canvas.");
-  var canvas2 = document.getElementById("canvas2");
-  var gl2 = create3DContext(canvas2);
+  debug("check that an attempt to upload an image from another origin throws an exception.");
+  var tex = gl.createTexture();
+  gl.bindTexture(gl.TEXTURE_2D, tex);
+  gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 256, 256, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+  assertMsg(causedException(makeTexImage2D(gl, img)),
+            "texImage2D with cross-origin image should throw exception.");
+  assertMsg(causedException(makeTexSubImage2D(gl, img)),
+            "texSubImage2D with cross-origin image should throw exception.");
 
-  assertMsg(!causedException(makeReadPixels(gl2)),
-            "should not throw exception by readPixels for origin clean canvas.");
-  assertMsg(!causedException(makeToDataURL(canvas2)),
-            "should not throw exception by toDataURL for origin clean canvas.");
+  debug("check that readPixels and toDataURL continue to work against this canvas.");
+  assertMsg(!causedException(makeReadPixels(gl)),
+            "readPixels should never throw exception -- not possible to dirty origin of WebGL canvas.");
+  assertMsg(!causedException(makeToDataURL(canvas1)),
+            "should not throw exception by toDataURL for WebGL canvas, which should stay origin clean.");
 
-  var tex = gl2.createTexture();
-  gl2.bindTexture(gl2.TEXTURE_2D, tex);
-  gl2.texImage2D(
-     gl2.TEXTURE_2D, 0, gl2.RGBA, gl2.RGBA, gl2.UNSIGNED_BYTE, canvas1);
-
-  assertMsg(causedException(makeReadPixels(gl2)),
-            "should throw exception by readPixels for NON origin clean canvas.");
+  debug("check that an attempt to upload a tainted canvas throws an exception.");
+  var canvas2 = document.getElementById("canvas2");
+  var ctx2d = canvas2.getContext("2d");
+  ctx2d.drawImage(img, 0, 0);
   assertMsg(causedException(makeToDataURL(canvas2)),
             "should throw exception by toDataURL for NON origin clean canvas.");
+  assertMsg(causedException(makeTexImage2D(gl, canvas2)),
+            "texImage2D with NON origin clean canvas should throw exception.");
+  assertMsg(causedException(makeTexSubImage2D(gl, canvas2)),
+            "texSubImage2D with NON origin clean canvas should throw exception.");
 
-  debug("");
-  debug("check that copying from 1 unclean 3d canvas to a 2d canvas clears the origin-clean flag on the 2d canvas.");
-  var canvas3 = document.getElementById("canvas3");
-  var ctx2d = canvas3.getContext("2d");
-  assertMsg(!causedException(makeToDataURL(canvas3)),
-            "should not throw exception by toDataURL for origin clean canvas.");
-  ctx2d.drawImage(canvas2, 0, 0);
-  assertMsg(causedException(makeToDataURL(canvas3)),
-            "should throw exception by toDataURL for NON origin clean canvas.");
+  debug("check that readPixels and toDataURL continue to work against this canvas.");
+  assertMsg(!causedException(makeReadPixels(gl)),
+            "readPixels should never throw exception -- not possible to dirty origin of WebGL canvas.");
+  assertMsg(!causedException(makeToDataURL(canvas1)),
+            "should not throw exception by toDataURL for WebGL canvas, which should stay origin clean.");
 
-
-  // TODO: Should check video?
+  // TODO: Should check video.
+  // TODO: Should check CORS support.
 
   debug("");
   successfullyParsed = true;
   shouldBeTrue("successfullyParsed");
   debug('<br /><span class="pass">TEST COMPLETE</span>');
   notifyFinishedToHarness();
 }
 </script>
 </head>
 <body>
 <div id="description"></div>
 <div id="console"></div>
 <canvas id="canvas1"></canvas>
 <canvas id="canvas2"></canvas>
-<canvas id="canvas3"></canvas>
-<img id="img" src="http://example.com/tests/content/canvas/test/webgl/resources/opengl_logo.jpg" style="display:none;"/>
+<img id="img" src="http://example.com/tests/content/canvas/test/webgl/resources/opengl_logo.jpg" style="display:none;">
 </body>
 </html>
--- a/content/canvas/test/webgl/conformance/point-size.html
+++ b/content/canvas/test/webgl/conformance/point-size.html
@@ -1,15 +1,17 @@
 <!--
-Copyright (c) 2010 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
  -->
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 <script id="vshader" type="x-shader/x-vertex">
 attribute vec3 pos;
 attribute vec4 colorIn;
 uniform float pointSize;
 varying vec4 color;
@@ -18,19 +20,17 @@ void main()
 {
     gl_PointSize = pointSize;
     color = colorIn;
     gl_Position = vec4(pos.xyz, 3.0);
 }
 </script>
 
 <script id="fshader" type="x-shader/x-fragment">
-#ifdef GL_ES
 precision mediump float;
-#endif
 varying vec4 color;
 
 void main()
 {
     gl_FragColor = color;
 }
 </script>
 
new file mode 100644
--- /dev/null
+++ b/content/canvas/test/webgl/conformance/premultiplyalpha-test.html
@@ -0,0 +1,143 @@
+<!--
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
+Use of this source code is governed by a BSD-style license that can be
+found in the LICENSE file.
+ -->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Test the WebGL premultipledAlpha context creation flag.</title>
+<link rel="stylesheet" href="../resources/js-test-style.css"/>
+<script src="../resources/js-test-pre.js"></script>
+<script src="resources/webgl-test.js"> </script>
+<script src="resources/webgl-test-utils.js"> </script>
+</head>
+<body>
+<div id="description"></div><div id="console"></div>
+<script>
+var wtu = WebGLTestUtils;
+
+var tests = [
+  // If premultipledAlpha is true then
+  // [texture]           [canvas]             [dataURL]
+  // 32, 64, 128, 128 -> 64, 128, 255, 128 -> 64, 128, 255, 128
+  { creationAttributes: {},
+    sentColor: [32, 64, 128, 128],
+    expectedColor: [64, 128, 255, 128],
+    errorRange: 2,
+    useToDataURL: true,
+  },
+  // If premultipledAlpha is true then
+  // [texture]           [canvas]             [texture]
+  // 32, 64, 128, 128 -> 64, 128, 255, 128 -> 64, 128, 255, 128
+  { creationAttributes: {},
+    sentColor: [32, 64, 128, 128],
+    expectedColor: [64, 128, 255, 128],
+    errorRange: 2,
+    useToDataURL: false,
+  },
+  // If premultipledAlpha is false then
+  // [texture]           [canvas]            [dataURL]
+  // 255, 192, 128, 1 -> 255, 192, 128, 1 -> 255, 192, 128, 1
+  { creationAttributes: {premultipliedAlpha: false},
+    sentColor: [255, 192, 128, 1],
+    expectedColor: [255, 192, 128, 1],
+    errorRange: 0,
+    useToDataURL: true,
+  },
+  // If premultipledAlpha is false then
+  // [texture]           [canvas]            [texture]
+  // 255, 192, 128, 1 -> 255, 192, 128, 1 -> 255, 192, 128, 1
+  { creationAttributes: {premultipliedAlpha: false},
+    sentColor: [255, 192, 128, 1],
+    expectedColor: [255, 192, 128, 1],
+    errorRange: 0,
+    useToDataURL: false,
+  }
+];
+
+var g_count = 0;
+var gl;
+var canvas;
+var premultipledAlpha;
+
+description("Test the WebGL premultipledAlpha context creation flag.");
+doNextTest();
+function doNextTest() {
+  if (g_count < tests.length) {
+     var test = tests[g_count++];
+     canvas = document.createElement("canvas");
+     gl = wtu.create3DContext(canvas, test.creationAttributes);
+     var premultipliedAlpha = test.creationAttributes.premultipliedAlpha != false;
+     debug("")
+     debug("testing: premultipliedAlpha: " + premultipliedAlpha + " toDataURL: " + test.useToDataURL);
+
+     shouldBe('gl.getContextAttributes().premultipledAlpha', 'premultipledAlpha');
+
+     console.log(gl.getContextAttributes());
+     var program = wtu.setupTexturedQuad(gl);
+
+     glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from setup.");
+     var tex = gl.createTexture();
+     wtu.fillTexture(gl, tex, 2, 2, test.sentColor, 0);
+     var loc = gl.getUniformLocation(program, "tex");
+     gl.uniform1i(loc, 0);
+     gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
+     gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
+     gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
+     gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
+
+     wtu.drawQuad(gl);
+     glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from drawing.");
+
+     function loadTexture() {
+       var pngTex = gl.createTexture();
+       // not needed as it's the default
+       // gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);
+       gl.pixelStorei(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, false);
+       gl.bindTexture(gl.TEXTURE_2D, pngTex);
+       if (test.useToDataURL) {
+          // create texture from image
+          gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, this);
+       } else {
+          // create texture from canvas
+          gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, canvas);
+       }
+       gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
+       gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
+       gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
+       gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
+       glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from creating copy.");
+       wtu.drawQuad(gl);
+       glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from 2nd drawing.");
+       wtu.checkCanvas(
+          gl, test.expectedColor,
+          "should draw with " + test.expectedColor, test.errorRange);
+
+       doNextTest();
+     }
+
+     if (test.useToDataURL) {
+        // Load canvas into string using toDataURL
+        var png = canvas.toDataURL();
+        // Load string into the texture
+        var input = document.createElement("img");
+        input.onload = loadTexture;
+        input.src = png;
+     } else {
+        // Load canvas into the texture asynchronously (to prevent unbounded stack consumption)
+        setTimeout(loadTexture, 0);
+     }
+   } else {
+      successfullyParsed = true;
+      finishTest();
+   }
+}
+
+</script>
+
+</body>
+</html>
+
+
--- a/content/canvas/test/webgl/conformance/program-test.html
+++ b/content/canvas/test/webgl/conformance/program-test.html
@@ -1,18 +1,17 @@
 <!--
-Copyright (c) 2010 Mozilla Foundation. All rights reserved.
+Copyright (c) 2011 Mozilla Foundation. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
 -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-  "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE html>
 <html>
 <head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+<meta charset="utf-8">
 <title>WebGL Program Compiling/Linking Conformance Test</title>
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js" type="text/javascript"></script>
 <script src="resources/webgl-test.js" type="text/javascript"></script>
 </head>
 <body>
 <div id="description"></div>
 <div id="console"></div>
@@ -81,24 +80,24 @@ function go() {
     var vsBad = gl.createShader(gl.VERTEX_SHADER);
     gl.shaderSource(vsBad, "WILL NOT COMPILE;");
     gl.compileShader(vsBad);
 
     assertMsg(gl.getShaderParameter(vsBad, gl.COMPILE_STATUS) == false,
               "bad vertex shader should fail to compile");
 
     var fs = gl.createShader(gl.FRAGMENT_SHADER);
-    gl.shaderSource(fs, "#ifdef GL_ES\nprecision mediump float;\n#endif\n varying vec4 vColor; void main() { gl_FragColor = vColor; }");
+    gl.shaderSource(fs, "precision mediump float; varying vec4 vColor; void main() { gl_FragColor = vColor; }");
     gl.compileShader(fs);
 
     assertMsg(gl.getShaderParameter(fs, gl.COMPILE_STATUS) == true,
               "good fragment shader should compile");
 
     var fs2 = gl.createShader(gl.FRAGMENT_SHADER);
-    gl.shaderSource(fs2, "#ifdef GL_ES\nprecision mediump float;\n#endif\n varying vec4 vColor; void main() { gl_FragColor = vColor * 0.5; }");
+    gl.shaderSource(fs2, "precision mediump float; varying vec4 vColor; void main() { gl_FragColor = vColor * 0.5; }");
     gl.compileShader(fs2);
 
     assertMsg(gl.getShaderParameter(fs2, gl.COMPILE_STATUS) == true,
               "good fragment shader #2 should compile");
 
     var fsBad = gl.createShader(gl.FRAGMENT_SHADER);
     gl.shaderSource(fsBad, "WILL NOT COMPILE;");
     gl.compileShader(fsBad);
@@ -268,28 +267,28 @@ function go() {
     gl.deleteProgram(progGood1);
     gl.drawArrays(gl.TRIANGLES, 0, 4);
     glErrorShouldBe(gl, gl.NO_ERROR, "delete the current program shouldn't change the current rendering state");
 
     gl.linkProgram(progGood1);
     glErrorShouldBe(gl, gl.NO_ERROR, "The current program shouldn't be deleted");
 
     var fs3 = gl.createShader(gl.FRAGMENT_SHADER);
-    gl.shaderSource(fs3, "#ifdef GL_ES\nprecision mediump float;\n#endif\n varying vec4 vColor; void main() { gl_FragColor = vColor; }");
+    gl.shaderSource(fs3, "precision mediump float; varying vec4 vColor; void main() { gl_FragColor = vColor; }");
     gl.compileShader(fs3);
 
     assertMsg(gl.getShaderParameter(fs3, gl.COMPILE_STATUS) == true,
               "good fragment shader should compile");
 
     gl.deleteShader(fs3);
     gl.compileShader(fs3);
     glErrorShouldBe(gl, gl.INVALID_VALUE, "an unattached shader should be deleted immediately");
 
     fs3 = gl.createShader(gl.FRAGMENT_SHADER);
-    gl.shaderSource(fs3, "#ifdef GL_ES\nprecision mediump float;\n#endif\n varying vec4 vColor; void main() { gl_FragColor = vColor; }");
+    gl.shaderSource(fs3, "precision mediump float; varying vec4 vColor; void main() { gl_FragColor = vColor; }");
     gl.compileShader(fs3);
 
     assertMsg(gl.getShaderParameter(fs3, gl.COMPILE_STATUS) == true,
               "good fragment shader should compile");
 
     gl.detachShader(progGood1, fs);
     gl.attachShader(progGood1, fs3);
 
--- a/content/canvas/test/webgl/conformance/read-pixels-pack-alignment.html
+++ b/content/canvas/test/webgl/conformance/read-pixels-pack-alignment.html
@@ -1,34 +1,34 @@
 <!--
-Copyright (c) 2010 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
  -->
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 <script id="vshader" type="x-shader/x-vertex">
 attribute vec3 pos;
 attribute vec4 colorIn;
 varying vec4 color;
 
 void main()
 {
     color = colorIn;
     gl_Position = vec4(pos.xyz, 1.0);
 }
 </script>
 
 <script id="fshader" type="x-shader/x-fragment">
-#ifdef GL_ES
 precision mediump float;
-#endif
 varying vec4 color;
 
 void main()
 {
     gl_FragColor = color;
 }
 </script>
 </head>
--- a/content/canvas/test/webgl/conformance/read-pixels-test.html
+++ b/content/canvas/test/webgl/conformance/read-pixels-test.html
@@ -1,17 +1,17 @@
 <!--
-Copyright (c) 2009 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
  -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-  "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <title>WebGL ReadPixels conformance test.</title>
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"> </script>
 <script src="resources/webgl-test-utils.js"> </script>
 </head>
 <body>
 <canvas id="example" width="200" height="200" style="width: 20px; height: 20px"></canvas>
@@ -34,16 +34,17 @@ var width = 2;
 var height = 2;
 var continueTestFunc = continueTestPart1;
 
 gl.clearColor(1, 1, 1, 1);
 gl.clear(gl.COLOR_BUFFER_BIT);
 
 // Resize the canvas to 2x2. This is an attempt to get stuff in the backbuffer.
 // that shouldn't be there.
+canvas.addEventListener("webglcontextlost", function(e) { e.preventDefault(); }, false);
 canvas.addEventListener("webglcontextrestored", continueTestAfterContextRestored, false);
 canvas.width = width;
 canvas.height = height;
 if (gl.getError() != gl.CONTEXT_LOST_WEBGL) {
   continueTestPart1();
 }
 
 function continueTestAfterContextRestored() {
--- a/content/canvas/test/webgl/conformance/renderbuffer-initialization.html
+++ b/content/canvas/test/webgl/conformance/renderbuffer-initialization.html
@@ -1,15 +1,17 @@
 <!--
-Copyright (c) 2010 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
  -->
+<!DOCTYPE html>
 <html>
 <head>
+<meta charset="utf-8">
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 <script>
 function runTest(gl, width, height)
 {
 
     debug('Test whether the WebGL internal buffers have been initialized to 0.');
--- a/content/canvas/test/webgl/conformance/resource-sharing-test.html
+++ b/content/canvas/test/webgl/conformance/resource-sharing-test.html
@@ -1,17 +1,17 @@
 <!--
-Copyright (c) 2009 The Chromium Authors. All rights reserved.
+Copyright (c) 2011 The Chromium Authors. All rights reserved.
 Use of this source code is governed by a BSD-style license that can be
 found in the LICENSE file.
  -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-  "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE html>
 <html>
   <head>
+<meta charset="utf-8">
     <title>WebGL Resource Sharing.</title>
     <link rel="stylesheet" href="../resources/js-test-style.css"/>
     <script src="../resources/js-test-pre.js"></script>
     <script src="resources/webgl-test.js"> </script>
     <script src="../../debug/webgl-debug.js"> </script>
 </head>
 <body>
 <canvas id="example1" width="2" height="2" style="width: 40px; height: 40px;"></canvas>
@@ -30,17 +30,12 @@ assertMsg(gl1 && gl2,
 var vertexObject = gl1.createBuffer();
 gl2.bindBuffer(gl2.ARRAY_BUFFER, vertexObject);
 assertMsg(
   gl2.getError() == gl2.INVALID_OPERATION,
   "attempt to use a resource from the wrong context should fail with INVALID_OPERATION");
 
 successfullyParsed = true;
 </script>
-</body>
 <script src="../resources/js-test-post.js"></script>
-
-<script>
-</script>
-
 </body>
 </html>
 
--- a/content/canvas/test/webgl/conformance/resources/fragmentShader.frag
+++ b/content/canvas/test/webgl/conformance/resources/fragmentShader.frag
@@ -19,18 +19,14 @@ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INC
 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
 
 // Workaround for non-compliant WebGL implementations (FIXME)
-#if defined(GL_ES)
 varying mediump vec3 v_normal;
-#else
-varying vec3 v_normal;
-#endif
 
 void main()
 {
     gl_FragColor = vec4(v_normal/2.0+vec3(0.5), 1);
 }
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..59f5f774a783b459385451b4c5df238001cb9f1d
GIT binary patch
literal 38215
zc%1E>e^6A{7018t?L(L4*YZOpNXc7@ib`}<Y>0#M_z`0i6osV5kSemMD8FP^G$xvd
zLqM&WG1al7)ry(cYHJ*vWGu-f?Iu`%WHdFgQ`43|me}dENoIm=CejYg_S}7#JT|tY
zmc0I$bBDuy=ic|udGEgaxpU8foduA*%J*brU1RoiDGg<!uJJb10kE%Xs;&lFepTnG
z^a1kh>g~FQbqxb~y~jF`<?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~_1a6fxJN6LXz{nCp$i+&FN*##U}_
zswHNOhL~I0h#99P=2jUow;6t%PO9wf{QC`cTvd^(K9RyzW_6+YU4ocShlx3%keJ>^
cVg`^u9G*bT4Uxp$tt4ieD>0AR6VurGU#vCYng9R*
--- a/content/canvas/test/webgl/conformance/resources/vertexShader.vert
+++ b/content/canvas/test/webgl/conformance/resources/vertexShader.vert
@@ -20,22 +20,17 @@ PROCUREMENT OF SUBSTITUTE GOODS OR SERVI
 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
 attribute vec4 a_vertex;
 attribute vec3 a_normal;
 
-// Workaround for non-compliant WebGL implementations (FIXME)
-#if defined(GL_ES)
 uniform mediump mat4 u_modelViewProjMatrix;
-#else
-uniform mat4 u_modelViewProjMatrix;
-#endif
 
 varying vec3 v_normal;
 
 void main()
 {
     v_normal = a_normal;
     gl_Position =  u_modelViewProjMatrix * a_vertex;
 }
--- a/content/canvas/test/webgl/conformance/resources/webgl-test-utils.js
+++ b/content/canvas/test/webgl/conformance/resources/webgl-test-utils.js
@@ -1,9 +1,9 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
 WebGLTestUtils = (function() {
 
 /**
  * Wrapped logging function.
  * @param {string} msg The message to log.
@@ -95,19 +95,17 @@ var simpleTextureVertexShader = '' +
   '    texCoord = texCoord0;\n' +
   '}\n';
 
 /**
  * A fragment shader for a single texture.
  * @type {string}
  */
 var simpleTextureFragmentShader = '' +
-  '#ifdef GL_ES\n' +
   'precision mediump float;\n' +
-  '#endif\n' +
   'uniform sampler2D tex;\n' +
   'varying vec2 texCoord;\n' +
   'void main() {\n' +
   '    gl_FragData[0] = texture2D(tex, texCoord);\n' +
   '}\n';
 
 /**
  * Creates a simple texture vertex shader.
@@ -346,19 +344,21 @@ var checkCanvasRect = function(gl, x, y,
 };
 
 /**
  * Checks that an entire canvas is 1 color.
  * @param {!WebGLContext} gl The WebGLContext to use.
  * @param {!Array.<number>} color The color to fill clear with before drawing. A
  *        4 element array where each element is in the range 0 to 255.
  * @param {string} msg Message to associate with success. Eg ("should be red").
+ * @param {number} errorRange Optional. Acceptable error in
+ *        color checking. 0 by default.
  */
-var checkCanvas = function(gl, color, msg) {
-  checkCanvasRect(gl, 0, 0, gl.canvas.width, gl.canvas.height, color, msg);
+var checkCanvas = function(gl, color, msg, errorRange) {
+  checkCanvasRect(gl, 0, 0, gl.canvas.width, gl.canvas.height, color, msg, errorRange);
 };
 
 /**
  * Loads a texture, calls callback when finished.
  * @param {!WebGLContext} gl The WebGLContext to use.
  * @param {string} url URL of image to load
  * @param {function(!Image): void} callback Function that gets called after
  *        image has loaded
@@ -615,18 +615,29 @@ var readFileList = function(url) {
       prefix = url.substr(0, lastSlash + 1);
     }
     for (var ii = 0; ii < lines.length; ++ii) {
       var str = lines[ii].replace(/^\s\s*/, '').replace(/\s\s*$/, '');
       if (str.length > 4 &&
           str[0] != '#' &&
           str[0] != ";" &&
           str.substr(0, 2) != "//") {
-        new_url = prefix + str;
-        files = files.concat(readFileList(new_url));
+        var names = str.split(/ +/);
+        if (names.length == 1) {
+          new_url = prefix + str;
+          files = files.concat(readFileList(new_url));
+        } else {
+          var s = "";
+          var p = "";
+          for (var jj = 0; jj < names.length; ++jj) {
+            s += p + prefix + names[jj];
+            p = " ";
+          }
+          files.push(s);
+        }
       }
     }
   } else {
     files.push(url);
   }
   return files;
 };
 
@@ -830,26 +841,50 @@ var loadImagesAsync = function(urls, cal
   }
   for (var ii = 0; ii < urls.length; ++ii) {
     ++count;
     loadImageAsync(urls[ii], imageLoaded(urls[ii]));
   }
   countDown();
 };
 
+var getUrlArguments = function() {
+  var args = {};
+  try {
+    var s = window.location.href;
+    var q = s.indexOf("?");
+    var e = s.indexOf("#");
+    if (e < 0) {
+      e = s.length;
+    }
+    var query = s.substring(q + 1, e);
+    var pairs = query.split("&");
+    for (var ii = 0; ii < pairs.length; ++ii) {
+      var keyValue = pairs[ii].split("=");
+      var key = keyValue[0];
+      var value = decodeURIComponent(keyValue[1]);
+      args[key] = value;
+    }
+  } catch (e) {
+    throw "could not parse url";
+  }
+  return args;
+};
+
 return {
   create3DContext: create3DContext,
   create3DContextWithWrapperThatThrowsOnGLError:
     create3DContextWithWrapperThatThrowsOnGLError,
   checkCanvas: checkCanvas,
   checkCanvasRect: checkCanvasRect,
   createColoredTexture: createColoredTexture,
   drawQuad: drawQuad,
   endsWith: endsWith,
   getLastError: getLastError,
+  getUrlArguments: getUrlArguments,
   glEnumToString: glEnumToString,
   glErrorShouldBe: glErrorShouldBe,
   fillTexture: fillTexture,
   loadImageAsync: loadImageAsync,
   loadImagesAsync: loadImagesAsync,
   loadProgram: loadProgram,
   loadProgramFromFile: loadProgramFromFile,
   loadProgramFromScript: loadProgramFromScript,
--- a/content/canvas/test/webgl/conformance/resources/webgl-test.js
+++ b/content/canvas/test/webgl/conformance/resources/webgl-test.js
@@ -1,10 +1,10 @@
 /*
-Copyright (C) 2009 Apple Computer, Inc.  All rights reserved.
+Copyright (C) 2011 Apple Computer, Inc.  All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions
 are met:
 1. Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
 2. Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
@@ -697,17 +697,17 @@ function loadImageTexture(ctx, url)
     texture.image.src = url;
     return texture;
 }
 
 function doLoadImageTexture(ctx, image, texture)
 {
     ctx.enable(ctx.TEXTURE_2D);
     ctx.bindTexture(ctx.TEXTURE_2D, texture);
-    ctx.texImage2D(ctx.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, image);
+    ctx.texImage2D(ctx.TEXTURE_2D, 0, ctx.RGBA, ctx.RGBA, ctx.UNSIGNED_BYTE, image);
     ctx.texParameteri(ctx.TEXTURE_2D, ctx.TEXTURE_MAG_FILTER, ctx.LINEAR);
     ctx.texParameteri(ctx.TEXTURE_2D, ctx.TEXTURE_MIN_FILTER, ctx.LINEAR_MIPMAP_LINEAR);
     ctx.texParameteri(ctx.TEXTURE_2D, ctx.TEXTURE_WRAP_S, ctx.CLAMP_TO_EDGE);
     ctx.texParameteri(ctx.TEXTURE_2D, ctx.TEXTURE_WRAP_T, ctx.CLAMP_TO_EDGE);
     ctx.generateMipmap(ctx.TEXTURE_2D)
     ctx.bindTexture(ctx.TEXTURE_2D, 0);
 }
 
new file mode 100755
--- /dev/null
+++ b/content/canvas/test/webgl/conformance/shaders/00_test_list.txt
@@ -0,0 +1,2 @@
+glsl-features/00_test_list.txt
+
new file mode 100755
--- /dev/null
+++ b/content/canvas/test/webgl/conformance/shaders/glsl-features/00_test_list.txt
@@ -0,0 +1,48 @@
+../../glsl-features.html?feature=base
+
+../../glsl-features.html?feature=abs-frag&reffs=shaders/glsl-features/abs-ref.frag&testfs=shaders/glsl-features/abs.frag
+../../glsl-features.html?feature=abs-frag-vec2&reffs=shaders/glsl-features/abs-vec2-ref.frag&testfs=shaders/glsl-features/abs-vec2.frag
+../../glsl-features.html?feature=abs-frag-vec3&reffs=shaders/glsl-features/abs-vec3-ref.frag&testfs=shaders/glsl-features/abs-vec3.frag
+../../glsl-features.html?feature=abs-frag-vec4&reffs=shaders/glsl-features/abs-vec4-ref.frag&testfs=shaders/glsl-features/abs-vec4.frag
+../../glsl-features.html?feature=abs-vert&refvs=shaders/glsl-features/abs-ref.vert&testvs=shaders/glsl-features/abs.vert
+../../glsl-features.html?feature=abs-vert-vec2&refvs=shaders/glsl-features/abs-vec2-ref.vert&testvs=shaders/glsl-features/abs-vec2.vert
+../../glsl-features.html?feature=abs-vert-vec3&refvs=shaders/glsl-features/abs-vec3-ref.vert&testvs=shaders/glsl-features/abs-vec3.vert
+../../glsl-features.html?feature=abs-vert-vec4&refvs=shaders/glsl-features/abs-vec4-ref.vert&testvs=shaders/glsl-features/abs-vec4.vert
+
+../../glsl-features.html?feature=sign-frag&reffs=shaders/glsl-features/sign-ref.frag&testfs=shaders/glsl-features/sign.frag
+../../glsl-features.html?feature=sign-frag-vec2&reffs=shaders/glsl-features/sign-vec2-ref.frag&testfs=shaders/glsl-features/sign-vec2.frag
+../../glsl-features.html?feature=sign-frag-vec3&reffs=shaders/glsl-features/sign-vec3-ref.frag&testfs=shaders/glsl-features/sign-vec3.frag
+../../glsl-features.html?feature=sign-frag-vec4&reffs=shaders/glsl-features/sign-vec4-ref.frag&testfs=shaders/glsl-features/sign-vec4.frag
+../../glsl-features.html?feature=sign-vert&refvs=shaders/glsl-features/sign-ref.vert&testvs=shaders/glsl-features/sign.vert
+../../glsl-features.html?feature=sign-vert-vec2&refvs=shaders/glsl-features/sign-vec2-ref.vert&testvs=shaders/glsl-features/sign-vec2.vert
+../../glsl-features.html?feature=sign-vert-vec3&refvs=shaders/glsl-features/sign-vec3-ref.vert&testvs=shaders/glsl-features/sign-vec3.vert
+../../glsl-features.html?feature=sign-vert-vec4&refvs=shaders/glsl-features/sign-vec4-ref.vert&testvs=shaders/glsl-features/sign-vec4.vert
+
+../../glsl-features.html?feature=floor-frag&reffs=shaders/glsl-features/floor-ref.frag&testfs=shaders/glsl-features/floor.frag
+../../glsl-features.html?feature=floor-frag-vec2&reffs=shaders/glsl-features/floor-vec2-ref.frag&testfs=shaders/glsl-features/floor-vec2.frag
+../../glsl-features.html?feature=floor-frag-vec3&reffs=shaders/glsl-features/floor-vec3-ref.frag&testfs=shaders/glsl-features/floor-vec3.frag
+../../glsl-features.html?feature=floor-frag-vec4&reffs=shaders/glsl-features/floor-vec4-ref.frag&testfs=shaders/glsl-features/floor-vec4.frag
+../../glsl-features.html?res=8&feature=floor-vert&refvs=shaders/glsl-features/floor-ref.vert&testvs=shaders/glsl-features/floor.vert
+../../glsl-features.html?res=8&feature=floor-vert-vec2&refvs=shaders/glsl-features/floor-vec2-ref.vert&testvs=shaders/glsl-features/floor-vec2.vert
+../../glsl-features.html?res=8&feature=floor-vert-vec3&refvs=shaders/glsl-features/floor-vec3-ref.vert&testvs=shaders/glsl-features/floor-vec3.vert
+../../glsl-features.html?res=8&feature=floor-vert-vec4&refvs=shaders/glsl-features/floor-vec4-ref.vert&testvs=shaders/glsl-features/floor-vec4.vert
+
+../../glsl-features.html?feature=ceil-frag&reffs=shaders/glsl-features/ceil-ref.frag&testfs=shaders/glsl-features/ceil.frag
+../../glsl-features.html?feature=ceil-frag-vec2&reffs=shaders/glsl-features/ceil-vec2-ref.frag&testfs=shaders/glsl-features/ceil-vec2.frag
+../../glsl-features.html?feature=ceil-frag-vec3&reffs=shaders/glsl-features/ceil-vec3-ref.frag&testfs=shaders/glsl-features/ceil-vec3.frag
+../../glsl-features.html?feature=ceil-frag-vec4&reffs=shaders/glsl-features/ceil-vec4-ref.frag&testfs=shaders/glsl-features/ceil-vec4.frag
+../../glsl-features.html?res=8&feature=ceil-vert&refvs=shaders/glsl-features/ceil-ref.vert&testvs=shaders/glsl-features/ceil.vert
+../../glsl-features.html?res=8&feature=ceil-vert-vec2&refvs=shaders/glsl-features/ceil-vec2-ref.vert&testvs=shaders/glsl-features/ceil-vec2.vert
+../../glsl-features.html?res=8&feature=ceil-vert-vec3&refvs=shaders/glsl-features/ceil-vec3-ref.vert&testvs=shaders/glsl-features/ceil-vec3.vert
+../../glsl-features.html?res=8&feature=ceil-vert-vec4&refvs=shaders/glsl-features/ceil-vec4-ref.vert&testvs=shaders/glsl-features/ceil-vec4.vert
+
+../../glsl-features.html?feature=fract-frag&reffs=shaders/glsl-features/fract-ref.frag&testfs=shaders/glsl-features/fract.frag
+../../glsl-features.html?feature=fract-frag-vec2&reffs=shaders/glsl-features/fract-vec2-ref.frag&testfs=shaders/glsl-features/fract-vec2.frag
+../../glsl-features.html?feature=fract-frag-vec3&reffs=shaders/glsl-features/fract-vec3-ref.frag&testfs=shaders/glsl-features/fract-vec3.frag
+../../glsl-features.html?feature=fract-frag-vec4&reffs=shaders/glsl-features/fract-vec4-ref.frag&testfs=shaders/glsl-features/fract-vec4.frag
+../../glsl-features.html?res=8&feature=fract-vert&refvs=shaders/glsl-features/fract-ref.vert&testvs=shaders/glsl-features/fract.vert
+../../glsl-features.html?res=8&feature=fract-vert-vec2&refvs=shaders/glsl-features/fract-vec2-ref.vert&testvs=shaders/glsl-features/fract-vec2.vert
+../../glsl-features.html?res=8&feature=fract-vert-vec3&refvs=shaders/glsl-features/fract-vec3-ref.vert&testvs=shaders/glsl-features/fract-vec3.vert
+../../glsl-features.html?res=8&feature=fract-vert-vec4&refvs=shaders/glsl-features/fract-vec4-ref.vert&testvs=shaders/glsl-features/fract-vec4.vert
+
+
new file mode 100755
--- /dev/null
+++ b/content/canvas/test/webgl/conformance/shaders/glsl-features/abs-ref.frag
@@ -0,0 +1,23 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+precision mediump float;
+
+varying vec2 vTexcoord;
+varying vec4 vColor;
+
+float abs_emu(float value) {
+  return value >= 0.0 ? value : -value;
+}
+
+void main()
+{
+   gl_FragColor = vec4(
+     abs_emu(vTexcoord.x * 2.0 - 1.0),
+     abs_emu(vTexcoord.y * 2.0 - 1.0),
+     0,
+     1);
+}
+
+
new file mode 100755
--- /dev/null
+++ b/content/canvas/test/webgl/conformance/shaders/glsl-features/abs-ref.vert
@@ -0,0 +1,32 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+attribute vec4 aPosition;
+attribute vec2 aTexcoord;
+
+varying vec2 vTexcoord;
+varying vec4 vColor;
+
+float abs_emu(float value) {
+  return value >= 0.0 ? value : -value;
+}
+
+void main()
+{
+   gl_Position = aPosition;
+   vTexcoord = aTexcoord;
+   vec4 color = vec4(
+       aTexcoord,
+       aTexcoord.x * aTexcoord.y,
+       (1.0 - aTexcoord.x) * aTexcoord.y * 0.5 + 0.5);
+   vColor = vec4(
+     abs(color.x * 2.0 - 1.0),
+     0,
+     abs(color.y * 2.0 - 1.0),
+     1);
+}
+
+
+
+
new file mode 100755
--- /dev/null
+++ b/content/canvas/test/webgl/conformance/shaders/glsl-features/abs-vec2-ref.frag
@@ -0,0 +1,28 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+precision mediump float;
+
+varying vec2 vTexcoord;
+varying vec4 vColor;
+
+float abs_emu1(float value) {
+  return value >= 0.0 ? value : -value;
+}
+
+vec2 abs_emu(vec2 value) {
+  return vec2(
+      abs_emu1(value.x),
+      abs_emu1(value.y));
+}
+
+void main()
+{
+   gl_FragColor = vec4(
+     0,
+     abs_emu(vColor.xy * 2.0 - vec2(1, 1)),
+     1);
+}
+
+
new file mode 100755
--- /dev/null
+++ b/content/canvas/test/webgl/conformance/shaders/glsl-features/abs-vec2-ref.vert
@@ -0,0 +1,37 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+attribute vec4 aPosition;
+attribute vec2 aTexcoord;
+
+varying vec2 vTexcoord;
+varying vec4 vColor;
+
+float abs_emu1(float value) {
+  return value >= 0.0 ? value : -value;
+}
+
+vec2 abs_emu(vec2 value) {
+  return vec2(
+    abs_emu1(value.x),
+    abs_emu1(value.y));
+}
+
+void main()
+{
+   gl_Position = aPosition;
+   vTexcoord = aTexcoord;
+   vec4 color = vec4(
+       aTexcoord,
+       aTexcoord.x * aTexcoord.y,
+       (1.0 - aTexcoord.x) * aTexcoord.y * 0.5 + 0.5);
+   vColor = vec4(
+     abs(vColor.xy * 2.0 - vec2(1, 1)),
+     0,
+     1);
+}
+
+
+
+
new file mode 100755
--- /dev/null
+++ b/content/canvas/test/webgl/conformance/shaders/glsl-features/abs-vec2.frag
@@ -0,0 +1,18 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+precision mediump float;
+
+varying vec2 vTexcoord;
+varying vec4 vColor;
+
+void main()
+{
+   gl_FragColor = vec4(
+     0,
+     abs(vColor.xy * 2.0 - vec2(1, 1)),
+     1);
+}
+
+
new file mode 100755
--- /dev/null
+++ b/content/canvas/test/webgl/conformance/shaders/glsl-features/abs-vec2.vert
@@ -0,0 +1,27 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+attribute vec4 aPosition;
+attribute vec2 aTexcoord;
+
+varying vec2 vTexcoord;
+varying vec4 vColor;
+
+void main()
+{
+   gl_Position = aPosition;
+   vTexcoord = aTexcoord;
+   vec4 color = vec4(
+       aTexcoord,
+       aTexcoord.x * aTexcoord.y,
+       (1.0 - aTexcoord.x) * aTexcoord.y * 0.5 + 0.5);
+   vColor = vec4(
+     abs(vColor.xy * 2.0 - vec2(1, 1)),
+     0,
+     1);
+}
+
+
+
+
new file mode 100755
--- /dev/null
+++ b/content/canvas/test/webgl/conformance/shaders/glsl-features/abs-vec3-ref.frag
@@ -0,0 +1,28 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+precision mediump float;
+
+varying vec2 vTexcoord;
+varying vec4 vColor;
+
+float abs_emu1(float value) {
+  return value >= 0.0 ? value : -value;
+}
+
+vec3 abs_emu(vec3 value) {
+  return vec3(
+      abs_emu1(value.x),
+      abs_emu1(value.y),
+      abs_emu1(value.z));
+}
+
+void main()
+{
+   gl_FragColor = vec4(
+     abs_emu(vColor.xyz * 2.0 - vec3(1, 1, 1)),
+     1);
+}
+
+
new file mode 100755
--- /dev/null
+++ b/content/canvas/test/webgl/conformance/shaders/glsl-features/abs-vec3-ref.vert
@@ -0,0 +1,37 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+attribute vec4 aPosition;
+attribute vec2 aTexcoord;
+
+varying vec2 vTexcoord;
+varying vec4 vColor;
+
+float abs_emu1(float value) {
+  return value >= 0.0 ? value : -value;
+}
+
+vec3 abs_emu(vec3 value) {
+  return vec3(
+    abs_emu1(value.x),
+    abs_emu1(value.y),
+    abs_emu1(value.z));
+}
+
+void main()
+{
+   gl_Position = aPosition;
+   vTexcoord = aTexcoord;
+   vec4 color = vec4(
+       aTexcoord,
+       aTexcoord.x * aTexcoord.y,
+       (1.0 - aTexcoord.x) * aTexcoord.y * 0.5 + 0.5);
+   vColor = vec4(
+     abs(vColor.xyz * 2.0 - vec3(1, 1, 1)),
+     1);
+}
+
+
+
+
new file mode 100755
--- /dev/null
+++ b/content/canvas/test/webgl/conformance/shaders/glsl-features/abs-vec3.frag
@@ -0,0 +1,17 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+precision mediump float;
+
+varying vec2 vTexcoord;
+varying vec4 vColor;
+
+void main()
+{
+   gl_FragColor = vec4(
+     abs(vColor.xyz * 2.0 - vec3(1, 1, 1)),
+     1);
+}
+
+
new file mode 100755
--- /dev/null
+++ b/content/canvas/test/webgl/conformance/shaders/glsl-features/abs-vec3.vert
@@ -0,0 +1,26 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+attribute vec4 aPosition;
+attribute vec2 aTexcoord;
+
+varying vec2 vTexcoord;
+varying vec4 vColor;
+
+void main()
+{
+   gl_Position = aPosition;
+   vTexcoord = aTexcoord;
+   vec4 color = vec4(
+       aTexcoord,
+       aTexcoord.x * aTexcoord.y,
+       (1.0 - aTexcoord.x) * aTexcoord.y * 0.5 + 0.5);
+   vColor = vec4(
+     abs(vColor.xyz * 2.0 - vec3(1, 1, 1)),
+     1);
+}
+
+
+
+
new file mode 100755
--- /dev/null
+++ b/content/canvas/test/webgl/conformance/shaders/glsl-features/abs-vec4-ref.frag
@@ -0,0 +1,27 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+precision mediump float;
+
+varying vec2 vTexcoord;
+varying vec4 vColor;
+
+float abs_emu1(float value) {
+  return value >= 0.0 ? value : -value;
+}
+
+vec4 abs_emu(vec4 value) {
+  return vec4(
+      abs_emu1(value.x),
+      abs_emu1(value.y),
+      abs_emu1(value.z),
+      abs_emu1(value.w));
+}
+
+void main()
+{
+   gl_FragColor = abs_emu(vColor * 2.0 - vec4(1, 1, 1, 1));
+}
+
+
new file mode 100755
--- /dev/null
+++ b/content/canvas/test/webgl/conformance/shaders/glsl-features/abs-vec4-ref.vert
@@ -0,0 +1,36 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+attribute vec4 aPosition;
+attribute vec2 aTexcoord;
+
+varying vec2 vTexcoord;
+varying vec4 vColor;
+
+float abs_emu1(float value) {
+  return value >= 0.0 ? value : -value;
+}
+
+vec4 abs_emu(vec4 value) {
+  return vec4(
+    abs_emu1(value.x),
+    abs_emu1(value.y),
+    abs_emu1(value.z),
+    abs_emu1(value.w));
+}
+
+void main()
+{
+   gl_Position = aPosition;
+   vTexcoord = aTexcoord;
+   vec4 color = vec4(
+       aTexcoord,
+       aTexcoord.x * aTexcoord.y,
+       (1.0 - aTexcoord.x) * aTexcoord.y * 0.5 + 0.5);
+   vColor = abs_emu(vColor * 2.0 - vec4(1, 1, 1, 1));
+}
+
+
+
+
new file mode 100755
--- /dev/null
+++ b/content/canvas/test/webgl/conformance/shaders/glsl-features/abs-vec4.frag
@@ -0,0 +1,15 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+precision mediump float;
+
+varying vec2 vTexcoord;
+varying vec4 vColor;
+
+void main()
+{
+   gl_FragColor = abs(vColor * 2.0 - vec4(1, 1, 1, 1));
+}
+
+
new file mode 100755
--- /dev/null
+++ b/content/canvas/test/webgl/conformance/shaders/glsl-features/abs-vec4.vert
@@ -0,0 +1,24 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+attribute vec4 aPosition;
+attribute vec2 aTexcoord;
+
+varying vec2 vTexcoord;
+varying vec4 vColor;
+
+void main()
+{
+   gl_Position = aPosition;
+   vTexcoord = aTexcoord;
+   vec4 color = vec4(
+       aTexcoord,
+       aTexcoord.x * aTexcoord.y,
+       (1.0 - aTexcoord.x) * aTexcoord.y * 0.5 + 0.5);
+   vColor = abs(vColor * 2.0 - vec4(1, 1, 1, 1));
+}
+
+
+
+
new file mode 100755
--- /dev/null
+++ b/content/canvas/test/webgl/conformance/shaders/glsl-features/abs.frag
@@ -0,0 +1,19 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+precision mediump float;
+
+varying vec2 vTexcoord;
+varying vec4 vColor;
+
+void main()
+{
+   gl_FragColor = vec4(
+     abs(vTexcoord.x * 2.0 - 1.0),
+     abs(vTexcoord.y * 2.0 - 1.0),
+     0,
+     1);
+}
+
+
new file mode 100755
--- /dev/null
+++ b/content/canvas/test/webgl/conformance/shaders/glsl-features/abs.vert
@@ -0,0 +1,28 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+attribute vec4 aPosition;
+attribute vec2 aTexcoord;
+
+varying vec2 vTexcoord;
+varying vec4 vColor;
+
+void main()
+{
+   gl_Position = aPosition;
+   vTexcoord = aTexcoord;
+   vec4 color = vec4(
+       aTexcoord,
+       aTexcoord.x * aTexcoord.y,
+       (1.0 - aTexcoord.x) * aTexcoord.y * 0.5 + 0.5);
+   vColor = vec4(
+     abs(color.x * 2.0 - 1.0),
+     0,
+     abs(color.y * 2.0 - 1.0),
+     1);
+}
+
+
+
+
new file mode 100755
--- /dev/null
+++ b/content/canvas/test/webgl/conformance/shaders/glsl-features/base.frag
@@ -0,0 +1,15 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+precision mediump float;
+
+varying vec2 vTexcoord;
+varying vec4 vColor;
+
+void main()
+{
+   gl_FragColor = vColor;
+}
+
+
new file mode 100755
--- /dev/null
+++ b/content/canvas/test/webgl/conformance/shaders/glsl-features/base.vert
@@ -0,0 +1,21 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+attribute vec4 aPosition;
+attribute vec2 aTexcoord;
+
+varying vec2 vTexcoord;
+varying vec4 vColor;
+
+void main()
+{
+   gl_Position = aPosition;
+   vTexcoord = aTexcoord;
+   vColor = vec4(
+       aTexcoord,
+       aTexcoord.x * aTexcoord.y,
+       (1.0 - aTexcoord.x) * aTexcoord.y * 0.5 + 0.5);
+}
+
+
new file mode 100755
--- /dev/null
+++ b/content/canvas/test/webgl/conformance/shaders/glsl-features/ceil-ref.frag
@@ -0,0 +1,24 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+precision mediump float;
+
+varying vec2 vTexcoord;
+varying vec4 vColor;
+
+float ceil_emu(float value) {
+  float m = mod(value, 1.0);
+  return m != 0.0 ? (value + 1.0 - m) : value;
+}
+
+void main()
+{
+   gl_FragColor = vec4(
+      ceil_emu(vColor.x * 8.0 - 4.0) / 8.0 + 0.5,
+      0, 0, 1);
+}
+
+
+
+
new file mode 100755
--- /dev/null
+++ b/content/canvas/test/webgl/conformance/shaders/glsl-features/ceil-ref.vert
@@ -0,0 +1,33 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+attribute vec4 aPosition;
+attribute vec2 aTexcoord;
+
+varying vec2 vTexcoord;
+varying vec4 vColor;
+
+float ceil_emu(float value) {
+  float m = mod(value, 1.0);
+  return m != 0.0 ? (value + 1.0 - m) : value;
+}
+
+void main()
+{
+   gl_Position = aPosition;
+   vTexcoord = aTexcoord;
+   vec4 color = vec4(
+       aTexcoord,
+       aTexcoord.x * aTexcoord.y,
+       (1.0 - aTexcoord.x) * aTexcoord.y * 0.5 + 0.5);
+   vColor = vec4(
+       ceil_emu(color.x * 8.0 - 4.0) / 8.0 + 0.5,
+       0,
+       0,
+       1);
+}
+
+
+
+
new file mode 100755
--- /dev/null
+++ b/content/canvas/test/webgl/conformance/shaders/glsl-features/ceil-vec2-ref.frag
@@ -0,0 +1,30 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+precision mediump float;
+
+varying vec2 vTexcoord;
+varying vec4 vColor;
+
+float ceil_emu1(float value) {
+  float m = mod(value, 1.0);
+  return m != 0.0 ? (value + 1.0 - m) : value;
+}
+
+vec2 ceil_emu(vec2 value) {
+  return vec2(
+	  ceil_emu1(value.x),
+	  ceil_emu1(value.y));
+}
+
+void main()
+{
+   gl_FragColor = vec4(
+      ceil_emu(vColor.xy * 8.0 - vec2(4, 4)) / 8.0 + vec2(0.5, 0.5),
+      0, 1);
+}
+
+
+
+
new file mode 100755
--- /dev/null
+++ b/content/canvas/test/webgl/conformance/shaders/glsl-features/ceil-vec2-ref.vert
@@ -0,0 +1,38 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+attribute vec4 aPosition;
+attribute vec2 aTexcoord;
+
+varying vec2 vTexcoord;
+varying vec4 vColor;
+
+float ceil_emu1(float value) {
+  float m = mod(value, 1.0);
+  return m != 0.0 ? (value + 1.0 - m) : value;
+}
+
+vec2 ceil_emu(vec2 value) {
+  return vec2(
+	  ceil_emu1(value.x),
+	  ceil_emu1(value.y));
+}
+
+void main()
+{
+   gl_Position = aPosition;
+   vTexcoord = aTexcoord;
+   vec4 color = vec4(
+       aTexcoord,
+       aTexcoord.x * aTexcoord.y,
+       (1.0 - aTexcoord.x) * aTexcoord.y * 0.5 + 0.5);
+   vColor = vec4(
+       ceil(color.xy * 8.0 - vec2(4, 4)) / 8.0 + vec2(0.5, 0.5),
+       0,
+       1);
+}
+
+
+
+
new file mode 100755
--- /dev/null
+++ b/content/canvas/test/webgl/conformance/shaders/glsl-features/ceil-vec2.frag
@@ -0,0 +1,18 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+precision mediump float;
+
+varying vec2 vTexcoord;
+varying vec4 vColor;
+
+void main()
+{
+   gl_FragColor = vec4(
+      ceil(vColor.xy * 8.0 - vec2(4, 4)) / 8.0 + vec2(0.5, 0.5),
+      0, 1);
+}
+
+
+
new file mode 100755
--- /dev/null
+++ b/content/canvas/test/webgl/conformance/shaders/glsl-features/ceil-vec2.vert
@@ -0,0 +1,27 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+attribute vec4 aPosition;
+attribute vec2 aTexcoord;
+
+varying vec2 vTexcoord;
+varying vec4 vColor;
+
+void main()
+{
+   gl_Position = aPosition;
+   vTexcoord = aTexcoord;
+   vec4 color = vec4(
+       aTexcoord,
+       aTexcoord.x * aTexcoord.y,
+       (1.0 - aTexcoord.x) * aTexcoord.y * 0.5 + 0.5);
+   vColor = vec4(
+       ceil(color.xy * 8.0 - vec2(4, 4)) / 8.0 + vec2(0.5, 0.5),
+       0,
+       1);
+}
+
+
+
+
new file mode 100755
--- /dev/null
+++ b/content/canvas/test/webgl/conformance/shaders/glsl-features/ceil-vec3-ref.frag
@@ -0,0 +1,31 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+precision mediump float;
+
+varying vec2 vTexcoord;
+varying vec4 vColor;
+
+float ceil_emu1(float value) {
+  float m = mod(value, 1.0);
+  return m != 0.0 ? (value + 1.0 - m) : value;
+}
+
+vec3 ceil_emu(vec3 value) {
+  return vec3(
+	  ceil_emu1(value.x),
+	  ceil_emu1(value.y),
+	  ceil_emu1(value.z));
+}
+
+void main()
+{
+   gl_FragColor = vec4(
+      ceil_emu(vColor.xyz * 8.0 - vec3(4, 4, 4)) / 8.0 + vec3(0.5, 0.5, 0.5),
+      1);
+}
+
+
+
+
new file mode 100755
--- /dev/null
+++ b/content/canvas/test/webgl/conformance/shaders/glsl-features/ceil-vec3-ref.vert
@@ -0,0 +1,38 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+attribute vec4 aPosition;
+attribute vec2 aTexcoord;
+
+varying vec2 vTexcoord;
+varying vec4 vColor;
+
+float ceil_emu1(float value) {
+  float m = mod(value, 1.0);
+  return m != 0.0 ? (value + 1.0 - m) : value;
+}
+
+vec3 ceil_emu(vec3 value) {
+  return vec3(
+	  ceil_emu1(value.x),
+	  ceil_emu1(value.y),
+	  ceil_emu1(value.z));
+}
+
+void main()
+{
+   gl_Position = aPosition;
+   vTexcoord = aTexcoord;
+   vec4 color = vec4(
+       aTexcoord,
+       aTexcoord.x * aTexcoord.y,
+       (1.0 - aTexcoord.x) * aTexcoord.y * 0.5 + 0.5);
+   vColor = vec4(
+       ceil_emu(color.xyz * 8.0 - vec3(4, 4, 4)) / 8.0 + vec3(0.5, 0.5, 0.5),
+       1);
+}
+
+
+
+
new file mode 100755
--- /dev/null
+++ b/content/canvas/test/webgl/conformance/shaders/glsl-features/ceil-vec3.frag
@@ -0,0 +1,18 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+precision mediump float;
+
+varying vec2 vTexcoord;
+varying vec4 vColor;
+
+void main()
+{
+   gl_FragColor = vec4(
+      ceil(vColor.xyz * 8.0 - vec3(4, 4, 4)) / 8.0 + vec3(0.5, 0.5, 0.5),
+      1);
+}
+
+
+
new file mode 100755
--- /dev/null
+++ b/content/canvas/test/webgl/conformance/shaders/glsl-features/ceil-vec3.vert
@@ -0,0 +1,26 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+attribute vec4 aPosition;
+attribute vec2 aTexcoord;
+
+varying vec2 vTexcoord;
+varying vec4 vColor;
+
+void main()
+{
+   gl_Position = aPosition;
+   vTexcoord = aTexcoord;
+   vec4 color = vec4(
+       aTexcoord,
+       aTexcoord.x * aTexcoord.y,
+       (1.0 - aTexcoord.x) * aTexcoord.y * 0.5 + 0.5);
+   vColor = vec4(
+       ceil(color.xyz * 8.0 - vec3(4, 4, 4)) / 8.0 + vec3(0.5, 0.5, 0.5),
+       1);
+}
+
+
+
+
new file mode 100755
--- /dev/null
+++ b/content/canvas/test/webgl/conformance/shaders/glsl-features/ceil-vec4-ref.frag
@@ -0,0 +1,31 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+precision mediump float;
+
+varying vec2 vTexcoord;
+varying vec4 vColor;
+
+float ceil_emu1(float value) {
+  float m = mod(value, 1.0);
+  return m != 0.0 ? (value + 1.0 - m) : value;
+}
+
+vec4 ceil_emu(vec4 value) {
+  return vec4(
+	  ceil_emu1(value.x),
+	  ceil_emu1(value.y),
+	  ceil_emu1(value.z),
+	  ceil_emu1(value.w));
+}
+
+void main()
+{
+   gl_FragColor =
+      ceil_emu(vColor * 8.0 - vec4(4, 4, 4, 4)) / 8.0 + vec4(0.5, 0.5, 0.5, 0.5);
+}
+
+
+
+
new file mode 100755
--- /dev/null
+++ b/content/canvas/test/webgl/conformance/shaders/glsl-features/ceil-vec4-ref.vert
@@ -0,0 +1,38 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+attribute vec4 aPosition;
+attribute vec2 aTexcoord;
+
+varying vec2 vTexcoord;
+varying vec4 vColor;
+
+float ceil_emu1(float value) {
+  float m = mod(value, 1.0);
+  return m != 0.0 ? (value + 1.0 - m) : value;
+}
+
+vec4 ceil_emu(vec4 value) {
+  return vec4(
+	  ceil_emu1(value.x),
+	  ceil_emu1(value.y),
+	  ceil_emu1(value.z),
+	  ceil_emu1(value.w));
+}
+
+void main()
+{
+   gl_Position = aPosition;
+   vTexcoord = aTexcoord;
+   vec4 color = vec4(
+       aTexcoord,
+       aTexcoord.x * aTexcoord.y,
+       (1.0 - aTexcoord.x) * aTexcoord.y * 0.5 + 0.5);
+   vColor = ceil_emu(
+       color * 8.0 - vec4(4, 4, 4, 4)) / 8.0 + vec4(0.5, 0.5, 0.5, 0.5);
+}
+
+
+
+
new file mode 100755
--- /dev/null
+++ b/content/canvas/test/webgl/conformance/shaders/glsl-features/ceil-vec4.frag
@@ -0,0 +1,17 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+precision mediump float;
+
+varying vec2 vTexcoord;
+varying vec4 vColor;
+
+void main()
+{
+   gl_FragColor =
+      ceil(vColor * 8.0 - vec4(4, 4, 4, 4)) / 8.0 + vec4(0.5, 0.5, 0.5, 0.5);
+}
+
+
+
new file mode 100755
--- /dev/null
+++ b/content/canvas/test/webgl/conformance/shaders/glsl-features/ceil-vec4.vert
@@ -0,0 +1,25 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+attribute vec4 aPosition;
+attribute vec2 aTexcoord;
+
+varying vec2 vTexcoord;
+varying vec4 vColor;
+
+void main()
+{
+   gl_Position = aPosition;
+   vTexcoord = aTexcoord;
+   vec4 color = vec4(
+       aTexcoord,
+       aTexcoord.x * aTexcoord.y,
+       (1.0 - aTexcoord.x) * aTexcoord.y * 0.5 + 0.5);
+   vColor = ceil(
+       color * 8.0 - vec4(4, 4, 4, 4)) / 8.0 + vec4(0.5, 0.5, 0.5, 0.5);
+}
+
+
+
+
new file mode 100755
--- /dev/null
+++ b/content/canvas/test/webgl/conformance/shaders/glsl-features/ceil.frag
@@ -0,0 +1,18 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+precision mediump float;
+
+varying vec2 vTexcoord;
+varying vec4 vColor;
+
+void main()
+{
+   gl_FragColor = vec4(
+      ceil(vColor.x * 8.0 - 4.0) / 8.0 + 0.5,
+      0, 0, 1);
+}
+
+
+
new file mode 100755
--- /dev/null
+++ b/content/canvas/test/webgl/conformance/shaders/glsl-features/ceil.vert
@@ -0,0 +1,28 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+attribute vec4 aPosition;
+attribute vec2 aTexcoord;
+
+varying vec2 vTexcoord;
+varying vec4 vColor;
+
+void main()
+{
+   gl_Position = aPosition;
+   vTexcoord = aTexcoord;
+   vec4 color = vec4(
+       aTexcoord,
+       aTexcoord.x * aTexcoord.y,
+       (1.0 - aTexcoord.x) * aTexcoord.y * 0.5 + 0.5);
+   vColor = vec4(
+       ceil(color.x * 8.0 - 4.0) / 8.0 + 0.5,
+       0,
+       0,
+       1);
+}
+
+
+
+
new file mode 100755
--- /dev/null
+++ b/content/canvas/test/webgl/conformance/shaders/glsl-features/floor-ref.frag
@@ -0,0 +1,23 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+precision mediump float;
+
+varying vec2 vTexcoord;
+varying vec4 vColor;
+
+float floor_emu(float value) {
+  return value - mod(value, 1.0);
+}
+
+void main()
+{
+   gl_FragColor = vec4(
+      floor_emu(vColor.x * 8.0 - 4.0) / 8.0 + 0.5,
+      0, 0, 1);
+}
+
+
+
+
new file mode 100755
--- /dev/null
+++ b/content/canvas/test/webgl/conformance/shaders/glsl-features/floor-ref.vert
@@ -0,0 +1,32 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+attribute vec4 aPosition;
+attribute vec2 aTexcoord;
+
+varying vec2 vTexcoord;
+varying vec4 vColor;
+
+float floor_emu(float value) {
+  return value - mod(value, 1.0);
+}
+
+void main()
+{
+   gl_Position = aPosition;
+   vTexcoord = aTexcoord;
+   vec4 color = vec4(
+       aTexcoord,
+       aTexcoord.x * aTexcoord.y,
+       (1.0 - aTexcoord.x) * aTexcoord.y * 0.5 + 0.5);
+   vColor = vec4(
+       floor_emu(color.x * 8.0 - 4.0) / 8.0 + 0.5,
+       0,
+       0,
+       1);
+}
+
+
+
+
new file mode 100755
--- /dev/null
+++ b/content/canvas/test/webgl/conformance/shaders/glsl-features/floor-vec2-ref.frag
@@ -0,0 +1,29 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+precision mediump float;
+
+varying vec2 vTexcoord;
+varying vec4 vColor;
+
+float floor_emu1(float value) {
+  return value - mod(value, 1.0);
+}
+
+vec2 floor_emu(vec2 value) {
+  return vec2(
+	  floor_emu1(value.x),
+	  floor_emu1(value.y));
+}
+
+void main()
+{
+   gl_FragColor = vec4(
+      floor_emu(vColor.xy * 8.0 - vec2(4, 4)) / 8.0 + vec2(0.5, 0.5),
+      0, 1);
+}
+
+
+
+
new file mode 100755
--- /dev/null
+++ b/content/canvas/test/webgl/conformance/shaders/glsl-features/floor-vec2-ref.vert
@@ -0,0 +1,37 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+attribute vec4 aPosition;
+attribute vec2 aTexcoord;
+
+varying vec2 vTexcoord;
+varying vec4 vColor;
+
+float floor_emu1(float value) {
+  return value - mod(value, 1.0);
+}
+
+vec2 floor_emu(vec2 value) {
+  return vec2(
+	  floor_emu1(value.x),
+	  floor_emu1(value.y));
+}
+
+void main()
+{
+   gl_Position = aPosition;
+   vTexcoord = aTexcoord;
+   vec4 color = vec4(
+       aTexcoord,
+       aTexcoord.x * aTexcoord.y,
+       (1.0 - aTexcoord.x) * aTexcoord.y * 0.5 + 0.5);
+   vColor = vec4(
+       floor(color.xy * 8.0 - vec2(4, 4)) / 8.0 + vec2(0.5, 0.5),
+       0,
+       1);
+}
+
+
+
+
new file mode 100755
--- /dev/null
+++ b/content/canvas/test/webgl/conformance/shaders/gls