texImage2D for a half-float texture only accepts null
https://bugs.webkit.org/show_bug.cgi?id=169999
<rdar://problem/31713571>

Reviewed by Simon Fraser.

Source/WebCore:

After we initially implemented this, the extension was
modified such that texImage2D could upload to half-float
from a Uint16 array.

Test: fast/canvas/webgl/oes-texture-half-float-uint16.html

* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::validateArrayBufferType): Accept
Uint16.

LayoutTests:

Add a new test, and update the expected results of existing tests.

* fast/canvas/webgl/oes-texture-half-float-uint16-expected.txt: Added.
* fast/canvas/webgl/oes-texture-half-float-uint16.html: Added.
* webgl/2.0.0/conformance/extensions/oes-texture-half-float-expected.txt:
* webgl/2.0.0/conformance2/extensions/ext-color-buffer-float-expected.txt:
* webgl/2.0.0/conformance2/textures/misc/tex-new-formats-expected.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@251303 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index b83fc6a45..bb1ab46 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,19 @@
+2019-10-17  Dean Jackson  <dino@apple.com>
+
+        texImage2D for a half-float texture only accepts null
+        https://bugs.webkit.org/show_bug.cgi?id=169999
+        <rdar://problem/31713571>
+
+        Reviewed by Simon Fraser.
+
+        Add a new test, and update the expected results of existing tests.
+
+        * fast/canvas/webgl/oes-texture-half-float-uint16-expected.txt: Added.
+        * fast/canvas/webgl/oes-texture-half-float-uint16.html: Added.
+        * webgl/2.0.0/conformance/extensions/oes-texture-half-float-expected.txt:
+        * webgl/2.0.0/conformance2/extensions/ext-color-buffer-float-expected.txt:
+        * webgl/2.0.0/conformance2/textures/misc/tex-new-formats-expected.txt:
+
 2019-10-18  Daniel Bates  <dabates@apple.com>
 
         fast/events/ios/forward-delete-in-editable.html is a flaky failure
diff --git a/LayoutTests/fast/canvas/webgl/oes-texture-half-float-expected.txt b/LayoutTests/fast/canvas/webgl/oes-texture-half-float-expected.txt
index da99dea..fbac906 100644
--- a/LayoutTests/fast/canvas/webgl/oes-texture-half-float-expected.txt
+++ b/LayoutTests/fast/canvas/webgl/oes-texture-half-float-expected.txt
@@ -1,23 +1,19 @@
-CONSOLE MESSAGE: line 192: WebGL: INVALID_ENUM: texImage2D: invalid texture type
-CONSOLE MESSAGE: line 192: WebGL: INVALID_OPERATION: texImage2D: type HALF_FLOAT_OES but ArrayBufferView is not NULL
-CONSOLE MESSAGE: line 192: WebGL: INVALID_OPERATION: texImage2D: type HALF_FLOAT_OES but ArrayBufferView is not NULL
-CONSOLE MESSAGE: line 192: WebGL: INVALID_OPERATION: texImage2D: type HALF_FLOAT_OES but ArrayBufferView is not NULL
-CONSOLE MESSAGE: line 192: WebGL: INVALID_OPERATION: texImage2D: type HALF_FLOAT_OES but ArrayBufferView is not NULL
-CONSOLE MESSAGE: line 192: WebGL: INVALID_OPERATION: texImage2D: type HALF_FLOAT_OES but ArrayBufferView is not NULL
-CONSOLE MESSAGE: line 192: WebGL: INVALID_OPERATION: texImage2D: type HALF_FLOAT_OES but ArrayBufferView is not NULL
-CONSOLE MESSAGE: line 192: WebGL: INVALID_OPERATION: texImage2D: type HALF_FLOAT_OES but ArrayBufferView is not NULL
-CONSOLE MESSAGE: line 192: WebGL: INVALID_OPERATION: texImage2D: type HALF_FLOAT_OES but ArrayBufferView is not NULL
-CONSOLE MESSAGE: line 192: WebGL: INVALID_OPERATION: texImage2D: type HALF_FLOAT_OES but ArrayBufferView is not NULL
-CONSOLE MESSAGE: line 192: WebGL: INVALID_OPERATION: texImage2D: type HALF_FLOAT_OES but ArrayBufferView is not NULL
-CONSOLE MESSAGE: line 192: WebGL: INVALID_OPERATION: texImage2D: type HALF_FLOAT_OES but ArrayBufferView is not NULL
-CONSOLE MESSAGE: line 192: WebGL: INVALID_OPERATION: texImage2D: type HALF_FLOAT_OES but ArrayBufferView is not NULL
-CONSOLE MESSAGE: line 192: WebGL: INVALID_OPERATION: texImage2D: type HALF_FLOAT_OES but ArrayBufferView is not NULL
-CONSOLE MESSAGE: line 192: WebGL: INVALID_OPERATION: texImage2D: type HALF_FLOAT_OES but ArrayBufferView is not NULL
-CONSOLE MESSAGE: line 192: WebGL: INVALID_OPERATION: texImage2D: type HALF_FLOAT_OES but ArrayBufferView is not NULL
+CONSOLE MESSAGE: line 248: WebGL: INVALID_ENUM: texImage2D: invalid texture type
+CONSOLE MESSAGE: line 248: WebGL: INVALID_OPERATION: texImage2D: ArrayBufferView not TypeUint16
+CONSOLE MESSAGE: line 248: WebGL: INVALID_OPERATION: texImage2D: ArrayBufferView not TypeUint16
+CONSOLE MESSAGE: line 248: WebGL: INVALID_OPERATION: texImage2D: ArrayBufferView not TypeUint16
+CONSOLE MESSAGE: line 248: WebGL: INVALID_OPERATION: texImage2D: ArrayBufferView not TypeUint16
+CONSOLE MESSAGE: line 248: WebGL: INVALID_OPERATION: texImage2D: ArrayBufferView not TypeUint16
+CONSOLE MESSAGE: line 248: WebGL: INVALID_OPERATION: texImage2D: ArrayBufferView not TypeUint16
+CONSOLE MESSAGE: line 248: WebGL: INVALID_OPERATION: texImage2D: ArrayBufferView not TypeUint16
+CONSOLE MESSAGE: line 248: WebGL: INVALID_OPERATION: texImage2D: ArrayBufferView not TypeUint16
+CONSOLE MESSAGE: line 248: WebGL: INVALID_OPERATION: texImage2D: ArrayBufferView not TypeUint16
+CONSOLE MESSAGE: line 248: WebGL: INVALID_OPERATION: texImage2D: ArrayBufferView not TypeUint16
 This test verifies the functionality of OES_texture_half_float with null/non-null ArrayBufferView
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
+ 
 
 PASS WebGL context exists
 Testing texture creation with extension disabled, format RGBA, and data null. Expect Failure
@@ -27,74 +23,124 @@
 Testing texture creation with extension enabled, format RGBA, and data null. Expect Success
 PASS getError was expected value: NO_ERROR : texture parameter setup should succeed
 PASS getError was expected value: NO_ERROR : Half floating point texture allocation should succeed if OES_texture_half_float is enabled
+PASS Color was 255,0,0,255
+FAIL should be black
+at (0, 0) expected: 0,0,0,255 was 255,0,0,255
 Testing texture creation with extension enabled, format RGB, and data null. Expect Success
 PASS getError was expected value: NO_ERROR : texture parameter setup should succeed
 PASS getError was expected value: NO_ERROR : Half floating point texture allocation should succeed if OES_texture_half_float is enabled
+PASS Color was 255,0,0,255
+FAIL should be black
+at (0, 0) expected: 0,0,0,255 was 255,0,0,255
 Testing texture creation with extension enabled, format LUMINANCE, and data null. Expect Success
 PASS getError was expected value: NO_ERROR : texture parameter setup should succeed
 PASS getError was expected value: NO_ERROR : Half floating point texture allocation should succeed if OES_texture_half_float is enabled
+PASS Color was 255,255,255,255
+FAIL should be black
+at (0, 0) expected: 0,0,0,255 was 255,255,255,255
 Testing texture creation with extension enabled, format ALPHA, and data null. Expect Success
 PASS getError was expected value: NO_ERROR : texture parameter setup should succeed
 PASS getError was expected value: NO_ERROR : Half floating point texture allocation should succeed if OES_texture_half_float is enabled
+PASS Color was 0,0,0,255
+PASS should be black
 Testing texture creation with extension enabled, format LUMINANCE_ALPHA, and data null. Expect Success
 PASS getError was expected value: NO_ERROR : texture parameter setup should succeed
 PASS getError was expected value: NO_ERROR : Half floating point texture allocation should succeed if OES_texture_half_float is enabled
+PASS Color was 255,255,255,255
+FAIL should be black
+at (0, 0) expected: 0,0,0,255 was 255,255,255,255
 Testing texture creation with extension enabled, format RGBA, and data non-null. Expect Failure
 PASS getError was expected value: NO_ERROR : texture parameter setup should succeed
-PASS getError was expected value: INVALID_OPERATION : Half floating point texture allocation must be disallowed when ArrayBufferView is not-null
+PASS getError was expected value: INVALID_OPERATION : Half floating point texture allocation must be disallowed when ArrayBufferView is not-null and not-Uint16
 Testing texture creation with extension enabled, format RGBA, and data non-null. Expect Failure
 PASS getError was expected value: NO_ERROR : texture parameter setup should succeed
