Changeset 138393 in webkit
- Timestamp:
- Dec 21, 2012, 11:38:28 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r138392 r138393 1 2012-12-21 Kenneth Russell <kbr@google.com> 2 3 Expose ArrayBufferView constructor on DOMWindow 4 https://bugs.webkit.org/show_bug.cgi?id=105605 5 6 Reviewed by Sam Weinig. 7 8 Updated test from Khronos repository. 9 10 * fast/canvas/webgl/array-unit-tests-expected.txt: 11 * fast/canvas/webgl/array-unit-tests.html: 12 1 13 2012-12-21 Csaba Osztrogonác <ossy@webkit.org> 2 14 -
trunk/LayoutTests/fast/canvas/webgl/array-unit-tests-expected.txt
r109918 r138393 3 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". 4 4 5 PASS testSlice 6 test inheritance hierarchy of typed array views 7 PASS ArrayBufferView does not have [NoInterfaceObject] extended attribute and should be defined 8 PASS new Int8Array(1) instanceof ArrayBufferView is true 9 PASS new Uint8Array(1) instanceof ArrayBufferView is true 10 PASS new Uint8ClampedArray(1) instanceof ArrayBufferView is true 11 PASS new Int16Array(1) instanceof ArrayBufferView is true 12 PASS new Uint16Array(1) instanceof ArrayBufferView is true 13 PASS new Int32Array(1) instanceof ArrayBufferView is true 14 PASS new Uint32Array(1) instanceof ArrayBufferView is true 15 PASS new Float32Array(1) instanceof ArrayBufferView is true 16 PASS new Float64Array(1) instanceof ArrayBufferView is true 17 PASS new DataView(new ArrayBuffer(8)) instanceof ArrayBufferView is true 18 PASS new ArrayBufferView() threw TypeError 19 PASS new Uint8ClampedArray(1) instanceof Uint8Array is true 5 20 PASS test Float32Array SetAndGetPos10ToNeg10 6 21 PASS test Float32Array ConstructWithArrayOfSignedValues -
trunk/LayoutTests/fast/canvas/webgl/array-unit-tests.html
r109918 r138393 71 71 72 72 try { 73 running('testSlice'); 73 74 var buffer = new ArrayBuffer(32); 74 75 var array = new Int8Array(buffer); … … 103 104 test("buffer.slice(-40, 16)", 0, 16); 104 105 test("buffer.slice(-40, 40)", 0, 32); 106 pass(); 105 107 } catch (e) { 106 108 fail(e); … … 219 221 220 222 if (unsigned) { 221 sourceData = [0.6, 10.6 ];223 sourceData = [0.6, 10.6, 0.2, 10.2, 10.5, 11.5]; 222 224 if (type === Uint8ClampedArray) { 223 expectedResults = [1, 11 ];225 expectedResults = [1, 11, 0, 10, 10, 12]; 224 226 } else { 225 expectedResults = [0, 10 ];227 expectedResults = [0, 10, 0, 10, 10, 11]; 226 228 } 227 229 } else { … … 550 552 } catch (e) { 551 553 testPassed(text + " threw an exception"); 554 } 555 } 556 557 function shouldThrowTypeError(func, text) { 558 var ok = false; 559 try { 560 func(); 561 } catch (e) { 562 if (e instanceof TypeError) { 563 ok = true; 564 } 565 } 566 if (ok) { 567 testPassed(text + " threw TypeError"); 568 } else { 569 testFailed(text + " should throw TypeError"); 552 570 } 553 571 } … … 902 920 } 903 921 922 function testInheritanceHierarchy() { 923 debug('test inheritance hierarchy of typed array views'); 924 925 try { 926 var foo = ArrayBufferView; 927 testPassed('ArrayBufferView does not have [NoInterfaceObject] extended attribute and should be defined'); 928 929 shouldBe('new Int8Array(1) instanceof ArrayBufferView', 'true'); 930 shouldBe('new Uint8Array(1) instanceof ArrayBufferView', 'true'); 931 shouldBe('new Uint8ClampedArray(1) instanceof ArrayBufferView', 'true'); 932 shouldBe('new Int16Array(1) instanceof ArrayBufferView', 'true'); 933 shouldBe('new Uint16Array(1) instanceof ArrayBufferView', 'true'); 934 shouldBe('new Int32Array(1) instanceof ArrayBufferView', 'true'); 935 shouldBe('new Uint32Array(1) instanceof ArrayBufferView', 'true'); 936 shouldBe('new Float32Array(1) instanceof ArrayBufferView', 'true'); 937 shouldBe('new Float64Array(1) instanceof ArrayBufferView', 'true'); 938 shouldBe('new DataView(new ArrayBuffer(8)) instanceof ArrayBufferView', 'true'); 939 940 shouldThrowTypeError(function() { new ArrayBufferView() }, "new ArrayBufferView()"); 941 } catch (e) { 942 testFailed('ArrayBufferView does not have [NoInterfaceObject] extended attribute but was not defined'); 943 } 944 945 // There is currently only one kind of view that inherits from another 946 shouldBe('new Uint8ClampedArray(1) instanceof Uint8Array', 'true'); 947 } 948 949 904 950 // 905 951 // Test driver … … 910 956 911 957 testSlice(); 958 testInheritanceHierarchy(); 912 959 913 960 // The "name" attribute is a concession to browsers which don't -
trunk/Source/WebCore/ChangeLog
r138391 r138393 1 2012-12-21 Kenneth Russell <kbr@google.com> 2 3 Expose ArrayBufferView constructor on DOMWindow 4 https://bugs.webkit.org/show_bug.cgi?id=105605 5 6 Reviewed by Sam Weinig. 7 8 Update IDL to track recent spec change exposing ArrayBufferView 9 constructor on DOMWindow for instanceof checks. There are no 10 constructors exposed in the Web IDL, however, so calling it via 11 operator new throws TypeError. 12 13 Test (updated): fast/canvas/webgl/array-unit-tests.html 14 15 * html/canvas/ArrayBufferView.idl: 16 Removed OmitConstructor attribute. 17 * page/DOMWindow.idl: 18 Exposed ArrayBufferView constructor function attribute. 19 1 20 2012-12-21 Brady Eidson <beidson@apple.com> 2 21 -
trunk/Source/WebCore/html/canvas/ArrayBufferView.idl
r131172 r138393 26 26 [ 27 27 CustomToJSObject, 28 JSNoStaticTables, 29 OmitConstructor 28 JSNoStaticTables 30 29 ] interface ArrayBufferView { 31 30 readonly attribute ArrayBuffer buffer; -
trunk/Source/WebCore/page/DOMWindow.idl
r138165 r138393 530 530 531 531 attribute ArrayBufferConstructor ArrayBuffer; // Usable with new operator 532 attribute ArrayBufferViewConstructor ArrayBufferView; 532 533 attribute Int8ArrayConstructor Int8Array; // Usable with new operator 533 534 attribute Uint8ArrayConstructor Uint8Array; // Usable with new operator
Note:
See TracChangeset
for help on using the changeset viewer.