Skip to content
Permalink
Browse files
2011-05-24 Kenneth Russell <kbr@google.com>
        Reviewed by James Robinson.

        Implement Float64Array
        https://bugs.webkit.org/show_bug.cgi?id=39144

        Implemented Float64Array based on the existing Float32Array sources.
        Built and tested in Chromium on Linux and Mac OS X and Safari on Mac OS X.

        * CMakeLists.txt:
        * CodeGenerators.pri:
        * DerivedSources.cpp:
        * DerivedSources.make:
        * GNUmakefile.list.am:
        * UseJSC.cmake:
        * WebCore.gypi:
        * WebCore.pro:
        * WebCore.vcproj/WebCore.vcproj:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSBindingsAllInOne.cpp:
        * bindings/js/JSDOMWindowCustom.cpp:
        (WebCore::JSDOMWindow::float64Array):
        * bindings/js/JSFloat64ArrayCustom.cpp: Added.
        (WebCore::JSFloat64Array::indexSetter):
        (WebCore::toJS):
        (WebCore::JSFloat64Array::set):
        (WebCore::JSFloat64ArrayConstructor::constructJSFloat64Array):
        * bindings/v8/custom/V8Float64ArrayCustom.cpp: Added.
        (WebCore::V8Float64Array::constructorCallback):
        (WebCore::V8Float64Array::setCallback):
        (WebCore::toV8):
        * html/canvas/ArrayBufferView.h:
        (WebCore::ArrayBufferView::isDoubleArray):
        * html/canvas/Float64Array.cpp: Added.
        (WebCore::Float64Array::create):
        (WebCore::Float64Array::Float64Array):
        (WebCore::Float64Array::subarray):
        * html/canvas/Float64Array.h: Added.
        (WebCore::Float64Array::set):
        (WebCore::Float64Array::item):
        (WebCore::Float64Array::isDoubleArray):
        * html/canvas/Float64Array.idl: Added.
        * page/DOMWindow.idl:
        * workers/WorkerContext.idl:
2011-05-24  Kenneth Russell  <kbr@google.com>

        Reviewed by James Robinson.

        Implement Float64Array
        https://bugs.webkit.org/show_bug.cgi?id=39144

        Added unit tests to existing typed array tests in Khronos repository and
        synced layout test with them. Updated other affected layout tests.

        * fast/canvas/webgl/array-unit-tests-expected.txt:
        * fast/canvas/webgl/array-unit-tests.html:
        * fast/dom/Window/script-tests/window-property-descriptors.js:
        * fast/dom/Window/window-properties.html:
        * fast/dom/script-tests/constructed-objects-prototypes.js:
        (constructorPropertiesOnWindow):
        * fast/dom/script-tests/prototype-inheritance-2.js:
        (constructorNamesForWindow):
        * fast/dom/script-tests/prototype-inheritance.js:
        * fast/js/script-tests/global-constructors.js:


Canonical link: https://commits.webkit.org/76774@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@87197 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
kenrussell committed May 24, 2011
1 parent d3ff960 commit c1b1bde8b7d1cbdef837ae5a10580f96940a8de2
Showing with 498 additions and 2 deletions.
  1. +21 −0 LayoutTests/ChangeLog
  2. +44 −0 LayoutTests/fast/canvas/webgl/array-unit-tests-expected.txt
  3. +14 −1 LayoutTests/fast/canvas/webgl/array-unit-tests.html
  4. +1 −0 LayoutTests/fast/dom/Window/script-tests/window-property-descriptors.js
  5. +1 −0 LayoutTests/fast/dom/Window/window-properties.html
  6. +1 −0 LayoutTests/fast/dom/script-tests/constructed-objects-prototypes.js
  7. +1 −0 LayoutTests/fast/dom/script-tests/prototype-inheritance-2.js
  8. +1 −1 LayoutTests/fast/dom/script-tests/prototype-inheritance.js
  9. +1 −0 LayoutTests/fast/js/script-tests/global-constructors.js
  10. +2 −0 Source/WebCore/CMakeLists.txt
  11. +46 −0 Source/WebCore/ChangeLog
  12. +1 −0 Source/WebCore/CodeGenerators.pri
  13. +1 −0 Source/WebCore/DerivedSources.cpp
  14. +1 −0 Source/WebCore/DerivedSources.make
  15. +5 −0 Source/WebCore/GNUmakefile.list.am
  16. +1 −0 Source/WebCore/UseJSC.cmake
  17. +5 −0 Source/WebCore/WebCore.gypi
  18. +4 −0 Source/WebCore/WebCore.pro
  19. +8 −0 Source/WebCore/WebCore.vcproj/WebCore.vcproj
  20. +22 −0 Source/WebCore/WebCore.xcodeproj/project.pbxproj
  21. +1 −0 Source/WebCore/bindings/js/JSBindingsAllInOne.cpp
  22. +6 −0 Source/WebCore/bindings/js/JSDOMWindowCustom.cpp
  23. +61 −0 Source/WebCore/bindings/js/JSFloat64ArrayCustom.cpp
  24. +61 −0 Source/WebCore/bindings/v8/custom/V8Float64ArrayCustom.cpp
  25. +1 −0 Source/WebCore/html/canvas/ArrayBufferView.h
  26. +62 −0 Source/WebCore/html/canvas/Float64Array.cpp
  27. +75 −0 Source/WebCore/html/canvas/Float64Array.h
  28. +48 −0 Source/WebCore/html/canvas/Float64Array.idl
  29. +1 −0 Source/WebCore/page/DOMWindow.idl
  30. +1 −0 Source/WebCore/workers/WorkerContext.idl