-PASS getError was expected value: INVALID_OPERATION : Half floating point texture allocation must be disallowed when ArrayBufferView is not-null
-Testing texture creation with extension enabled, format RGBA, and data non-null. Expect Failure
-PASS getError was expected value: NO_ERROR : texture parameter setup should succeed
-PASS getError was expected value: INVALID_OPERATION : Half floating point texture allocation must be disallowed when ArrayBufferView is not-null
+PASS getError was expected value: INVALID_OPERATION : Half floating point texture allocation must be disallowed when ArrayBufferView is not-null and not-Uint16
 Testing texture creation with extension enabled, format RGB, and data non-null. Expect Failure
 PASS getError was expected value: NO_ERROR : texture parameter setup should succeed
-PASS getError was expected value: INVALID_OPERATION : Half floating point texture allocation must be disallowed when ArrayBufferView is not-null
+PASS getError was expected value: INVALID_OPERATION : Half floating point texture allocation must be disallowed when ArrayBufferView is not-null and not-Uint16
 Testing texture creation with extension enabled, format RGB, and data non-null. Expect Failure
 PASS getError was expected value: NO_ERROR : texture parameter setup should succeed
-PASS getError was expected value: INVALID_OPERATION : Half floating point texture allocation must be disallowed when ArrayBufferView is not-null
-Testing texture creation with extension enabled, format RGB, and data non-null. Expect Failure
-PASS getError was expected value: NO_ERROR : texture parameter setup should succeed
-PASS getError was expected value: INVALID_OPERATION : Half floating point texture allocation must be disallowed when ArrayBufferView is not-null
+PASS getError was expected value: INVALID_OPERATION : Half floating point texture allocation must be disallowed when ArrayBufferView is not-null and not-Uint16
 Testing texture creation with extension enabled, format LUMINANCE, and data non-null. Expect Failure
 PASS getError was expected value: NO_ERROR : texture parameter setup should succeed
-PASS getError was expected value: INVALID_OPERATION : Half floating point texture allocation must be disallowed when ArrayBufferView is not-null
+PASS getError was expected value: INVALID_OPERATION : Half floating point texture allocation must be disallowed when ArrayBufferView is not-null and not-Uint16
 Testing texture creation with extension enabled, format LUMINANCE, and data non-null. Expect Failure
 PASS getError was expected value: NO_ERROR : texture parameter setup should succeed
-PASS getError was expected value: INVALID_OPERATION : Half floating point texture allocation must be disallowed when ArrayBufferView is not-null
-Testing texture creation with extension enabled, format LUMINANCE, and data non-null. Expect Failure
-PASS getError was expected value: NO_ERROR : texture parameter setup should succeed
-PASS getError was expected value: INVALID_OPERATION : Half floating point texture allocation must be disallowed when ArrayBufferView is not-null
+PASS getError was expected value: INVALID_OPERATION : Half floating point texture allocation must be disallowed when ArrayBufferView is not-null and not-Uint16
 Testing texture creation with extension enabled, format ALPHA, and data non-null. Expect Failure
 PASS getError was expected value: NO_ERROR : texture parameter setup should succeed
-PASS getError was expected value: INVALID_OPERATION : Half floating point texture allocation must be disallowed when ArrayBufferView is not-null
+PASS getError was expected value: INVALID_OPERATION : Half floating point texture allocation must be disallowed when ArrayBufferView is not-null and not-Uint16
 Testing texture creation with extension enabled, format ALPHA, and data non-null. Expect Failure
 PASS getError was expected value: NO_ERROR : texture parameter setup should succeed
-PASS getError was expected value: INVALID_OPERATION : Half floating point texture allocation must be disallowed when ArrayBufferView is not-null
-Testing texture creation with extension enabled, format ALPHA, and data non-null. Expect Failure
-PASS getError was expected value: NO_ERROR : texture parameter setup should succeed
-PASS getError was expected value: INVALID_OPERATION : Half floating point texture allocation must be disallowed when ArrayBufferView is not-null
+PASS getError was expected value: INVALID_OPERATION : Half floating point texture allocation must be disallowed when ArrayBufferView is not-null and not-Uint16
 Testing texture creation with extension enabled, format LUMINANCE_ALPHA, and data non-null. Expect Failure
 PASS getError was expected value: NO_ERROR : texture parameter setup should succeed
-PASS getError was expected value: INVALID_OPERATION : Half floating point texture allocation must be disallowed when ArrayBufferView is not-null
+PASS getError was expected value: INVALID_OPERATION : Half floating point texture allocation must be disallowed when ArrayBufferView is not-null and not-Uint16
 Testing texture creation with extension enabled, format LUMINANCE_ALPHA, and data non-null. Expect Failure
 PASS getError was expected value: NO_ERROR : texture parameter setup should succeed
-PASS getError was expected value: INVALID_OPERATION : Half floating point texture allocation must be disallowed when ArrayBufferView is not-null
-Testing texture creation with extension enabled, format LUMINANCE_ALPHA, and data non-null. Expect Failure
+PASS getError was expected value: INVALID_OPERATION : Half floating point texture allocation must be disallowed when ArrayBufferView is not-null and not-Uint16
+Testing texture creation with extension enabled, format RGBA, and data non-null. Expect Success
 PASS getError was expected value: NO_ERROR : texture parameter setup should succeed
-PASS getError was expected value: INVALID_OPERATION : Half floating point texture allocation must be disallowed when ArrayBufferView is not-null
+PASS getError was expected value: NO_ERROR : Half floating point texture allocation should succeed if OES_texture_half_float is enabled
+PASS Color was 85,85,85,85
+FAIL should be black
+at (0, 0) expected: 0,0,0,255 was 85,85,85,85
+Testing texture creation with extension enabled, format RGB, and data non-null. Expect Success
+PASS getError was expected value: NO_ERROR : texture parameter setup should succeed
+PASS getError was expected value: NO_ERROR : Half floating point texture allocation should succeed if OES_texture_half_float is enabled
+PASS Color was 85,85,85,255
+FAIL should be black
+at (0, 0) expected: 0,0,0,255 was 85,85,85,255
+Testing texture creation with extension enabled, format LUMINANCE, and data non-null. Expect Success
+PASS getError was expected value: NO_ERROR : texture parameter setup should succeed
+PASS getError was expected value: NO_ERROR : Half floating point texture allocation should succeed if OES_texture_half_float is enabled
+PASS Color was 85,85,85,255
+FAIL should be black
+at (0, 0) expected: 0,0,0,255 was 85,85,85,255
+Testing texture creation with extension enabled, format ALPHA, and data non-null. Expect Success
+PASS getError was expected value: NO_ERROR : texture parameter setup should succeed
+PASS getError was expected value: NO_ERROR : Half floating point texture allocation should succeed if OES_texture_half_float is enabled
+PASS Color was 0,0,0,85
+FAIL should be black
+at (0, 0) expected: 0,0,0,255 was 0,0,0,85
+Testing texture creation with extension enabled, format LUMINANCE_ALPHA, and data non-null. Expect Success
+PASS getError was expected value: NO_ERROR : texture parameter setup should succeed
+PASS getError was expected value: NO_ERROR : Half floating point texture allocation should succeed if OES_texture_half_float is enabled
+PASS Color was 85,85,85,85
+FAIL should be black
+at (0, 0) expected: 0,0,0,255 was 85,85,85,85
 
-Testing half floating point render target
+Testing half floating point RGBA from a Uint16Array
+PASS getError was expected value: NO_ERROR : texture parameter setup should succeed
+PASS getError was expected value: NO_ERROR : Half floating point texture allocation should succeed if OES_texture_half_float is enabled
+PASS getError was expected value: NO_ERROR : rendering from half floating point texture should succeed
+PASS should be green
+
+Testing half floating point RGB from a Uint16Array
+PASS getError was expected value: NO_ERROR : texture parameter setup should succeed
+PASS getError was expected value: NO_ERROR : Half floating point texture allocation should succeed if OES_texture_half_float is enabled
+PASS getError was expected value: NO_ERROR : rendering from half floating point texture should succeed
+PASS should be green
+
+Testing half floating point RGBA render target
 PASS getError was expected value: NO_ERROR : texture parameter setup should succeed
 PASS getError was expected value: NO_ERROR : Half floating point texture allocation should succeed if OES_texture_half_float is enabled
 PASS getError was expected value: NO_ERROR : Rendering to half floating point texture should succeed
 PASS getError was expected value: NO_ERROR : rendering from half floating point texture should succeed
 PASS should be green
+
+Testing half floating point RGB render target
+PASS getError was expected value: NO_ERROR : texture parameter setup should succeed
+PASS getError was expected value: NO_ERROR : Half floating point texture allocation should succeed if OES_texture_half_float is enabled
+PASS getError was expected value: NO_ERROR : Rendering to half floating point texture should succeed
+PASS getError was expected value: NO_ERROR : rendering from half floating point texture should succeed
+PASS should be green
+
 Testing that getExtension() returns the same object each time
 PASS gl.getExtension("OES_texture_half_float").myProperty is 2
 
 PASS successfullyParsed is true
+Some tests failed.
 
 TEST COMPLETE
 
