Title: [124672] trunk
Revision
124672
Author
[email protected]
Date
2012-08-03 16:39:16 -0700 (Fri, 03 Aug 2012)

Log Message

Unreviewed, rolling out r124668.
http://trac.webkit.org/changeset/124668
https://bugs.webkit.org/show_bug.cgi?id=93167

Broke Mac build (Requested by kbr_google on #webkit).

Patch by Sheriff Bot <[email protected]> on 2012-08-03

Source/WebCore:

* bindings/js/JSArrayBufferViewHelper.h:
(WebCore::setWebGLArrayWithTypedArrayArgument):
(WebCore::setWebGLArrayHelper):
(WebCore::constructArrayBufferViewWithTypedArrayArgument):
(WebCore::constructArrayBufferViewWithArrayBufferArgument):
(WebCore::constructArrayBufferView):
* bindings/v8/custom/V8ArrayBufferViewCustom.h:
(WebCore::constructWebGLArrayWithArrayBufferArgument):
(WebCore):
(WebCore::constructWebGLArray):
(WebCore::setWebGLArrayHelper):

LayoutTests:

* fast/canvas/webgl/array-set-invalid-arguments-expected.txt: Removed.
* fast/canvas/webgl/array-set-invalid-arguments.html: Removed.
* fast/canvas/webgl/array-set-out-of-bounds-expected.txt:
* fast/canvas/webgl/data-view-crash-expected.txt:
* fast/canvas/webgl/data-view-test-expected.txt:

Modified Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (124671 => 124672)


--- trunk/LayoutTests/ChangeLog	2012-08-03 23:36:05 UTC (rev 124671)
+++ trunk/LayoutTests/ChangeLog	2012-08-03 23:39:16 UTC (rev 124672)
@@ -1,3 +1,17 @@
+2012-08-03  Sheriff Bot  <[email protected]>
+
+        Unreviewed, rolling out r124668.
+        http://trac.webkit.org/changeset/124668
+        https://bugs.webkit.org/show_bug.cgi?id=93167
+
+        Broke Mac build (Requested by kbr_google on #webkit).
+
+        * fast/canvas/webgl/array-set-invalid-arguments-expected.txt: Removed.
+        * fast/canvas/webgl/array-set-invalid-arguments.html: Removed.
+        * fast/canvas/webgl/array-set-out-of-bounds-expected.txt:
+        * fast/canvas/webgl/data-view-crash-expected.txt:
+        * fast/canvas/webgl/data-view-test-expected.txt:
+
 2012-08-03  Julien Chaffraix  <[email protected]>
 
         Implement computePreferredLogicalWidths on RenderGrid

Deleted: trunk/LayoutTests/fast/canvas/webgl/array-set-invalid-arguments-expected.txt (124671 => 124672)


--- trunk/LayoutTests/fast/canvas/webgl/array-set-invalid-arguments-expected.txt	2012-08-03 23:36:05 UTC (rev 124671)
+++ trunk/LayoutTests/fast/canvas/webgl/array-set-invalid-arguments-expected.txt	2012-08-03 23:39:16 UTC (rev 124672)
@@ -1,29 +0,0 @@
-Verifies that attempting to set invalid elements to a Typed Array throws an exception
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-PASS typedArray.set() threw exception TypeError: Not enough arguments.
-PASS typedArray.set('hello world') threw exception TypeError: Invalid argument.
-PASS typedArray.set(otherArray, 1) threw exception RangeError: Index is out of range..
-PASS typedArray.set() threw exception TypeError: Not enough arguments.
-PASS typedArray.set('hello world') threw exception TypeError: Invalid argument.
-PASS typedArray.set(otherArray, 1) threw exception RangeError: Index is out of range..
-PASS typedArray.set() threw exception TypeError: Not enough arguments.
-PASS typedArray.set('hello world') threw exception TypeError: Invalid argument.
-PASS typedArray.set(otherArray, 1) threw exception RangeError: Index is out of range..
-PASS typedArray.set() threw exception TypeError: Not enough arguments.
-PASS typedArray.set('hello world') threw exception TypeError: Invalid argument.
-PASS typedArray.set(otherArray, 1) threw exception RangeError: Index is out of range..
-PASS typedArray.set() threw exception TypeError: Not enough arguments.
-PASS typedArray.set('hello world') threw exception TypeError: Invalid argument.
-PASS typedArray.set(otherArray, 1) threw exception RangeError: Index is out of range..
-PASS typedArray.set() threw exception TypeError: Not enough arguments.
-PASS typedArray.set('hello world') threw exception TypeError: Invalid argument.
-PASS typedArray.set(otherArray, 1) threw exception RangeError: Index is out of range..
-PASS typedArray.set() threw exception TypeError: Not enough arguments.
-PASS typedArray.set('hello world') threw exception TypeError: Invalid argument.
-PASS typedArray.set(otherArray, 1) threw exception RangeError: Index is out of range..
-PASS successfullyParsed is true
-
-TEST COMPLETE
-

Deleted: trunk/LayoutTests/fast/canvas/webgl/array-set-invalid-arguments.html (124671 => 124672)


--- trunk/LayoutTests/fast/canvas/webgl/array-set-invalid-arguments.html	2012-08-03 23:36:05 UTC (rev 124671)
+++ trunk/LayoutTests/fast/canvas/webgl/array-set-invalid-arguments.html	2012-08-03 23:39:16 UTC (rev 124672)
@@ -1,41 +0,0 @@
-<html>
-<head>
-<script src=""
-<script src=""
-</head>
-<body>
-<div id="description"></div>
-<div id="console"></div>
-
-<script>
-
-description("Verifies that attempting to set invalid elements to a Typed Array throws an exception");
-
-// Global scope so shouldThrow can see it
-var typedArray, otherArray;
-
-function negativeTestSet(typeName) {
-    var type = window[typeName];
-    typedArray = new type(10);
-
-    shouldThrow("typedArray.set()");
-    shouldThrow("typedArray.set('hello world')");
-
-    otherArray = new type(typedArray.length);
-    shouldThrow("typedArray.set(otherArray, 1)");
-}
-
-negativeTestSet("Int8Array");
-negativeTestSet("Uint8Array");
-negativeTestSet("Int16Array");
-negativeTestSet("Uint16Array");
-negativeTestSet("Int32Array");
-negativeTestSet("Uint32Array");
-negativeTestSet("Float32Array");
-
-</script>
-
-<script src=""
-</body>
-</html>
-

Modified: trunk/LayoutTests/fast/canvas/webgl/array-set-out-of-bounds-expected.txt (124671 => 124672)


--- trunk/LayoutTests/fast/canvas/webgl/array-set-out-of-bounds-expected.txt	2012-08-03 23:36:05 UTC (rev 124671)
+++ trunk/LayoutTests/fast/canvas/webgl/array-set-out-of-bounds-expected.txt	2012-08-03 23:39:16 UTC (rev 124672)
@@ -4,26 +4,26 @@
 
 Regression test for https://bugs.webkit.org/show_bug.cgi?id=33352 : Passing array that is too large to set method of WebGLArrays does not throw an exception
 Testing Int8Array
-PASS webGLArray.set([4, 5], 1) threw exception RangeError: Index is out of range..
-PASS webGLArray.set([4, 5, 6]) threw exception RangeError: Index is out of range..
+PASS webGLArray.set([4, 5], 1) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
+PASS webGLArray.set([4, 5, 6]) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
 Testing Uint8Array
-PASS webGLArray.set([4, 5], 1) threw exception RangeError: Index is out of range..
-PASS webGLArray.set([4, 5, 6]) threw exception RangeError: Index is out of range..
+PASS webGLArray.set([4, 5], 1) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
+PASS webGLArray.set([4, 5, 6]) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
 Testing Int16Array
-PASS webGLArray.set([4, 5], 1) threw exception RangeError: Index is out of range..
-PASS webGLArray.set([4, 5, 6]) threw exception RangeError: Index is out of range..
+PASS webGLArray.set([4, 5], 1) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
+PASS webGLArray.set([4, 5, 6]) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
 Testing Uint16Array
-PASS webGLArray.set([4, 5], 1) threw exception RangeError: Index is out of range..
-PASS webGLArray.set([4, 5, 6]) threw exception RangeError: Index is out of range..
+PASS webGLArray.set([4, 5], 1) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
+PASS webGLArray.set([4, 5, 6]) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
 Testing Int32Array
-PASS webGLArray.set([4, 5], 1) threw exception RangeError: Index is out of range..
-PASS webGLArray.set([4, 5, 6]) threw exception RangeError: Index is out of range..
+PASS webGLArray.set([4, 5], 1) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
+PASS webGLArray.set([4, 5, 6]) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
 Testing Uint32Array
-PASS webGLArray.set([4, 5], 1) threw exception RangeError: Index is out of range..
-PASS webGLArray.set([4, 5, 6]) threw exception RangeError: Index is out of range..
+PASS webGLArray.set([4, 5], 1) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
+PASS webGLArray.set([4, 5, 6]) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
 Testing Float32Array
-PASS webGLArray.set([4, 5], 1) threw exception RangeError: Index is out of range..
-PASS webGLArray.set([4, 5, 6]) threw exception RangeError: Index is out of range..
+PASS webGLArray.set([4, 5], 1) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
+PASS webGLArray.set([4, 5, 6]) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/fast/canvas/webgl/data-view-crash-expected.txt (124671 => 124672)


--- trunk/LayoutTests/fast/canvas/webgl/data-view-crash-expected.txt	2012-08-03 23:36:05 UTC (rev 124671)
+++ trunk/LayoutTests/fast/canvas/webgl/data-view-crash-expected.txt	2012-08-03 23:39:16 UTC (rev 124672)
@@ -2,8 +2,8 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-PASS view = new DataView(array.buffer, -4500000000) threw exception RangeError: Size is too large (or is negative)..
-PASS view = new DataView(array.buffer, -4500000000, 4500000000) threw exception RangeError: Size is too large (or is negative)..
+PASS view = new DataView(array.buffer, -4500000000) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
+PASS view = new DataView(array.buffer, -4500000000, 4500000000) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/fast/canvas/webgl/data-view-test-expected.txt (124671 => 124672)


--- trunk/LayoutTests/fast/canvas/webgl/data-view-test-expected.txt	2012-08-03 23:36:05 UTC (rev 124671)
+++ trunk/LayoutTests/fast/canvas/webgl/data-view-test-expected.txt	2012-08-03 23:39:16 UTC (rev 124672)
@@ -22,9 +22,9 @@
 PASS view.byteLength is 1
 
 Test for constructor throwing exception
-PASS view = new DataView(arayBuffer, 0, 3) threw exception RangeError: Size is too large (or is negative)..
-PASS view = new DataView(arayBuffer, 1, 2) threw exception RangeError: Size is too large (or is negative)..
-PASS view = new DataView(arayBuffer, 2, 1) threw exception RangeError: Size is too large (or is negative)..
+PASS view = new DataView(arayBuffer, 0, 3) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
+PASS view = new DataView(arayBuffer, 1, 2) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
+PASS view = new DataView(arayBuffer, 2, 1) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
 
 Test for get methods that work
 PASS view.getInt8(0) is 0

Modified: trunk/Source/WebCore/ChangeLog (124671 => 124672)


--- trunk/Source/WebCore/ChangeLog	2012-08-03 23:36:05 UTC (rev 124671)
+++ trunk/Source/WebCore/ChangeLog	2012-08-03 23:39:16 UTC (rev 124672)
@@ -1,3 +1,23 @@
+2012-08-03  Sheriff Bot  <[email protected]>
+
+        Unreviewed, rolling out r124668.
+        http://trac.webkit.org/changeset/124668
+        https://bugs.webkit.org/show_bug.cgi?id=93167
+
+        Broke Mac build (Requested by kbr_google on #webkit).
+
+        * bindings/js/JSArrayBufferViewHelper.h:
+        (WebCore::setWebGLArrayWithTypedArrayArgument):
+        (WebCore::setWebGLArrayHelper):
+        (WebCore::constructArrayBufferViewWithTypedArrayArgument):
+        (WebCore::constructArrayBufferViewWithArrayBufferArgument):
+        (WebCore::constructArrayBufferView):
+        * bindings/v8/custom/V8ArrayBufferViewCustom.h:
+        (WebCore::constructWebGLArrayWithArrayBufferArgument):
+        (WebCore):
+        (WebCore::constructWebGLArray):
+        (WebCore::setWebGLArrayHelper):
+
 2012-08-03  Julien Chaffraix  <[email protected]>
 
         Implement computePreferredLogicalWidths on RenderGrid

Modified: trunk/Source/WebCore/bindings/js/JSArrayBufferViewHelper.h (124671 => 124672)


--- trunk/Source/WebCore/bindings/js/JSArrayBufferViewHelper.h	2012-08-03 23:36:05 UTC (rev 124671)
+++ trunk/Source/WebCore/bindings/js/JSArrayBufferViewHelper.h	2012-08-03 23:39:16 UTC (rev 124672)
@@ -27,6 +27,7 @@
 #ifndef JSArrayBufferViewHelper_h
 #define JSArrayBufferViewHelper_h
 
+#include "ExceptionCode.h"
 #include "JSArrayBuffer.h"
 #include "JSArrayBufferView.h"
 #include "JSDOMBinding.h"
@@ -40,9 +41,6 @@
 
 namespace WebCore {
 
-static const char* tooLargeSize = "Size is too large (or is negative).";
-static const char* outOfRangeLengthAndOffset = "Index is out of range.";
-
 template<class C, typename T>
 bool copyTypedArrayBuffer(C* target, ArrayBufferView* source, unsigned sourceLength, unsigned offset)
 {
@@ -117,7 +115,7 @@
     uint32_t length = asObject(exec->argument(0))->get(exec, JSC::Identifier(exec, "length")).toUInt32(exec);
 
     if (!(copyTypedArrayBuffer<C, T>(impl, array.get(), length, offset)))
-        throwError(exec, createRangeError(exec, outOfRangeLengthAndOffset));
+        setDOMException(exec, INDEX_SIZE_ERR);
 
     return true;
 }
@@ -126,7 +124,7 @@
 JSC::JSValue setWebGLArrayHelper(JSC::ExecState* exec, C* impl)
 {
     if (exec->argumentCount() < 1)
-        return JSC::throwError(exec, createNotEnoughArgumentsError(exec));
+        return JSC::throwSyntaxError(exec);
 
     if (setWebGLArrayWithTypedArrayArgument<C, T>(exec, impl))
         // void set(in WebGL<>Array array, [Optional] in unsigned long offset);
@@ -140,7 +138,7 @@
             offset = exec->argument(1).toInt32(exec);
         uint32_t length = array->get(exec, JSC::Identifier(exec, "length")).toInt32(exec);
         if (!impl->checkInboundData(offset, length))
-            throwError(exec, createRangeError(exec, outOfRangeLengthAndOffset));
+            setDOMException(exec, INDEX_SIZE_ERR);
         else {
             for (uint32_t i = 0; i < length; i++) {
                 JSC::JSValue v = array->get(exec, i);
@@ -153,7 +151,7 @@
         return JSC::jsUndefined();
     }
 
-    return JSC::throwTypeError(exec, "Invalid argument");
+    return JSC::throwSyntaxError(exec);
 }
 
 // Template function used by XXXArrayConstructors.
@@ -172,12 +170,12 @@
     uint32_t length = asObject(exec->argument(0))->get(exec, JSC::Identifier(exec, "length")).toUInt32(exec);
     RefPtr<C> array = C::createUninitialized(length);
     if (!array) {
-        throwError(exec, createRangeError(exec, tooLargeSize));
+        setDOMException(exec, INDEX_SIZE_ERR);
         return array;
     }
 
     if (!(copyTypedArrayBuffer<C, T>(array.get(), source.get(), length, 0))) {
-        throwError(exec, createRangeError(exec, tooLargeSize));
+        setDOMException(exec, INDEX_SIZE_ERR);
         return array;
     }
 
@@ -206,7 +204,7 @@
     }
     RefPtr<C> array = C::create(buffer, offset, length);
     if (!array)
-        throwError(exec, createRangeError(exec, tooLargeSize));
+        setDOMException(exec, INDEX_SIZE_ERR);
     return array;
 }
 
@@ -247,7 +245,7 @@
         uint32_t length = srcArray->get(exec, JSC::Identifier(exec, "length")).toUInt32(exec);
         RefPtr<C> array = C::createUninitialized(length);
         if (!array) {
-            throwError(exec, createRangeError(exec, tooLargeSize));
+            setDOMException(exec, INDEX_SIZE_ERR);
             return array;
         }
 
@@ -263,7 +261,7 @@
     if (length >= 0)
         result = C::create(static_cast<unsigned>(length));
     if (!result)
-        throwError(exec, createRangeError(exec, tooLargeSize));
+        throwError(exec, createRangeError(exec, "ArrayBufferView size is not a small enough positive integer."));
     return result;
 }
 

Modified: trunk/Source/WebCore/bindings/v8/custom/V8ArrayBufferViewCustom.h (124671 => 124672)


--- trunk/Source/WebCore/bindings/v8/custom/V8ArrayBufferViewCustom.h	2012-08-03 23:36:05 UTC (rev 124671)
+++ trunk/Source/WebCore/bindings/v8/custom/V8ArrayBufferViewCustom.h	2012-08-03 23:39:16 UTC (rev 124672)
@@ -40,9 +40,6 @@
 
 namespace WebCore {
 
-static const char* tooLargeSize = "Size is too large (or is negative).";
-static const char* outOfRangeLengthAndOffset = "Index is out of range.";
-
 // Copy the elements from the source array to the typed destination array.
 // Returns true if it succeeded, otherwise returns false.
 bool copyElements(v8::Handle<v8::Object> destArray, v8::Handle<v8::Object> srcArray, uint32_t length, uint32_t offset, v8::Isolate*);
@@ -87,11 +84,13 @@
     }
     RefPtr<ArrayClass> array = ArrayClass::create(buf, offset, length);
     if (!array)
-        return V8Proxy::throwError(V8Proxy::RangeError, tooLargeSize, args.GetIsolate());
+        return V8Proxy::setDOMException(INDEX_SIZE_ERR, args.GetIsolate());
 
     return wrapArrayBufferView(args, type, array, arrayType, hasIndexer);
 }
 
+static const char* notSmallEnoughSize = "ArrayBufferView size is not a small enough positive integer.";
+
 // Template function used by the ArrayBufferView*Constructor callbacks.
 template<class ArrayClass, class _javascript_WrapperArrayType, class ElementType>
 v8::Handle<v8::Value> constructWebGLArray(const v8::Arguments& args, WrapperTypeInfo* type, v8::ExternalArrayType arrayType)
@@ -145,7 +144,7 @@
         uint32_t length = source->length();
         RefPtr<ArrayClass> array = ArrayClass::createUninitialized(length);
         if (!array.get())
-            return V8Proxy::throwError(V8Proxy::RangeError, tooLargeSize, args.GetIsolate());
+            return V8Proxy::throwError(V8Proxy::RangeError, notSmallEnoughSize, args.GetIsolate());
 
         memcpy(array->baseAddress(), source->baseAddress(), length * sizeof(ElementType));
 
@@ -180,7 +179,7 @@
     }
 
     if (!array.get())
