Changeset 53026 in webkit
- Timestamp:
- Jan 8, 2010 5:02:53 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r53024 r53026 1 2010-01-08 Kenneth Russell <kbr@google.com> 2 3 Reviewed by Dimitri Glazkov. 4 5 Passing array that is too large to set method of WebGLArrays does not throw an exception 6 https://bugs.webkit.org/show_bug.cgi?id=33352 7 8 Added needed range checks to JSC and V8 custom bindings. Expanded 9 preexisting test suite for WebGLArrays and updated its expected 10 results. Tested in WebKit and Chromium. 11 12 * fast/canvas/webgl/array-set-out-of-bounds-expected.txt: Added. 13 * fast/canvas/webgl/array-set-out-of-bounds.html: Added. 14 * fast/canvas/webgl/array-unit-tests-expected.txt: 15 * fast/canvas/webgl/array-unit-tests.html: 16 1 17 2010-01-08 Eric Seidel <eric@webkit.org> 2 18 -
trunk/LayoutTests/fast/canvas/webgl/array-unit-tests-expected.txt
r53009 r53026 11 11 PASS negativeTest WebGLByteArray SetFromWebGLArray 12 12 PASS test WebGLByteArray SetFromArray 13 PASS negativeTest WebGLByteArray SetFromArray 13 14 PASS test WebGLByteArray Slice 14 15 PASS negativeTest WebGLByteArray Slice … … 22 23 PASS negativeTest WebGLFloatArray SetFromWebGLArray 23 24 PASS test WebGLFloatArray SetFromArray 25 PASS negativeTest WebGLFloatArray SetFromArray 24 26 PASS test WebGLFloatArray Slice 25 27 PASS negativeTest WebGLFloatArray Slice … … 33 35 PASS negativeTest WebGLIntArray SetFromWebGLArray 34 36 PASS test WebGLIntArray SetFromArray 37 PASS negativeTest WebGLIntArray SetFromArray 35 38 PASS test WebGLIntArray Slice 36 39 PASS negativeTest WebGLIntArray Slice … … 44 47 PASS negativeTest WebGLShortArray SetFromWebGLArray 45 48 PASS test WebGLShortArray SetFromArray 49 PASS negativeTest WebGLShortArray SetFromArray 46 50 PASS test WebGLShortArray Slice 47 51 PASS negativeTest WebGLShortArray Slice … … 55 59 PASS negativeTest WebGLUnsignedByteArray SetFromWebGLArray 56 60 PASS test WebGLUnsignedByteArray SetFromArray 61 PASS negativeTest WebGLUnsignedByteArray SetFromArray 57 62 PASS test WebGLUnsignedByteArray Slice 58 63 PASS negativeTest WebGLUnsignedByteArray Slice … … 66 71 PASS negativeTest WebGLUnsignedIntArray SetFromWebGLArray 67 72 PASS test WebGLUnsignedIntArray SetFromArray 73 PASS negativeTest WebGLUnsignedIntArray SetFromArray 68 74 PASS test WebGLUnsignedIntArray Slice 69 75 PASS negativeTest WebGLUnsignedIntArray Slice … … 77 83 PASS negativeTest WebGLUnsignedShortArray SetFromWebGLArray 78 84 PASS test WebGLUnsignedShortArray SetFromArray 85 PASS negativeTest WebGLUnsignedShortArray SetFromArray 79 86 PASS test WebGLUnsignedShortArray Slice 80 87 PASS negativeTest WebGLUnsignedShortArray Slice -
trunk/LayoutTests/fast/canvas/webgl/array-unit-tests.html
r53009 r53026 33 33 exc = currentlyRunning + ': ' + str; 34 34 else 35 exc = str;35 exc = currentlyRunning; 36 36 testFailed(exc); 37 37 } … … 278 278 for (var i = 0; i < array2.length; i++) { 279 279 assertEq('Element ' + i, 10 - i, array[i]); 280 } 281 pass(); 282 } catch (e) { 283 fail(e); 284 } 285 } 286 287 function negativeTestSetFromArray(type, name) { 288 running('negativeTest ' + name + ' SetFromArray'); 289 try { 290 var array = new type([2, 3]); 291 try { 292 array.set([4, 5], 1); 293 fail(); 294 return; 295 } catch (e) { 296 } 297 try { 298 array.set([4, 5, 6]); 299 fail(); 300 return; 301 } catch (e) { 280 302 } 281 303 pass(); … … 431 453 negativeTestSetFromWebGLArray(type, name); 432 454 testSetFromArray(type, name); 455 negativeTestSetFromArray(type, name); 433 456 testSlice(type, name); 434 457 negativeTestSlice(type, name); -
trunk/WebCore/ChangeLog
r53023 r53026 1 2010-01-08 Kenneth Russell <kbr@google.com> 2 3 Reviewed by Dimitri Glazkov. 4 5 Passing array that is too large to set method of WebGLArrays does not throw an exception 6 https://bugs.webkit.org/show_bug.cgi?id=33352 7 8 Added needed range checks to JSC and V8 custom bindings. Expanded 9 preexisting test suite for WebGLArrays and updated its expected 10 results. Tested in WebKit and Chromium. 11 12 Test: fast/canvas/webgl/array-set-out-of-bounds.html 13 14 * bindings/js/JSWebGLArrayHelper.h: 15 (WebCore::setWebGLArrayFromArray): 16 * bindings/v8/custom/V8WebGLArrayCustom.h: 17 (WebCore::setWebGLArrayFromArray): 18 1 19 2010-01-08 Alexey Proskuryakov <ap@apple.com> 2 20 -
trunk/WebCore/bindings/js/JSWebGLArrayHelper.h
r51051 r53026 28 28 #define JSWebGLArrayHelper_h 29 29 30 #include "ExceptionCode.h" 31 #include "JSDOMBinding.h" 30 32 #include <interpreter/CallFrame.h> 31 33 #include <runtime/ArgList.h> … … 46 48 offset = args.at(1).toInt32(exec); 47 49 int length = array->get(exec, JSC::Identifier(exec, "length")).toInt32(exec); 48 for (int i = 0; i < length; i++) { 49 JSC::JSValue v = array->get(exec, i); 50 if (exec->hadException()) 51 return JSC::jsUndefined(); 52 webGLArray->set(i + offset, v.toNumber(exec)); 50 if (offset + length > webGLArray->length()) 51 setDOMException(exec, INDEX_SIZE_ERR); 52 else { 53 for (int i = 0; i < length; i++) { 54 JSC::JSValue v = array->get(exec, i); 55 if (exec->hadException()) 56 return JSC::jsUndefined(); 57 webGLArray->set(i + offset, v.toNumber(exec)); 58 } 53 59 } 54 60 -
trunk/WebCore/bindings/v8/custom/V8WebGLArrayCustom.h
r52058 r53026 175 175 offset = toInt32(args[1]); 176 176 uint32_t length = toInt32(array->Get(v8::String::New("length"))); 177 for (uint32_t i = 0; i < length; i++) { 178 webGLArray->set(offset + i, array->Get(v8::Integer::New(i))->NumberValue()); 179 } 177 if (offset + length > webGLArray->length()) 178 V8Proxy::setDOMException(INDEX_SIZE_ERR); 179 else 180 for (uint32_t i = 0; i < length; i++) 181 webGLArray->set(offset + i, array->Get(v8::Integer::New(i))->NumberValue()); 180 182 } 181 183
Note: See TracChangeset
for help on using the changeset viewer.