diff --git a/LayoutTests/fast/canvas/webgl/oes-texture-half-float-uint16-expected.txt b/LayoutTests/fast/canvas/webgl/oes-texture-half-float-uint16-expected.txt
new file mode 100644
index 0000000..cf20c34
--- /dev/null
+++ b/LayoutTests/fast/canvas/webgl/oes-texture-half-float-uint16-expected.txt
@@ -0,0 +1 @@
+No error
diff --git a/LayoutTests/fast/canvas/webgl/oes-texture-half-float-uint16.html b/LayoutTests/fast/canvas/webgl/oes-texture-half-float-uint16.html
new file mode 100644
index 0000000..957ba7d
--- /dev/null
+++ b/LayoutTests/fast/canvas/webgl/oes-texture-half-float-uint16.html
@@ -0,0 +1,26 @@
+<canvas width="1" height="1"></canvas>
+<p></p>
+<script>
+if (window.testRunner) {
+    window.testRunner.dumpAsText();
+}
+
+const canvas = document.querySelector("canvas");
+const gl = canvas.getContext("webgl");
+
+const texture = gl.createTexture();
+gl.bindTexture(gl.TEXTURE_2D, texture);
+
+const data = new Uint16Array(4);
+
+const halfFloat = gl.getExtension("OES_texture_half_float");
+
+gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, halfFloat.HALF_FLOAT_OES, data);
+
+const p = document.querySelector("p");
+if (gl.getError() != gl.NO_ERROR) {
+    p.textContent = "Saw an error";
+} else {
+    p.textContent = "No error";
+}
+</script>
diff --git a/LayoutTests/fast/canvas/webgl/oes-texture-half-float.html b/LayoutTests/fast/canvas/webgl/oes-texture-half-float.html
index c4e51fe..a2fdf4c 100644
--- a/LayoutTests/fast/canvas/webgl/oes-texture-half-float.html
+++ b/LayoutTests/fast/canvas/webgl/oes-texture-half-float.html
@@ -33,11 +33,11 @@
 <script src="resources/desktop-gl-constants.js" type="text/javascript"></script>
 <script src="../../../resources/js-test.js"></script>
 <script src="resources/webgl-test.js"></script>
-<script src="resources/webgl-test-utils.js"></script>
-</head>
+<script src="resources/webgl-test-utils.js"></script></head>
 <body>
 <div id="description"></div>
 <canvas id="canvas" style="width: 50px; height: 50px;"> </canvas>
+<canvas id="canvas2d" style="width: 50px; height: 50px;"> </canvas>
 <div id="console"></div>
 <script id="testFragmentShader" type="x-shader/x-fragment">
 precision mediump float;
@@ -72,12 +72,21 @@
 }
 </script>
 <script>
+if (window.testRunner)
+    window.testRunner.dumpAsText();
+
 "use strict"
 description("This test verifies the functionality of OES_texture_half_float with null/non-null ArrayBufferView");
 
 debug("");
 var wtu = WebGLTestUtils;
 var canvas = document.getElementById("canvas");
+var colorCanvas = document.getElementById("canvas2d");
+colorCanvas.width = 2;
+colorCanvas.height = 2;
+var ctx = colorCanvas.getContext("2d");
+ctx.fillStyle = "rgb(255,0,0)";
+ctx.fillRect(0, 0, 2, 2);
 var gl = wtu.create3DContext(canvas);
 // This constant must be defined in order to run the texture creation test without the extension enabled.
 var halfFloatOESEnum = 0x8D61;
@@ -90,47 +99,94 @@
 
     // Verify that allocation of texture fails if extension is not enabled
     runTextureCreationTest(false);
-
-    if (!(ext = gl.getExtension("OES_texture_half_float"))) {
+    ext = gl.getExtension("OES_texture_half_float")
+    if (!ext) {
         testPassed("No OES_texture_half_float support. This is legal");
     } else {
         testPassed("Successfully enabled OES_texture_half_float extension");
 
-        // Check if creation of texture succeed's with various formats and null ArrayBufferView
-        var formats = [gl.RGBA, gl.RGB, gl.LUMINANCE, gl.ALPHA, gl.LUMINANCE_ALPHA];
-        for (var i = 0; i < formats.length; i++) {
-            runTextureCreationTest(true, formats[i], null);
-        }
+        var program = wtu.setupTexturedQuad(gl);
 
-        // Texture creation should fail when passed with non-null ArrayBufferView
-        for (var i = 0; i < formats.length; i++) {
+        // Check if creation of texture succeed's with various formats and null ArrayBufferView
+        var formats = [
+          { format: gl.RGBA,            expected: [255,   0,   0, 255], },
+          { format: gl.RGB,             expected: [255,   0,   0, 255], },
+          { format: gl.LUMINANCE,       expected: [255, 255, 255, 255], },
+          { format: gl.ALPHA,           expected: [  0,   0,   0, 255], },
+          { format: gl.LUMINANCE_ALPHA, expected: [255, 255, 255, 255], },
+        ];
+        formats.forEach(function(f) {
+            runTextureCreationTest(true, f.format, null, f.expected);
+        });
+        
+        // Texture creation should fail when passed with non-null, non-Uint16 ArrayBufferView
+        formats.forEach(function(f) {
             var width = 2;
             var height = 2;
-
+            var format = f.format;
+            
             // Float32Array
-            var float32Data = new Float32Array(width * height * getNumberOfChannels(formats[i]));
+            var float32Data = new Float32Array(width * height * getNumberOfChannels(format));
             for (var ii = 0; ii < float32Data.length; ii++) {
                 float32Data[ii] = 1000;
             }
-            runTextureCreationTest(true, formats[i], float32Data);
+            runTextureCreationTest(true, format, float32Data, null);
 
             // Int16Array
-            var int16Data = new Int16Array(width * height * getNumberOfChannels(formats[i]));
+            var int16Data = new Int16Array(width * height * getNumberOfChannels(format));
             for (var ii = 0; ii <  int16Data.length; ii++) {
                 int16Data[ii] = 1000;
             }
-            runTextureCreationTest(true, formats[i], int16Data);
+            runTextureCreationTest(true, format, int16Data, null);
+        });
 
-            // Uint16Array
-            var uint16Data = new Uint16Array(width * height * getNumberOfChannels(formats[i]));
+        // Test that Uint16 encoded half float values can be used as texture data.
+        
+        // First test that values in the 0-1 range can be written and read.
+        var halfFloatOneThird = 0x3555; // Half float 1/3
+        var uint16Formats = [
+          { format: gl.RGBA,            expected: [85, 85, 85,  85], },
+          { format: gl.RGB,             expected: [85, 85, 85, 255], },
+          { format: gl.LUMINANCE,       expected: [85, 85, 85, 255], },
+          { format: gl.ALPHA,           expected: [ 0,  0,  0,  85], },
+          { format: gl.LUMINANCE_ALPHA, expected: [85, 85, 85,  85], },
+        ];
+
+        uint16Formats.forEach(function(f) {
+            var width = 2;
+            var height = 2;
+            var format = f.format;
+
+            var uint16Data = new Uint16Array(width * height * getNumberOfChannels(format));
             for (var ii = 0; ii <  uint16Data.length; ii++) {
-                uint16Data[ii] = 1000;
+                uint16Data[ii] = halfFloatOneThird;
             }
-            runTextureCreationTest(true, formats[i], uint16Data);
-        }
+            runTextureCreationTest(true, format, uint16Data, f.expected);
+        });
+
+        // Next check that values outside the 0-1 range can be written.
+        var halfFloatTenK = 0x70E2; // Half float 10000
+        var uint16Formats2 = [
+          { format: gl.RGBA, subtractor: [10000, 10000, 10000, 10000], },
+          { format: gl.RGB,  subtractor: [10000, 10000, 10000, 1], },
+        ];
+
+        uint16Formats2.forEach(function(f) {
+            var width = 2;
+            var height = 2;
+            var format = f.format;
+
+            var uint16Data = new Uint16Array(width * height * getNumberOfChannels(format));
+            for (var ii = 0; ii <  uint16Data.length; ii++) {
+                uint16Data[ii] = halfFloatTenK;
+            }
+            runRenderTest(format, f.subtractor, uint16Data);
+        });
 
         // Check if attaching texture as FBO target succeeds (Not mandatory)
-        runRenderTargetTest();
+        runRenderTest(gl.RGBA, [10000, 10000, 10000, 10000], null);
+        runRenderTest(gl.RGB, [10000, 10000, 10000, 1], null);
+
         // Check of getExtension() returns same object
         runUniqueObjectTest();
     }
@@ -170,35 +226,46 @@
     gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
     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, "texture parameter setup should succeed");
+    wtu.glErrorShouldBe(gl, gl.NO_ERROR, "texture parameter setup should succeed");
     return texture;
 }
 
-function runTextureCreationTest(extensionEnabled, opt_format, opt_data)
+function runTextureCreationTest(extensionEnabled, opt_format, opt_data, opt_expected)
 {
     var format = opt_format || gl.RGBA;
     var data = opt_data || null;
     var expectSuccess = true;
-
-    if (!extensionEnabled || data)
+    
+    if (!extensionEnabled || !opt_expected)
         expectSuccess = false;
     debug("Testing texture creation with extension " + (extensionEnabled ? "enabled" : "disabled") +
           ", format " + getFormatName(format) + ", and data " + (data ? "non-null" : "null") +
-          ". Expect " + (expectSuccess ? "Success" : "Failure"));
+          ". Expect " + (expectSuccess ? "Success" : "Failure"));   
 
     var texture = allocateTexture();
     var width = 2;
     var height = 2;
     gl.texImage2D(gl.TEXTURE_2D, 0, format, width, height, 0, format, halfFloatOESEnum, data);
     if(!extensionEnabled) {
-        glErrorShouldBe(gl, gl.INVALID_ENUM, "Half floating point texture must be disallowed if OES_texture_half_float isn't enabled");
+        wtu.glErrorShouldBe(gl, gl.INVALID_ENUM, "Half floating point texture must be disallowed if OES_texture_half_float isn't enabled");
         return;
-    } else if (data) {
-        glErrorShouldBe(gl, gl.INVALID_OPERATION, "Half floating point texture allocation must be disallowed when ArrayBufferView is not-null");
+    } else if (!opt_expected) {
+        wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "Half floating point texture allocation must be disallowed when ArrayBufferView is not-null and not-Uint16");
         return;
     } else {
-        glErrorShouldBe(gl, gl.NO_ERROR, "Half floating point texture allocation should succeed if OES_texture_half_float is enabled");
+        wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Half floating point texture allocation should succeed if OES_texture_half_float is enabled");
+
+        if (!data) {
+            gl.texImage2D(gl.TEXTURE_2D, 0, format, format, halfFloatOESEnum, colorCanvas);
+        }
+        wtu.clearAndDrawUnitQuad(gl);
+        wtu.checkCanvas(gl, opt_expected);
+        // Check that linear fails.
+        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
+        wtu.clearAndDrawUnitQuad(gl);
+        wtu.checkCanvas(gl, [0, 0, 0, 255], "should be black");
     }