-        return V8Proxy::throwError(V8Proxy::RangeError, tooLargeSize, args.GetIsolate());
+        return V8Proxy::throwError(V8Proxy::RangeError, notSmallEnoughSize, args.GetIsolate());
 
 
     // Transform the holder into a wrapper object for the array.
@@ -205,7 +204,7 @@
 v8::Handle<v8::Value> setWebGLArrayHelper(const v8::Arguments& args)
 {
     if (args.Length() < 1)
-        return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
+        return V8Proxy::setDOMException(SYNTAX_ERR, args.GetIsolate());
 
     CPlusPlusArrayType* impl = _javascript_WrapperArrayType::toNative(args.Holder());
 
@@ -216,7 +215,7 @@
         if (args.Length() == 2)
             offset = toUInt32(args[1]);
         if (!impl->set(src, offset))
-            return V8Proxy::throwError(V8Proxy::RangeError, outOfRangeLengthAndOffset, args.GetIsolate());
+            return V8Proxy::setDOMException(INDEX_SIZE_ERR, args.GetIsolate());
         return v8::Undefined();
     }
 
@@ -231,7 +230,7 @@
             || offset + length > impl->length()
             || offset + length < offset) {
             // Out of range offset or overflow
-            return V8Proxy::throwError(V8Proxy::RangeError, outOfRangeLengthAndOffset, args.GetIsolate());
+            return V8Proxy::setDOMException(INDEX_SIZE_ERR, args.GetIsolate());
         }
         bool copied = copyElements(args.Holder(), array, length, offset, args.GetIsolate());
         if (!copied) {
@@ -241,7 +240,7 @@
         return v8::Undefined();
     }
 
-    return V8Proxy::throwTypeError("Invalid argument", args.GetIsolate());
+    return V8Proxy::setDOMException(SYNTAX_ERR, args.GetIsolate());
 }
 
 }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to