@@ -1,3 +1,24 @@
2011-05-24 Kenneth Russell <kbr@google.com>

Reviewed by James Robinson.

Implement Float64Array
https://bugs.webkit.org/show_bug.cgi?id=39144

Added unit tests to existing typed array tests in Khronos repository and
synced layout test with them. Updated other affected layout tests.

* fast/canvas/webgl/array-unit-tests-expected.txt:
* fast/canvas/webgl/array-unit-tests.html:
* fast/dom/Window/script-tests/window-property-descriptors.js:
* fast/dom/Window/window-properties.html:
* fast/dom/script-tests/constructed-objects-prototypes.js:
(constructorPropertiesOnWindow):
* fast/dom/script-tests/prototype-inheritance-2.js:
(constructorNamesForWindow):
* fast/dom/script-tests/prototype-inheritance.js:
* fast/js/script-tests/global-constructors.js:

2011-05-24 Ryosuke Niwa <rniwa@webkit.org>

Skip the tests added by r87096 and remove the failing test expectations on Qt.
@@ -46,6 +46,50 @@ PASS Setting Float32Array from Float32Array with out-of-range offset was caught
PASS array.get is undefined.
PASS array.set(0, 1) threw exception.
PASS test storing NaN in Float32Array
PASS test Float64Array SetAndGetPos10ToNeg10
PASS test Float64Array ConstructWithArrayOfSignedValues
PASS test Float64Array ConstructWithTypedArrayOfSignedValues
Testing Float64Array GetWithOutOfRangeIndices
PASS array[2] is undefined.
PASS array[-1] is undefined.
PASS array[0x20000000] is undefined.
PASS test Float64Array OffsetsAndSizes
PASS test Float64Array SetFromTypedArray
PASS negativeTest Float64Array SetFromTypedArray
PASS test Float64Array SetFromArray
PASS negativeTest Float64Array SetFromArray
PASS test Float64Array Subarray
PASS negativeTest Float64Array Subarray
PASS test Float64Array SetBoundaryConditions
PASS test Float64Array ConstructionBoundaryConditions
PASS Construction of Float64Array with null buffer threw exception
PASS Construction of Float64Array with (null buffer, 0) threw exception
PASS Construction of Float64Array with (null buffer, 0, 0) threw exception
PASS Construction of Float64Array with out-of-range values threw an exception
PASS Construction of ArrayBuffer with negative size threw exception
PASS Construction of Float64Array with negative size threw exception
PASS Construction of Float64Array with negative out-of-range values threw an exception
PASS Construction of Float64Array with unaligned offset threw an exception
PASS Construction of Float64Array with unaligned length threw an exception
PASS Construction of huge Float64Array threw exception
PASS Array lengths matched with explicit and implicit creation of ArrayBuffer
Testing subarray of Float64Array
PASS array.length is 32 / typeSize
PASS array.subarray(4, 0x3FFFFFFF).length is (32 / typeSize) - 4
PASS array.subarray(4, -2147483648).length is 0
PASS array.length is 0
Testing subarray with default inputs of Float64Array
PASS array.length is 32 / typeSize
PASS array.subarray(0).length is (32 / typeSize)
PASS array.subarray(2).length is (32 / typeSize) - 2
PASS array.subarray(-2).length is 2
PASS array.subarray(-2147483648).length is (32 / typeSize)
PASS Setting Float64Array from array with out-of-range offset was caught
PASS Setting Float64Array from fake array with invalid length was caught
PASS Setting Float64Array from Float64Array with out-of-range offset was caught
PASS array.get is undefined.
PASS array.set(0, 1) threw exception.
PASS test storing NaN in Float64Array
PASS test Int8Array SetAndGetPos10ToNeg10
PASS test Int8Array ConstructWithArrayOfSignedValues
PASS test Int8Array ConstructWithTypedArrayOfSignedValues
@@ -674,6 +674,12 @@
results[i] = array[i];
}
break;
case Float64Array:
for (var i = 0; i < array.length; ++i) {
array[i] = NaN;
results[i] = array[i];
}
break;
case Int8Array:
for (var i = 0; i < array.length; ++i) {
array[i] = NaN;
@@ -716,7 +722,7 @@
}