+
 }
 
 function checkRenderingResults()
@@ -206,39 +273,48 @@
     wtu.checkCanvas(gl, [0, 255, 0, 255], "should be green");
 }
 
-function runRenderTargetTest(testProgram)
+function runRenderTest(format, subtractor, data)
 {
+    var formatString = wtu.glEnumToString(gl, format);
+
     debug("");
-    debug("Testing half floating point render target");
+
+    if (!data) {
+        debug("Testing half floating point " + formatString + " render target");
+    } else {
+        debug("Testing half floating point " + formatString + " from a Uint16Array");
+    }
 
     var texture = allocateTexture();
     var width = 2;
     var height = 2;
 
-    gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, ext.HALF_FLOAT_OES, null);
-    glErrorShouldBe(gl, gl.NO_ERROR, "Half floating point texture allocation should succeed if OES_texture_half_float is enabled");
+    gl.texImage2D(gl.TEXTURE_2D, 0, format, width, height, 0, format, ext.HALF_FLOAT_OES, data);
+    wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Half floating point texture allocation should succeed if OES_texture_half_float is enabled");
 
-    // Try to use this texture as render target
-    var fbo = gl.createFramebuffer();
-    gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
-    gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);
-    gl.bindTexture(gl.TEXTURE_2D, null);
+    if (!data) {
+        // Try to use this texture as render target
+        var fbo = gl.createFramebuffer();
+        gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+        gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);
+        gl.bindTexture(gl.TEXTURE_2D, null);
 
-    // It is legal for a WebGL implementation exposing the OES_texture_half_float extension to
-    // support half floating point textures but not as attachments to framebuffer objects.
-    if (gl.checkFramebufferStatus(gl.FRAMEBUFFER) != gl.FRAMEBUFFER_COMPLETE) {
-        debug("Half floating point render targets not supported -- this is legal");
-        return;
+        // It is legal for a WebGL implementation exposing the OES_texture_half_float extension to
+        // support half floating point textures but not as attachments to framebuffer objects.
+        if (gl.checkFramebufferStatus(gl.FRAMEBUFFER) != gl.FRAMEBUFFER_COMPLETE) {
+            debug("Half floating point render targets not supported -- this is legal");
+            return;
+        }
+
+        var renderProgram =
+            wtu.setupProgram(gl,
+                             ["positionVertexShader", "floatingPointFragmentShader"],
+                             ['vPosition'],
+                             [0]);
+        wtu.drawUnitQuad(gl);
+        wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Rendering to half floating point texture should succeed");
     }
 
-    var renderProgram =
-        wtu.setupProgram(gl,
-                         ["positionVertexShader", "floatingPointFragmentShader"],
-                         ['vPosition'],
-                         [0]);
-    wtu.drawQuad(gl);
-    glErrorShouldBe(gl, gl.NO_ERROR, "Rendering to half floating point texture should succeed");
-
     // Now sample from the half floating-point texture and verify we got the correct values.
     var texturedShaders = [
       wtu.setupSimpleTextureVertexShader(gl),
@@ -253,14 +329,15 @@
     gl.bindFramebuffer(gl.FRAMEBUFFER, null);
     gl.bindTexture(gl.TEXTURE_2D, texture);
     gl.useProgram(testProgram);
-    gl.uniform1i(gl.getUniformLocation(testProgram, "tex"), 0);
-    wtu.drawQuad(gl);
-    glErrorShouldBe(gl, gl.NO_ERROR, "rendering from half floating point texture should succeed");
+    gl.uniform4fv(gl.getUniformLocation(testProgram, "subtractor"), subtractor);
+    wtu.drawUnitQuad(gl);
+    wtu.glErrorShouldBe(gl, gl.NO_ERROR, "rendering from half floating point texture should succeed");
     checkRenderingResults();
 }
 
 function runUniqueObjectTest()
 {
+    debug("");
     debug("Testing that getExtension() returns the same object each time");
     gl.getExtension("OES_texture_half_float").myProperty = 2;
     gc();
@@ -268,6 +345,9 @@
 }
 
 debug("");
+var successfullyParsed = true;
 </script>
+<script src="../../resources/js-test-post.js"></script>
+
 </body>
 </html>
diff --git a/LayoutTests/platform/ios-simulator/webgl/2.0.0/conformance2/extensions/ext-color-buffer-float-expected.txt b/LayoutTests/platform/ios-simulator/webgl/2.0.0/conformance2/extensions/ext-color-buffer-float-expected.txt
index 8015c79..d3523a3 100644
--- a/LayoutTests/platform/ios-simulator/webgl/2.0.0/conformance2/extensions/ext-color-buffer-float-expected.txt
+++ b/LayoutTests/platform/ios-simulator/webgl/2.0.0/conformance2/extensions/ext-color-buffer-float-expected.txt
@@ -34,26 +34,26 @@
 [ 31: PASS ] getError was expected value: NO_ERROR : RGB16F texture allocation should succeed
 [ 32: FAIL ] RGB16F render target should not be supported with or without enabling EXT_color_buffer_float
 [ 33: PASS ] getError was expected value: INVALID_ENUM : RGB16F renderbuffer allocation should fail with or without enabling EXT_color_buffer_float
-[ 34: FAIL ] getError expected: NO_ERROR. Was INVALID_OPERATION : Setup framebuffer with texture should succeed.
-[ 35: PASS ] gl.checkFramebufferStatus(gl.FRAMEBUFFER) is gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT
+[ 34: PASS ] getError was expected value: NO_ERROR : Setup framebuffer with texture should succeed.
+[ 35: FAIL ] gl.checkFramebufferStatus(gl.FRAMEBUFFER) should be 36054. Was 36053.
 [ 36: PASS ] getError was one of: INVALID_ENUM or INVALID_FRAMEBUFFER_OPERATION : CopyTexImage2D should fail.
 [ 37: PASS ] getError was expected value: NO_ERROR : Setup framebuffer with texture should succeed.
 [ 38: PASS ] gl.checkFramebufferStatus(gl.FRAMEBUFFER) is gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT
 [ 39: PASS ] getError was one of: INVALID_ENUM or INVALID_FRAMEBUFFER_OPERATION : CopyTexImage2D should fail.
-[ 40: FAIL ] getError expected: NO_ERROR. Was INVALID_OPERATION : Setup framebuffer with texture should succeed.
-[ 41: PASS ] gl.checkFramebufferStatus(gl.FRAMEBUFFER) is gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT
+[ 40: PASS ] getError was expected value: NO_ERROR : Setup framebuffer with texture should succeed.
+[ 41: FAIL ] gl.checkFramebufferStatus(gl.FRAMEBUFFER) should be 36054. Was 36053.
 [ 42: PASS ] getError was one of: INVALID_ENUM or INVALID_FRAMEBUFFER_OPERATION : CopyTexImage2D should fail.
 [ 43: PASS ] getError was expected value: NO_ERROR : Setup framebuffer with texture should succeed.
 [ 44: PASS ] gl.checkFramebufferStatus(gl.FRAMEBUFFER) is gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT
 [ 45: PASS ] getError was one of: INVALID_ENUM or INVALID_FRAMEBUFFER_OPERATION : CopyTexImage2D should fail.
-[ 46: FAIL ] getError expected: NO_ERROR. Was INVALID_OPERATION : Setup framebuffer with texture should succeed.
-[ 47: PASS ] gl.checkFramebufferStatus(gl.FRAMEBUFFER) is gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT
+[ 46: PASS ] getError was expected value: NO_ERROR : Setup framebuffer with texture should succeed.
+[ 47: FAIL ] gl.checkFramebufferStatus(gl.FRAMEBUFFER) should be 36054. Was 36053.
 [ 48: PASS ] getError was one of: INVALID_ENUM or INVALID_FRAMEBUFFER_OPERATION : CopyTexImage2D should fail.
 [ 49: PASS ] getError was expected value: NO_ERROR : Setup framebuffer with texture should succeed.
 [ 50: PASS ] gl.checkFramebufferStatus(gl.FRAMEBUFFER) is gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT
 [ 51: PASS ] getError was one of: INVALID_ENUM or INVALID_FRAMEBUFFER_OPERATION : CopyTexImage2D should fail.
-[ 52: FAIL ] getError expected: NO_ERROR. Was INVALID_OPERATION : Setup framebuffer with texture should succeed.
-[ 53: PASS ] gl.checkFramebufferStatus(gl.FRAMEBUFFER) is gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT
+[ 52: PASS ] getError was expected value: NO_ERROR : Setup framebuffer with texture should succeed.
+[ 53: FAIL ] gl.checkFramebufferStatus(gl.FRAMEBUFFER) should be 36054. Was 36053.
 [ 54: PASS ] getError was one of: INVALID_ENUM or INVALID_FRAMEBUFFER_OPERATION : CopyTexImage2D should fail.
 [ 55: PASS ] getError was expected value: NO_ERROR : Setup framebuffer with texture should succeed.
 [ 56: PASS ] gl.checkFramebufferStatus(gl.FRAMEBUFFER) is gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT
diff --git a/LayoutTests/platform/ios-simulator/webgl/2.0.0/conformance2/textures/misc/tex-new-formats-expected.txt b/LayoutTests/platform/ios-simulator/webgl/2.0.0/conformance2/textures/misc/tex-new-formats-expected.txt
index 207d959..aad0fac 100644
--- a/LayoutTests/platform/ios-simulator/webgl/2.0.0/conformance2/textures/misc/tex-new-formats-expected.txt
+++ b/LayoutTests/platform/ios-simulator/webgl/2.0.0/conformance2/textures/misc/tex-new-formats-expected.txt
@@ -128,12 +128,12 @@
 [ 125: PASS ] getError was expected value: NO_ERROR : texStorage3D should succeed
 [ 126: PASS ] getError was expected value: NO_ERROR : texSubImage3D should succeed on immutable-format texture
 [ 127: FAIL ] getError expected: INVALID_OPERATION. Was NO_ERROR : texSubImage3D should fail on immutable-format texture with data of wrong type
-[ 128: FAIL ] getError expected: NO_ERROR. Was INVALID_OPERATION : texImage2D should succeed with sized internalformat
+[ 128: PASS ] getError was expected value: NO_ERROR : texImage2D should succeed with sized internalformat
 [ 129: PASS ] getError was expected value: INVALID_OPERATION : texImage2D should fail with sized internalformat and data of wrong type
-[ 130: FAIL ] getError expected: NO_ERROR. Was INVALID_VALUE : texSubImage2D should succeed
-[ 131: FAIL ] getError expected: INVALID_OPERATION. Was INVALID_VALUE : texSubImage2D should fail with data of wrong type
+[ 130: PASS ] getError was expected value: NO_ERROR : texSubImage2D should succeed
+[ 131: PASS ] getError was expected value: INVALID_OPERATION : texSubImage2D should fail with data of wrong type
 [ 132: PASS ] getError was expected value: NO_ERROR : texStorage2D should succeed
-[ 133: FAIL ] getError expected: NO_ERROR. Was INVALID_OPERATION : texSubImage2D should succeed on immutable-format texture
+[ 133: PASS ] getError was expected value: NO_ERROR : texSubImage2D should succeed on immutable-format texture
 [ 134: PASS ] getError was expected value: INVALID_OPERATION : texSubImage2D should fail on immutable-format texture with data of wrong type
 [ 135: FAIL ] getError expected: NO_ERROR. Was INVALID_ENUM : texImage3D should succeed with sized internalformat
 [ 136: FAIL ] getError expected: INVALID_OPERATION. Was NO_ERROR : texImage3D should fail with sized internalformat and data of wrong type
@@ -366,12 +366,12 @@
 [ 363: PASS ] getError was expected value: NO_ERROR : texStorage3D should succeed
 [ 364: PASS ] getError was expected value: NO_ERROR : texSubImage3D should succeed on immutable-format texture
 [ 365: FAIL ] getError expected: INVALID_OPERATION. Was NO_ERROR : texSubImage3D should fail on immutable-format texture with data of wrong type
-[ 366: FAIL ] getError expected: NO_ERROR. Was INVALID_OPERATION : texImage2D should succeed with sized internalformat
+[ 366: PASS ] getError was expected value: NO_ERROR : texImage2D should succeed with sized internalformat
 [ 367: PASS ] getError was expected value: INVALID_OPERATION : texImage2D should fail with sized internalformat and data of wrong type
-[ 368: FAIL ] getError expected: NO_ERROR. Was INVALID_VALUE : texSubImage2D should succeed
-[ 369: FAIL ] getError expected: INVALID_OPERATION. Was INVALID_VALUE : texSubImage2D should fail with data of wrong type
+[ 368: PASS ] getError was expected value: NO_ERROR : texSubImage2D should succeed
+[ 369: PASS ] getError was expected value: INVALID_OPERATION : texSubImage2D should fail with data of wrong type
 [ 370: PASS ] getError was expected value: NO_ERROR : texStorage2D should succeed
-[ 371: FAIL ] getError expected: NO_ERROR. Was INVALID_OPERATION : texSubImage2D should succeed on immutable-format texture
+[ 371: PASS ] getError was expected value: NO_ERROR : texSubImage2D should succeed on immutable-format texture
 [ 372: PASS ] getError was expected value: INVALID_OPERATION : texSubImage2D should fail on immutable-format texture with data of wrong type
 [ 373: FAIL ] getError expected: NO_ERROR. Was INVALID_ENUM : texImage3D should succeed with sized internalformat
 [ 374: FAIL ] getError expected: INVALID_OPERATION. Was NO_ERROR : texImage3D should fail with sized internalformat and data of wrong type
@@ -380,12 +380,12 @@
 [ 377: PASS ] getError was expected value: NO_ERROR : texStorage3D should succeed
 [ 378: PASS ] getError was expected value: NO_ERROR : texSubImage3D should succeed on immutable-format texture
 [ 379: FAIL ] getError expected: INVALID_OPERATION. Was NO_ERROR : texSubImage3D should fail on immutable-format texture with data of wrong type
-[ 380: FAIL ] getError expected: NO_ERROR. Was INVALID_OPERATION : texImage2D should succeed with sized internalformat
+[ 380: PASS ] getError was expected value: NO_ERROR : texImage2D should succeed with sized internalformat
 [ 381: PASS ] getError was expected value: INVALID_OPERATION : texImage2D should fail with sized internalformat and data of wrong type
-[ 382: FAIL ] getError expected: NO_ERROR. Was INVALID_VALUE : texSubImage2D should succeed
-[ 383: FAIL ] getError expected: INVALID_OPERATION. Was INVALID_VALUE : texSubImage2D should fail with data of wrong type
+[ 382: PASS ] getError was expected value: NO_ERROR : texSubImage2D should succeed
+[ 383: PASS ] getError was expected value: INVALID_OPERATION : texSubImage2D should fail with data of wrong type
 [ 384: PASS ] getError was expected value: NO_ERROR : texStorage2D should succeed
-[ 385: FAIL ] getError expected: NO_ERROR. Was INVALID_OPERATION : texSubImage2D should succeed on immutable-format texture
+[ 385: PASS ] getError was expected value: NO_ERROR : texSubImage2D should succeed on immutable-format texture
 [ 386: PASS ] getError was expected value: INVALID_OPERATION : texSubImage2D should fail on immutable-format texture with data of wrong type
 [ 387: FAIL ] getError expected: NO_ERROR. Was INVALID_ENUM : texImage3D should succeed with sized internalformat
 [ 388: FAIL ] getError expected: INVALID_OPERATION. Was NO_ERROR : texImage3D should fail with sized internalformat and data of wrong type
@@ -394,12 +394,12 @@
 [ 391: PASS ] getError was expected value: NO_ERROR : texStorage3D should succeed
 [ 392: PASS ] getError was expected value: NO_ERROR : texSubImage3D should succeed on immutable-format texture
 [ 393: FAIL ] getError expected: INVALID_OPERATION. Was NO_ERROR : texSubImage3D should fail on immutable-format texture with data of wrong type
-[ 394: FAIL ] getError expected: NO_ERROR. Was INVALID_OPERATION : texImage2D should succeed with sized internalformat
+[ 394: PASS ] getError was expected value: NO_ERROR : texImage2D should succeed with sized internalformat
 [ 395: PASS ] getError was expected value: INVALID_OPERATION : texImage2D should fail with sized internalformat and data of wrong type
-[ 396: FAIL ] getError expected: NO_ERROR. Was INVALID_VALUE : texSubImage2D should succeed
-[ 397: FAIL ] getError expected: INVALID_OPERATION. Was INVALID_VALUE : texSubImage2D should fail with data of wrong type
+[ 396: PASS ] getError was expected value: NO_ERROR : texSubImage2D should succeed
+[ 397: PASS ] getError was expected value: INVALID_OPERATION : texSubImage2D should fail with data of wrong type
 [ 398: PASS ] getError was expected value: NO_ERROR : texStorage2D should succeed
-[ 399: FAIL ] getError expected: NO_ERROR. Was INVALID_OPERATION : texSubImage2D should succeed on immutable-format texture
+[ 399: PASS ] getError was expected value: NO_ERROR : texSubImage2D should succeed on immutable-format texture
 [ 400: PASS ] getError was expected value: INVALID_OPERATION : texSubImage2D should fail on immutable-format texture with data of wrong type
 [ 401: FAIL ] getError expected: NO_ERROR. Was INVALID_ENUM : texImage3D should succeed with sized internalformat
 [ 402: FAIL ] getError expected: INVALID_OPERATION. Was NO_ERROR : texImage3D should fail with sized internalformat and data of wrong type
@@ -576,12 +576,12 @@
 [ 573: PASS ] getError was expected value: NO_ERROR : texStorage3D should succeed
 [ 574: PASS ] getError was expected value: NO_ERROR : texSubImage3D should succeed on immutable-format texture
 [ 575: FAIL ] getError expected: INVALID_OPERATION. Was NO_ERROR : texSubImage3D should fail on immutable-format texture with data of wrong type
-[ 576: FAIL ] getError expected: NO_ERROR. Was INVALID_OPERATION : texImage2D should succeed with sized internalformat
+[ 576: PASS ] getError was expected value: NO_ERROR : texImage2D should succeed with sized internalformat
 [ 577: PASS ] getError was expected value: INVALID_OPERATION : texImage2D should fail with sized internalformat and data of wrong type
-[ 578: FAIL ] getError expected: NO_ERROR. Was INVALID_VALUE : texSubImage2D should succeed
-[ 579: FAIL ] getError expected: INVALID_OPERATION. Was INVALID_VALUE : texSubImage2D should fail with data of wrong type
+[ 578: PASS ] getError was expected value: NO_ERROR : texSubImage2D should succeed
+[ 579: PASS ] getError was expected value: INVALID_OPERATION : texSubImage2D should fail with data of wrong type
 [ 580: PASS ] getError was expected value: NO_ERROR : texStorage2D should succeed
