Bug 39100

Summary: Implement TypedArray BYTES_PER_ELEMENT
Product: WebKit Reporter: Kenneth Russell <kbr>
Component: WebGLAssignee: Kenneth Russell <kbr>
Status: RESOLVED FIXED    
Severity: Normal CC: cmarrin, dglazkov, fishd, oliver, zmo
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch dglazkov: review+, kbr: commit-queue-

Description Kenneth Russell 2010-05-13 18:20:01 PDT
The constant value BYTES_PER_ELEMENT needs to be added to the various TypedArray interfaces.
Comment 1 Kenneth Russell 2010-06-09 16:52:28 PDT
Created attachment 58308 [details]
Patch

From the ChangeLog:

Implemented BYTES_PER_ELEMENT on all ArrayBufferView subclasses. Required bug fixes to JSC bindings' custom constructors. Updated fast/canvas/webgl/array-unit-tests.html to verify. Ran all WebGL layout tests in Safari and Chromium.
Comment 2 Kenneth Russell 2010-06-10 10:43:23 PDT
Note: the modifications to the JSC custom bindings came from looking at the autogenerated JSCSSValue.{cpp.h}, which has values like CSS_INHERIT attached to its prototype. From experimentation these are the minimal changes to the custom constructors which allow the BYTES_PER_ELEMENT lookup to succeed on the constructor functions (i.e., "Float32Array.BYTES_PER_ELEMENT") while also not perturbing the functionality in any way.
Comment 3 Dimitri Glazkov (Google) 2010-06-10 10:46:20 PDT
Comment on attachment 58308 [details]
Patch

ok. Can we not make the constructors non-custom with the new overloading goodness that Yaar had built?
Comment 4 Kenneth Russell 2010-06-10 10:55:34 PDT
(In reply to comment #3)
> (From update of attachment 58308 [details])
> ok. Can we not make the constructors non-custom with the new overloading goodness that Yaar had built?

It may be possible; I'll ask Yaar. I don't know how the IDL and code generator handle autogenerated constructors and/or overloaded constructors.
Comment 5 Kenneth Russell 2010-06-10 11:53:39 PDT
Committed r60967: <http://trac.webkit.org/changeset/60967>