ArrayBuffer should have slice method. See also the following references. http://code.google.com/p/chromium/issues/detail?id=85047 http://www.khronos.org/registry/typedarray/specs/latest/#5
Sorry I mistook the URL. http://code.google.com/p/chromium/issues/detail?id=85049 is correct. (In reply to comment #0) > ArrayBuffer should have slice method. > > See also the following references. > > http://code.google.com/p/chromium/issues/detail?id=85047 > http://www.khronos.org/registry/typedarray/specs/latest/#5
Created attachment 104649 [details] Patch
Comment on attachment 104649 [details] Patch long in IDL is meant to map to int in c++ code.
Created attachment 104951 [details] Patch
This looks a trivial change. What needed for this patch is a drop of love from some expert...
Comment on attachment 104951 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=104951&action=review Thanks for picking up this work. The code looks fine and the test looks great. A couple of minor nits to clean up before committing. Also, please mark cq? on the bug if you would like it committed after review. > LayoutTests/ChangeLog:3 > + Added unittest for ArrayBuffer#slice Please use the bug description verbatim along with the URL. If necessary, provide detail in additional paragraphs. > Source/WebCore/ChangeLog:3 > + Implemented ArrayBuffer#slice. Same comment here. > Source/WebCore/html/canvas/ArrayBuffer.cpp:33 > +static long clampValue(long x, long left, long right) This should take and return ints instead of longs. > Source/WebCore/html/canvas/ArrayBuffer.h:54 > + unsigned index(int idx) const; This method name is a little confusing; what about "clampIndex"? Also, avoid abbreviations (see http://www.webkit.org/coding/coding-style.html ), so the argument should be named "index".
Created attachment 111561 [details] Patch
Created attachment 111562 [details] Patch
Hi, I've fixed them. Could you review it again? (In reply to comment #6) > (From update of attachment 104951 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=104951&action=review > > Thanks for picking up this work. The code looks fine and the test looks great. A couple of minor nits to clean up before committing. Also, please mark cq? on the bug if you would like it committed after review. > > > LayoutTests/ChangeLog:3 > > + Added unittest for ArrayBuffer#slice > > Please use the bug description verbatim along with the URL. If necessary, provide detail in additional paragraphs. > > > Source/WebCore/ChangeLog:3 > > + Implemented ArrayBuffer#slice. > > Same comment here. > > > Source/WebCore/html/canvas/ArrayBuffer.cpp:33 > > +static long clampValue(long x, long left, long right) > > This should take and return ints instead of longs. > > > Source/WebCore/html/canvas/ArrayBuffer.h:54 > > + unsigned index(int idx) const; > > This method name is a little confusing; what about "clampIndex"? Also, avoid abbreviations (see http://www.webkit.org/coding/coding-style.html ), so the argument should be named "index".
Comment on attachment 111562 [details] Patch Thanks, looks great. r=me
Comment on attachment 111562 [details] Patch Clearing flags on attachment: 111562 Committed r97893: <http://trac.webkit.org/changeset/97893>
All reviewed patches have been landed. Closing bug.