-[ 581: FAIL ] getError expected: NO_ERROR. Was INVALID_OPERATION : texSubImage2D should succeed on immutable-format texture
+[ 581: PASS ] getError was expected value: NO_ERROR : texSubImage2D should succeed on immutable-format texture
 [ 582: PASS ] getError was expected value: INVALID_OPERATION : texSubImage2D should fail on immutable-format texture with data of wrong type
 [ 583: FAIL ] getError expected: NO_ERROR. Was INVALID_ENUM : texImage3D should succeed with sized internalformat
 [ 584: FAIL ] getError expected: INVALID_OPERATION. Was NO_ERROR : texImage3D should fail with sized internalformat and data of wrong type
@@ -730,12 +730,12 @@
 [ 727: PASS ] getError was expected value: NO_ERROR : texStorage3D should succeed
 [ 728: PASS ] getError was expected value: NO_ERROR : texSubImage3D should succeed on immutable-format texture
 [ 729: FAIL ] getError expected: INVALID_OPERATION. Was NO_ERROR : texSubImage3D should fail on immutable-format texture with data of wrong type
-[ 730: FAIL ] getError expected: NO_ERROR. Was INVALID_OPERATION : texImage2D should succeed with sized internalformat
+[ 730: PASS ] getError was expected value: NO_ERROR : texImage2D should succeed with sized internalformat
 [ 731: PASS ] getError was expected value: INVALID_OPERATION : texImage2D should fail with sized internalformat and data of wrong type
-[ 732: FAIL ] getError expected: NO_ERROR. Was INVALID_VALUE : texSubImage2D should succeed
-[ 733: FAIL ] getError expected: INVALID_OPERATION. Was INVALID_VALUE : texSubImage2D should fail with data of wrong type
+[ 732: PASS ] getError was expected value: NO_ERROR : texSubImage2D should succeed
+[ 733: PASS ] getError was expected value: INVALID_OPERATION : texSubImage2D should fail with data of wrong type
 [ 734: PASS ] getError was expected value: NO_ERROR : texStorage2D should succeed
-[ 735: FAIL ] getError expected: NO_ERROR. Was INVALID_OPERATION : texSubImage2D should succeed on immutable-format texture
+[ 735: PASS ] getError was expected value: NO_ERROR : texSubImage2D should succeed on immutable-format texture
 [ 736: PASS ] getError was expected value: INVALID_OPERATION : texSubImage2D should fail on immutable-format texture with data of wrong type
 [ 737: FAIL ] getError expected: NO_ERROR. Was INVALID_ENUM : texImage3D should succeed with sized internalformat
 [ 738: FAIL ] getError expected: INVALID_OPERATION. Was NO_ERROR : texImage3D should fail with sized internalformat and data of wrong type
@@ -960,5 +960,5 @@
 [ 957: FAIL ] getError expected: INVALID_OPERATION. Was NO_ERROR : texSubImage3D should fail with data of wrong type
 [ 958: PASS ] getError was expected value: NO_ERROR : there should be no errors
 [ 959: PASS ] successfullyParsed is true
-[ FAIL ] 312 failures reported
+[ FAIL ] 288 failures reported
 
diff --git a/LayoutTests/webgl/2.0.0/conformance/extensions/oes-texture-half-float-expected.txt b/LayoutTests/webgl/2.0.0/conformance/extensions/oes-texture-half-float-expected.txt
index 827c7c4..11a8c2e 100644
--- a/LayoutTests/webgl/2.0.0/conformance/extensions/oes-texture-half-float-expected.txt
+++ b/LayoutTests/webgl/2.0.0/conformance/extensions/oes-texture-half-float-expected.txt
@@ -46,35 +46,35 @@
 [ 43: PASS ] getError was expected value: NO_ERROR : texture parameter setup should succeed
 [ 44: PASS ] getError was expected value: INVALID_OPERATION : Half floating point texture allocation must be disallowed when ArrayBufferView is not-null and not-Uint16
 [ 45: PASS ] getError was expected value: NO_ERROR : texture parameter setup should succeed
-[ 46: FAIL ] getError expected: NO_ERROR. Was INVALID_OPERATION : Half floating point texture allocation should succeed if OES_texture_half_float is enabled
-[ 47: FAIL ] should be 85,85,85,85 at (0, 0) expected: 85,85,85,85 was 0,0,0,255
-[ 48: PASS ] should be black
+[ 46: PASS ] getError was expected value: NO_ERROR : Half floating point texture allocation should succeed if OES_texture_half_float is enabled
+[ 47: PASS ] should be 85,85,85,85
+[ 48: FAIL ] should be black at (0, 0) expected: 0,0,0,255 was 85,85,85,85
 [ 49: PASS ] getError was expected value: NO_ERROR : texture parameter setup should succeed
-[ 50: FAIL ] getError expected: NO_ERROR. Was INVALID_OPERATION : Half floating point texture allocation should succeed if OES_texture_half_float is enabled
-[ 51: FAIL ] should be 85,85,85,255 at (0, 0) expected: 85,85,85,255 was 0,0,0,255
-[ 52: PASS ] should be black
+[ 50: PASS ] getError was expected value: NO_ERROR : Half floating point texture allocation should succeed if OES_texture_half_float is enabled
+[ 51: PASS ] should be 85,85,85,255
+[ 52: FAIL ] should be black at (0, 0) expected: 0,0,0,255 was 85,85,85,255
 [ 53: PASS ] getError was expected value: NO_ERROR : texture parameter setup should succeed
-[ 54: FAIL ] getError expected: NO_ERROR. Was INVALID_OPERATION : Half floating point texture allocation should succeed if OES_texture_half_float is enabled
-[ 55: FAIL ] should be 85,85,85,255 at (0, 0) expected: 85,85,85,255 was 0,0,0,255
-[ 56: PASS ] should be black
+[ 54: PASS ] getError was expected value: NO_ERROR : Half floating point texture allocation should succeed if OES_texture_half_float is enabled
+[ 55: PASS ] should be 85,85,85,255
+[ 56: FAIL ] should be black at (0, 0) expected: 0,0,0,255 was 85,85,85,255
 [ 57: PASS ] getError was expected value: NO_ERROR : texture parameter setup should succeed
-[ 58: FAIL ] getError expected: NO_ERROR. Was INVALID_OPERATION : Half floating point texture allocation should succeed if OES_texture_half_float is enabled
-[ 59: FAIL ] should be 0,0,0,85 at (0, 0) expected: 0,0,0,85 was 0,0,0,255
-[ 60: PASS ] should be black
+[ 58: PASS ] getError was expected value: NO_ERROR : Half floating point texture allocation should succeed if OES_texture_half_float is enabled
+[ 59: PASS ] should be 0,0,0,85
+[ 60: FAIL ] should be black at (0, 0) expected: 0,0,0,255 was 0,0,0,85
 [ 61: PASS ] getError was expected value: NO_ERROR : texture parameter setup should succeed
-[ 62: FAIL ] getError expected: NO_ERROR. Was INVALID_OPERATION : Half floating point texture allocation should succeed if OES_texture_half_float is enabled
-[ 63: FAIL ] should be 85,85,85,85 at (0, 0) expected: 85,85,85,85 was 0,0,0,255
-[ 64: PASS ] should be black
+[ 62: PASS ] getError was expected value: NO_ERROR : Half floating point texture allocation should succeed if OES_texture_half_float is enabled
+[ 63: PASS ] should be 85,85,85,85
+[ 64: FAIL ] should be black at (0, 0) expected: 0,0,0,255 was 85,85,85,85
 [ 65: PASS ] getError was expected value: NO_ERROR : texture parameter setup should succeed
-[ 66: FAIL ] getError expected: NO_ERROR. Was INVALID_OPERATION : Half floating point texture allocation should succeed if OES_texture_half_float is enabled
+[ 66: PASS ] getError was expected value: NO_ERROR : Half floating point texture allocation should succeed if OES_texture_half_float is enabled
 [ 67: PASS ] getError was expected value: NO_ERROR : rendering from half floating point texture should succeed
-[ 68: FAIL ] should be green at (0, 0) expected: 0,255,0,255 was 255,0,0,255
+[ 68: PASS ] should be green
 [ 69: PASS ] getError was expected value: NO_ERROR : texture parameter setup should succeed
-[ 70: FAIL ] getError expected: NO_ERROR. Was INVALID_OPERATION : Half floating point texture allocation should succeed if OES_texture_half_float is enabled
+[ 70: PASS ] getError was expected value: NO_ERROR : Half floating point texture allocation should succeed if OES_texture_half_float is enabled
 [ 71: PASS ] getError was expected value: NO_ERROR : rendering from half floating point texture should succeed
-[ 72: FAIL ] should be green at (0, 0) expected: 0,255,0,255 was 255,0,0,255
+[ 72: PASS ] should be green
 [ 73: FAIL ] RGBA/HALF_FLOAT_OES is color renderable but EXT_color_buffer_half_float not exposed
 [ 74: PASS ] gl.getExtension("OES_texture_half_float").myProperty is 2
 [ 75: PASS ] successfullyParsed is true
-[ FAIL ] 19 failures reported
+[ FAIL ] 10 failures reported
 