// Some types preserve NaN values; all other types convert NaN to zero.
if (type === Float32Array) {
if (type === Float32Array || type === Float64Array) {
assert('initial NaN preserved', isNaN(new type([NaN])[0]));
for (var i = 0; i < array.length; ++i)
assert('NaN preserved via setter', isNaN(results[i]));
@@ -749,6 +755,13 @@
testValues: [ -500.5, 500.5 ],
expectedValues: [ -500.5, 500.5 ]
},
{name: "Float64Array",
unsigned: false,
integral: false,
elementSizeInBytes: 8,
testValues: [ -500.5, 500.5 ],
expectedValues: [ -500.5, 500.5 ]
},
{name: "Int8Array",
unsigned: false,
integral: true,
@@ -37,6 +37,7 @@ var __skip__ = {
"Int32Array" : 1,
"Uint32Array" : 1,
"Float32Array" : 1,
"Float64Array" : 1,
"FileError" : 1,
"FileReader" : 1,
"WebKitBlobBuilder" : 1,
@@ -79,6 +79,7 @@
"window.Int32Array" : 1,
"window.Uint32Array" : 1,
"window.Float32Array" : 1,
"window.Float64Array" : 1,
"window.clientInformation.geolocation" : 1,
"window.Blob.prototype.webkitSlice" : 1,
"window.FileError" : 1,
@@ -30,6 +30,7 @@ function constructorPropertiesOnWindow(globalObject)
if (type == "WebGLRenderingContextConstructor" ||
type == "ArrayBufferConstructor" ||
type =="Float32ArrayConstructor" ||
type =="Float64ArrayConstructor" ||
type =="Int8ArrayConstructor" ||
type =="Int16ArrayConstructor" ||
type =="Int32ArrayConstructor" ||
@@ -73,6 +73,7 @@ function constructorNamesForWindow(globalObject)
type == "ArrayBufferConstructor" ||
type == "DataViewConstructor" ||
type =="Float32ArrayConstructor" ||
type =="Float64ArrayConstructor" ||
type =="Int8ArrayConstructor" ||
type =="Int16ArrayConstructor" ||
type =="Int32ArrayConstructor" ||
@@ -18,7 +18,7 @@ var skippedProperties = [
"performance",
"WebGLRenderingContext", "WebGLActiveInfo", "WebGLBuffer", "WebGLFramebuffer", "WebGLProgram", "WebGLRenderbuffer", "WebGLShader", "WebGLTexture", "WebGLUniformLocation",
"ArrayBuffer",
"DataView", "Int8Array", "Uint8Array", "Int16Array", "Uint16Array", "Int32Array", "Uint32Array", "Float32Array",
"DataView", "Int8Array", "Uint8Array", "Int16Array", "Uint16Array", "Int32Array", "Uint32Array", "Float32Array", "Float64Array",
"FileError", "FileReader", "WebKitBlobBuilder", "requestFileSystem",
"indexedDB", "IDBKeyRange", "IDBCursor", "IDBDatabase", "IDBDatabaseError", "IDBDatabaseException", "IDBErrorEvent", "IDBEvent", "IDBFactory", "IDBIndex", "IDBObjectStore", "IDBRequest", "IDBSuccessEvent", "IDBTransaction",
"showModalDialog",
@@ -35,6 +35,7 @@ for (var x in constructorNames) {
name == "Int32Array" ||
name == "Uint32Array" ||
name == "Float32Array" ||
name == "Float64Array" ||
name == "FileError" ||
name == "FileReader" ||
name == "WebKitBlobBuilder")
@@ -284,6 +284,7 @@ SET(WebCore_IDL_FILES
html/canvas/CanvasRenderingContext.idl
html/canvas/DataView.idl
html/canvas/Float32Array.idl
html/canvas/Float64Array.idl
html/canvas/Int16Array.idl
html/canvas/Int32Array.idl
html/canvas/Int8Array.idl
@@ -848,6 +849,7 @@ SET(WebCore_SOURCES
html/canvas/CanvasStyle.cpp
html/canvas/DataView.cpp
html/canvas/Float32Array.cpp
html/canvas/Float64Array.cpp
html/canvas/Int16Array.cpp
html/canvas/Int32Array.cpp
html/canvas/Int8Array.cpp
@@ -1,3 +1,49 @@
2011-05-24 Kenneth Russell <kbr@google.com>

Reviewed by James Robinson.

Implement Float64Array
https://bugs.webkit.org/show_bug.cgi?id=39144

Implemented Float64Array based on the existing Float32Array sources.
Built and tested in Chromium on Linux and Mac OS X and Safari on Mac OS X.

* CMakeLists.txt:
* CodeGenerators.pri:
* DerivedSources.cpp:
* DerivedSources.make:
* GNUmakefile.list.am:
* UseJSC.cmake:
* WebCore.gypi:
* WebCore.pro:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSBindingsAllInOne.cpp:
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::float64Array):
* bindings/js/JSFloat64ArrayCustom.cpp: Added.
(WebCore::JSFloat64Array::indexSetter):
(WebCore::toJS):
(WebCore::JSFloat64Array::set):
(WebCore::JSFloat64ArrayConstructor::constructJSFloat64Array):
* bindings/v8/custom/V8Float64ArrayCustom.cpp: Added.
(WebCore::V8Float64Array::constructorCallback):
(WebCore::V8Float64Array::setCallback):
(WebCore::toV8):
* html/canvas/ArrayBufferView.h:
(WebCore::ArrayBufferView::isDoubleArray):
* html/canvas/Float64Array.cpp: Added.
(WebCore::Float64Array::create):
(WebCore::Float64Array::Float64Array):
(WebCore::Float64Array::subarray):
* html/canvas/Float64Array.h: Added.
(WebCore::Float64Array::set):
(WebCore::Float64Array::item):
(WebCore::Float64Array::isDoubleArray):
* html/canvas/Float64Array.idl: Added.
* page/DOMWindow.idl:
* workers/WorkerContext.idl:

2011-05-24 Simon Fraser <simon.fraser@apple.com>

Reviewed by Chris Marrin.
@@ -200,6 +200,7 @@ IDL_BINDINGS += \
html/canvas/DataView.idl \
html/canvas/Int8Array.idl \
html/canvas/Float32Array.idl \
html/canvas/Float64Array.idl \
html/canvas/CanvasGradient.idl \
html/canvas/Int32Array.idl \
html/canvas/CanvasPattern.idl \
@@ -129,6 +129,7 @@
#include "JSFileWriterSync.cpp"
#include "JSWebKitFlags.cpp"
#include "JSFloat32Array.cpp"
#include "JSFloat64Array.cpp"
#include "JSGeneratedStream.cpp"
#include "JSGeolocation.cpp"
#include "JSGeoposition.cpp"
@@ -103,6 +103,7 @@ DOM_CLASSES = \
Int8Array \
WebGLContextAttributes \
Float32Array \
Float64Array \
WebGLFramebuffer \
CanvasGradient \
Int32Array \
@@ -174,6 +174,8 @@ webcore_built_sources += \
DerivedSources/WebCore/JSFileReaderSync.h \
DerivedSources/WebCore/JSFloat32Array.cpp \
DerivedSources/WebCore/JSFloat32Array.h \
DerivedSources/WebCore/JSFloat64Array.cpp \
DerivedSources/WebCore/JSFloat64Array.h \
DerivedSources/WebCore/JSGeneratedStream.cpp \
DerivedSources/WebCore/JSGeneratedStream.h \
DerivedSources/WebCore/JSGeolocation.cpp \
@@ -709,6 +711,7 @@ webcore_sources += \
Source/WebCore/bindings/js/JSExceptionBase.h \
Source/WebCore/bindings/js/JSFileReaderCustom.cpp \
Source/WebCore/bindings/js/JSFloat32ArrayCustom.cpp \
Source/WebCore/bindings/js/JSFloat64ArrayCustom.cpp \
Source/WebCore/bindings/js/JSGeolocationCustom.cpp \
Source/WebCore/bindings/js/JSHTMLAllCollectionCustom.cpp \
Source/WebCore/bindings/js/JSHTMLAppletElementCustom.cpp \
@@ -1539,6 +1542,8 @@ webcore_sources += \
Source/WebCore/html/canvas/DataView.h \
Source/WebCore/html/canvas/Float32Array.cpp \
Source/WebCore/html/canvas/Float32Array.h \
Source/WebCore/html/canvas/Float64Array.cpp \
Source/WebCore/html/canvas/Float64Array.h \
Source/WebCore/html/canvas/Int16Array.cpp \
Source/WebCore/html/canvas/Int16Array.h \
Source/WebCore/html/canvas/Int32Array.cpp \
@@ -61,6 +61,7 @@ LIST(APPEND WebCore_SOURCES
bindings/js/JSExceptionBase.cpp
bindings/js/JSFileReaderCustom.cpp
bindings/js/JSFloat32ArrayCustom.cpp
bindings/js/JSFloat64ArrayCustom.cpp
bindings/js/JSGeolocationCustom.cpp
bindings/js/JSHTMLAllCollectionCustom.cpp
bindings/js/JSHTMLAppletElementCustom.cpp
@@ -1300,6 +1300,7 @@
'html/canvas/CanvasRenderingContext2D.idl',
'html/canvas/DataView.idl',
'html/canvas/Float32Array.idl',
'html/canvas/Float64Array.idl',
'html/canvas/Int16Array.idl',
'html/canvas/Int32Array.idl',
'html/canvas/Int8Array.idl',
@@ -1784,6 +1785,7 @@
'bindings/js/JSExceptionBase.h',
'bindings/js/JSFileReaderCustom.cpp',
'bindings/js/JSFloat32ArrayCustom.cpp',
'bindings/js/JSFloat64ArrayCustom.cpp',
'bindings/js/JSGeolocationCustom.cpp',
'bindings/js/JSHTMLAllCollectionCustom.cpp',
'bindings/js/JSHTMLAppletElementCustom.cpp',
@@ -2104,6 +2106,7 @@
'bindings/v8/custom/V8EventSourceConstructor.cpp',
'bindings/v8/custom/V8FileReaderCustom.cpp',
'bindings/v8/custom/V8Float32ArrayCustom.cpp',
'bindings/v8/custom/V8Float64ArrayCustom.cpp',
'bindings/v8/custom/V8GeolocationCustom.cpp',
'bindings/v8/custom/V8HTMLAllCollectionCustom.cpp',
'bindings/v8/custom/V8HTMLAudioElementConstructor.cpp',
@@ -3076,6 +3079,8 @@
'html/canvas/DataView.h',
'html/canvas/Float32Array.cpp',
'html/canvas/Float32Array.h',
'html/canvas/Float64Array.cpp',
'html/canvas/Float64Array.h',
'html/canvas/Int16Array.cpp',
'html/canvas/Int16Array.h',
'html/canvas/Int32Array.cpp',
@@ -80,6 +80,7 @@ v8 {
bindings/v8/custom/V8DeviceMotionEventCustom.cpp \
bindings/v8/custom/V8DeviceOrientationEventCustom.cpp \
bindings/v8/custom/V8Float32ArrayCustom.cpp \
bindings/v8/custom/V8Float64ArrayCustom.cpp \
bindings/v8/custom/V8Int8ArrayCustom.cpp \
bindings/v8/custom/V8Int16ArrayCustom.cpp \
bindings/v8/custom/V8Int32ArrayCustom.cpp \
@@ -280,6 +281,7 @@ v8 {
bindings/js/JSExceptionBase.cpp \
bindings/js/JSFileReaderCustom.cpp \
bindings/js/JSFloat32ArrayCustom.cpp \
bindings/js/JSFloat64ArrayCustom.cpp \
bindings/js/JSGeolocationCustom.cpp \
bindings/js/JSHTMLAllCollectionCustom.cpp \
bindings/js/JSHTMLAppletElementCustom.cpp \
@@ -768,6 +770,7 @@ SOURCES += \
html/canvas/CanvasStyle.cpp \
html/canvas/DataView.cpp \
html/canvas/Float32Array.cpp \
html/canvas/Float64Array.cpp \
html/canvas/Int16Array.cpp \
html/canvas/Int32Array.cpp \
html/canvas/Int8Array.cpp \
@@ -1614,6 +1617,7 @@ HEADERS += \
html/canvas/CanvasStyle.h \
html/canvas/DataView.h \
html/canvas/Float32Array.h \
html/canvas/Float64Array.h \
html/canvas/Int16Array.h \
html/canvas/Int32Array.h \
html/canvas/Int8Array.h \
@@ -52117,6 +52117,14 @@
RelativePath="..\html\canvas\Float32Array.h"
>
</File>
<File
RelativePath="..\html\canvas\Float64Array.cpp"
>
</File>
<File
RelativePath="..\html\canvas\Float64Array.h"
>
</File>
<File
RelativePath="..\html\FormAssociatedElement.cpp"
>

0 comments on commit c1b1bde

Please sign in to comment.