diff --git a/LayoutTests/webgl/2.0.0/conformance2/extensions/ext-color-buffer-float-expected.txt b/LayoutTests/webgl/2.0.0/conformance2/extensions/ext-color-buffer-float-expected.txt
index 14d856c..32908bd 100644
--- a/LayoutTests/webgl/2.0.0/conformance2/extensions/ext-color-buffer-float-expected.txt
+++ b/LayoutTests/webgl/2.0.0/conformance2/extensions/ext-color-buffer-float-expected.txt
@@ -34,26 +34,26 @@
 [ 31: PASS ] getError was expected value: NO_ERROR : RGB16F texture allocation should succeed
 [ 32: FAIL ] RGB16F render target should not be supported with or without enabling EXT_color_buffer_float
 [ 33: PASS ] getError was expected value: INVALID_ENUM : RGB16F renderbuffer allocation should fail with or without enabling EXT_color_buffer_float
-[ 34: FAIL ] getError expected: NO_ERROR. Was INVALID_OPERATION : Setup framebuffer with texture should succeed.
-[ 35: PASS ] gl.checkFramebufferStatus(gl.FRAMEBUFFER) is gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT
+[ 34: PASS ] getError was expected value: NO_ERROR : Setup framebuffer with texture should succeed.
+[ 35: FAIL ] gl.checkFramebufferStatus(gl.FRAMEBUFFER) should be 36054. Was 36053.
 [ 36: PASS ] getError was one of: INVALID_ENUM or INVALID_FRAMEBUFFER_OPERATION : CopyTexImage2D should fail.
 [ 37: PASS ] getError was expected value: NO_ERROR : Setup framebuffer with texture should succeed.
 [ 38: FAIL ] gl.checkFramebufferStatus(gl.FRAMEBUFFER) should be 36054. Was 36053.
 [ 39: PASS ] getError was one of: INVALID_ENUM or INVALID_FRAMEBUFFER_OPERATION : CopyTexImage2D should fail.
-[ 40: FAIL ] getError expected: NO_ERROR. Was INVALID_OPERATION : Setup framebuffer with texture should succeed.
-[ 41: PASS ] gl.checkFramebufferStatus(gl.FRAMEBUFFER) is gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT
+[ 40: PASS ] getError was expected value: NO_ERROR : Setup framebuffer with texture should succeed.
+[ 41: FAIL ] gl.checkFramebufferStatus(gl.FRAMEBUFFER) should be 36054. Was 36053.
 [ 42: PASS ] getError was one of: INVALID_ENUM or INVALID_FRAMEBUFFER_OPERATION : CopyTexImage2D should fail.
 [ 43: PASS ] getError was expected value: NO_ERROR : Setup framebuffer with texture should succeed.
 [ 44: FAIL ] gl.checkFramebufferStatus(gl.FRAMEBUFFER) should be 36054. Was 36053.
 [ 45: PASS ] getError was one of: INVALID_ENUM or INVALID_FRAMEBUFFER_OPERATION : CopyTexImage2D should fail.
-[ 46: FAIL ] getError expected: NO_ERROR. Was INVALID_OPERATION : Setup framebuffer with texture should succeed.
-[ 47: PASS ] gl.checkFramebufferStatus(gl.FRAMEBUFFER) is gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT
+[ 46: PASS ] getError was expected value: NO_ERROR : Setup framebuffer with texture should succeed.
+[ 47: FAIL ] gl.checkFramebufferStatus(gl.FRAMEBUFFER) should be 36054. Was 36053.
 [ 48: PASS ] getError was one of: INVALID_ENUM or INVALID_FRAMEBUFFER_OPERATION : CopyTexImage2D should fail.
 [ 49: PASS ] getError was expected value: NO_ERROR : Setup framebuffer with texture should succeed.
 [ 50: FAIL ] gl.checkFramebufferStatus(gl.FRAMEBUFFER) should be 36054. Was 36053.
 [ 51: PASS ] getError was one of: INVALID_ENUM or INVALID_FRAMEBUFFER_OPERATION : CopyTexImage2D should fail.
-[ 52: FAIL ] getError expected: NO_ERROR. Was INVALID_OPERATION : Setup framebuffer with texture should succeed.
-[ 53: PASS ] gl.checkFramebufferStatus(gl.FRAMEBUFFER) is gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT
+[ 52: PASS ] getError was expected value: NO_ERROR : Setup framebuffer with texture should succeed.
+[ 53: FAIL ] gl.checkFramebufferStatus(gl.FRAMEBUFFER) should be 36054. Was 36053.
 [ 54: PASS ] getError was one of: INVALID_ENUM or INVALID_FRAMEBUFFER_OPERATION : CopyTexImage2D should fail.
 [ 55: PASS ] getError was expected value: NO_ERROR : Setup framebuffer with texture should succeed.
 [ 56: FAIL ] gl.checkFramebufferStatus(gl.FRAMEBUFFER) should be 36054. Was 36053.
diff --git a/LayoutTests/webgl/2.0.0/conformance2/textures/misc/tex-new-formats-expected.txt b/LayoutTests/webgl/2.0.0/conformance2/textures/misc/tex-new-formats-expected.txt
index 61a90df..1fc0368 100644
--- a/LayoutTests/webgl/2.0.0/conformance2/textures/misc/tex-new-formats-expected.txt
+++ b/LayoutTests/webgl/2.0.0/conformance2/textures/misc/tex-new-formats-expected.txt
@@ -128,12 +128,12 @@
 [ 125: PASS ] getError was expected value: NO_ERROR : texStorage3D should succeed
 [ 126: PASS ] getError was expected value: NO_ERROR : texSubImage3D should succeed on immutable-format texture
 [ 127: FAIL ] getError expected: INVALID_OPERATION. Was NO_ERROR : texSubImage3D should fail on immutable-format texture with data of wrong type
-[ 128: FAIL ] getError expected: NO_ERROR. Was INVALID_OPERATION : texImage2D should succeed with sized internalformat
+[ 128: PASS ] getError was expected value: NO_ERROR : texImage2D should succeed with sized internalformat
 [ 129: PASS ] getError was expected value: INVALID_OPERATION : texImage2D should fail with sized internalformat and data of wrong type
-[ 130: FAIL ] getError expected: NO_ERROR. Was INVALID_VALUE : texSubImage2D should succeed
-[ 131: FAIL ] getError expected: INVALID_OPERATION. Was INVALID_VALUE : texSubImage2D should fail with data of wrong type
+[ 130: PASS ] getError was expected value: NO_ERROR : texSubImage2D should succeed
+[ 131: PASS ] getError was expected value: INVALID_OPERATION : texSubImage2D should fail with data of wrong type
 [ 132: PASS ] getError was expected value: NO_ERROR : texStorage2D should succeed
-[ 133: FAIL ] getError expected: NO_ERROR. Was INVALID_OPERATION : texSubImage2D should succeed on immutable-format texture
+[ 133: PASS ] getError was expected value: NO_ERROR : texSubImage2D should succeed on immutable-format texture
 [ 134: PASS ] getError was expected value: INVALID_OPERATION : texSubImage2D should fail on immutable-format texture with data of wrong type
 [ 135: FAIL ] getError expected: NO_ERROR. Was INVALID_ENUM : texImage3D should succeed with sized internalformat
 [ 136: FAIL ] getError expected: INVALID_OPERATION. Was NO_ERROR : texImage3D should fail with sized internalformat and data of wrong type
@@ -366,12 +366,12 @@
 [ 363: PASS ] getError was expected value: NO_ERROR : texStorage3D should succeed
 [ 364: PASS ] getError was expected value: NO_ERROR : texSubImage3D should succeed on immutable-format texture
 [ 365: FAIL ] getError expected: INVALID_OPERATION. Was NO_ERROR : texSubImage3D should fail on immutable-format texture with data of wrong type
-[ 366: FAIL ] getError expected: NO_ERROR. Was INVALID_OPERATION : texImage2D should succeed with sized internalformat
+[ 366: PASS ] getError was expected value: NO_ERROR : texImage2D should succeed with sized internalformat
 [ 367: PASS ] getError was expected value: INVALID_OPERATION : texImage2D should fail with sized internalformat and data of wrong type
-[ 368: FAIL ] getError expected: NO_ERROR. Was INVALID_VALUE : texSubImage2D should succeed
-[ 369: FAIL ] getError expected: INVALID_OPERATION. Was INVALID_VALUE : texSubImage2D should fail with data of wrong type
+[ 368: PASS ] getError was expected value: NO_ERROR : texSubImage2D should succeed
+[ 369: PASS ] getError was expected value: INVALID_OPERATION : texSubImage2D should fail with data of wrong type
 [ 370: PASS ] getError was expected value: NO_ERROR : texStorage2D should succeed
-[ 371: FAIL ] getError expected: NO_ERROR. Was INVALID_OPERATION : texSubImage2D should succeed on immutable-format texture
+[ 371: PASS ] getError was expected value: NO_ERROR : texSubImage2D should succeed on immutable-format texture
 [ 372: PASS ] getError was expected value: INVALID_OPERATION : texSubImage2D should fail on immutable-format texture with data of wrong type
 [ 373: FAIL ] getError expected: NO_ERROR. Was INVALID_ENUM : texImage3D should succeed with sized internalformat
 [ 374: FAIL ] getError expected: INVALID_OPERATION. Was NO_ERROR : texImage3D should fail with sized internalformat and data of wrong type
@@ -380,12 +380,12 @@
 [ 377: PASS ] getError was expected value: NO_ERROR : texStorage3D should succeed
 [ 378: PASS ] getError was expected value: NO_ERROR : texSubImage3D should succeed on immutable-format texture
 [ 379: FAIL ] getError expected: INVALID_OPERATION. Was NO_ERROR : texSubImage3D should fail on immutable-format texture with data of wrong type
-[ 380: FAIL ] getError expected: NO_ERROR. Was INVALID_OPERATION : texImage2D should succeed with sized internalformat
+[ 380: PASS ] getError was expected value: NO_ERROR : texImage2D should succeed with sized internalformat
 [ 381: PASS ] getError was expected value: INVALID_OPERATION : texImage2D should fail with sized internalformat and data of wrong type
-[ 382: FAIL ] getError expected: NO_ERROR. Was INVALID_VALUE : texSubImage2D should succeed
-[ 383: FAIL ] getError expected: INVALID_OPERATION. Was INVALID_VALUE : texSubImage2D should fail with data of wrong type
+[ 382: PASS ] getError was expected value: NO_ERROR : texSubImage2D should succeed
+[ 383: PASS ] getError was expected value: INVALID_OPERATION : texSubImage2D should fail with data of wrong type
 [ 384: PASS ] getError was expected value: NO_ERROR : texStorage2D should succeed
-[ 385: FAIL ] getError expected: NO_ERROR. Was INVALID_OPERATION : texSubImage2D should succeed on immutable-format texture
+[ 385: PASS ] getError was expected value: NO_ERROR : texSubImage2D should succeed on immutable-format texture
 [ 386: PASS ] getError was expected value: INVALID_OPERATION : texSubImage2D should fail on immutable-format texture with data of wrong type
 [ 387: FAIL ] getError expected: NO_ERROR. Was INVALID_ENUM : texImage3D should succeed with sized internalformat
 [ 388: FAIL ] getError expected: INVALID_OPERATION. Was NO_ERROR : texImage3D should fail with sized internalformat and data of wrong type
@@ -394,12 +394,12 @@
 [ 391: PASS ] getError was expected value: NO_ERROR : texStorage3D should succeed
 [ 392: PASS ] getError was expected value: NO_ERROR : texSubImage3D should succeed on immutable-format texture
 [ 393: FAIL ] getError expected: INVALID_OPERATION. Was NO_ERROR : texSubImage3D should fail on immutable-format texture with data of wrong type
-[ 394: FAIL ] getError expected: NO_ERROR. Was INVALID_OPERATION : texImage2D should succeed with sized internalformat
+[ 394: PASS ] getError was expected value: NO_ERROR : texImage2D should succeed with sized internalformat
 [ 395: PASS ] getError was expected value: INVALID_OPERATION : texImage2D should fail with sized internalformat and data of wrong type
-[ 396: FAIL ] getError expected: NO_ERROR. Was INVALID_VALUE : texSubImage2D should succeed
-[ 397: FAIL ] getError expected: INVALID_OPERATION. Was INVALID_VALUE : texSubImage2D should fail with data of wrong type
+[ 396: PASS ] getError was expected value: NO_ERROR : texSubImage2D should succeed
+[ 397: PASS ] getError was expected value: INVALID_OPERATION : texSubImage2D should fail with data of wrong type
 [ 398: PASS ] getError was expected value: NO_ERROR : texStorage2D should succeed
-[ 399: FAIL ] getError expected: NO_ERROR. Was INVALID_OPERATION : texSubImage2D should succeed on immutable-format texture
+[ 399: PASS ] getError was expected value: NO_ERROR : texSubImage2D should succeed on immutable-format texture
 [ 400: PASS ] getError was expected value: INVALID_OPERATION : texSubImage2D should fail on immutable-format texture with data of wrong type
 [ 401: FAIL ] getError expected: NO_ERROR. Was INVALID_ENUM : texImage3D should succeed with sized internalformat
 [ 402: FAIL ] getError expected: INVALID_OPERATION. Was NO_ERROR : texImage3D should fail with sized internalformat and data of wrong type
@@ -576,12 +576,12 @@
 [ 573: PASS ] getError was expected value: NO_ERROR : texStorage3D should succeed
 [ 574: PASS ] getError was expected value: NO_ERROR : texSubImage3D should succeed on immutable-format texture
 [ 575: FAIL ] getError expected: INVALID_OPERATION. Was NO_ERROR : texSubImage3D should fail on immutable-format texture with data of wrong type
-[ 576: FAIL ] getError expected: NO_ERROR. Was INVALID_OPERATION : texImage2D should succeed with sized internalformat
+[ 576: PASS ] getError was expected value: NO_ERROR : texImage2D should succeed with sized internalformat
 [ 577: PASS ] getError was expected value: INVALID_OPERATION : texImage2D should fail with sized internalformat and data of wrong type
-[ 578: FAIL ] getError expected: NO_ERROR. Was INVALID_VALUE : texSubImage2D should succeed
-[ 579: FAIL ] getError expected: INVALID_OPERATION. Was INVALID_VALUE : texSubImage2D should fail with data of wrong type
+[ 578: PASS ] getError was expected value: NO_ERROR : texSubImage2D should succeed
+[ 579: PASS ] getError was expected value: INVALID_OPERATION : texSubImage2D should fail with data of wrong type
 [ 580: PASS ] getError was expected value: NO_ERROR : texStorage2D should succeed
-[ 581: FAIL ] getError expected: NO_ERROR. Was INVALID_OPERATION : texSubImage2D should succeed on immutable-format texture
+[ 581: PASS ] getError was expected value: NO_ERROR : texSubImage2D should succeed on immutable-format texture
 [ 582: PASS ] getError was expected value: INVALID_OPERATION : texSubImage2D should fail on immutable-format texture with data of wrong type
 [ 583: FAIL ] getError expected: NO_ERROR. Was INVALID_ENUM : texImage3D should succeed with sized internalformat
 [ 584: FAIL ] getError expected: INVALID_OPERATION. Was NO_ERROR : texImage3D should fail with sized internalformat and data of wrong type
@@ -730,12 +730,12 @@
 [ 727: PASS ] getError was expected value: NO_ERROR : texStorage3D should succeed
 [ 728: PASS ] getError was expected value: NO_ERROR : texSubImage3D should succeed on immutable-format texture
 [ 729: FAIL ] getError expected: INVALID_OPERATION. Was NO_ERROR : texSubImage3D should fail on immutable-format texture with data of wrong type
-[ 730: FAIL ] getError expected: NO_ERROR. Was INVALID_OPERATION : texImage2D should succeed with sized internalformat
+[ 730: PASS ] getError was expected value: NO_ERROR : texImage2D should succeed with sized internalformat
 [ 731: PASS ] getError was expected value: INVALID_OPERATION : texImage2D should fail with sized internalformat and data of wrong type
-[ 732: FAIL ] getError expected: NO_ERROR. Was INVALID_VALUE : texSubImage2D should succeed
-[ 733: FAIL ] getError expected: INVALID_OPERATION. Was INVALID_VALUE : texSubImage2D should fail with data of wrong type
+[ 732: PASS ] getError was expected value: NO_ERROR : texSubImage2D should succeed
+[ 733: PASS ] getError was expected value: INVALID_OPERATION : texSubImage2D should fail with data of wrong type
 [ 734: PASS ] getError was expected value: NO_ERROR : texStorage2D should succeed
-[ 735: FAIL ] getError expected: NO_ERROR. Was INVALID_OPERATION : texSubImage2D should succeed on immutable-format texture
+[ 735: PASS ] getError was expected value: NO_ERROR : texSubImage2D should succeed on immutable-format texture
 [ 736: PASS ] getError was expected value: INVALID_OPERATION : texSubImage2D should fail on immutable-format texture with data of wrong type
 [ 737: FAIL ] getError expected: NO_ERROR. Was INVALID_ENUM : texImage3D should succeed with sized internalformat
 [ 738: FAIL ] getError expected: INVALID_OPERATION. Was NO_ERROR : texImage3D should fail with sized internalformat and data of wrong type
@@ -960,5 +960,5 @@
 [ 957: FAIL ] getError expected: INVALID_OPERATION. Was NO_ERROR : texSubImage3D should fail with data of wrong type
 [ 958: PASS ] getError was expected value: NO_ERROR : there should be no errors
 [ 959: PASS ] successfullyParsed is true
-[ FAIL ] 321 failures reported
+[ FAIL ] 297 failures reported
 
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index 9ad938f..5bab2e0 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,21 @@
+2019-10-17  Dean Jackson  <dino@apple.com>
+
+        texImage2D for a half-float texture only accepts null
+        https://bugs.webkit.org/show_bug.cgi?id=169999
+        <rdar://problem/31713571>
+
+        Reviewed by Simon Fraser.
+
+        After we initially implemented this, the extension was
+        modified such that texImage2D could upload to half-float
+        from a Uint16 array.
+
+        Test: fast/canvas/webgl/oes-texture-half-float-uint16.html
+
+        * html/canvas/WebGLRenderingContextBase.cpp:
+        (WebCore::WebGLRenderingContextBase::validateArrayBufferType): Accept
+        Uint16.
+
 2019-10-18  Daniel Bates  <dabates@apple.com>
 
         REGRESSION (r241747): [iOS] Adjust default SVG focus ring width to match width for HTML documents
diff --git a/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp b/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp
index 626246f..b7ea7f2 100644
--- a/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp
+++ b/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp
@@ -4122,13 +4122,7 @@
     case GraphicsContext3D::HALF_FLOAT_OES: // OES_texture_half_float
     case GraphicsContext3D::HALF_FLOAT:
     case GraphicsContext3D::FLOAT_32_UNSIGNED_INT_24_8_REV:
-        // As per the specification, ArrayBufferView should be null when
-        // OES_texture_half_float is enabled.
-        if (arrayType) {
-            synthesizeGLError(GraphicsContext3D::INVALID_OPERATION, functionName, "type HALF_FLOAT_OES but ArrayBufferView is not NULL");
-            return false;
-        }
-        break;
+        TYPE_VALIDATION_CASE(TypeUint16);
     default:
         ASSERT_NOT_REACHED();
         return false;