Bug 118570
Summary: | Support StringView as a new extension of ArrayBufferView | ||
---|---|---|---|
Product: | WebKit | Reporter: | Chang Shu <cshu> |
Component: | Canvas | Assignee: | Chang Shu <cshu> |
Status: | RESOLVED WONTFIX | ||
Severity: | Normal | CC: | bfulgham |
Priority: | P2 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Bug Depends on: | 126644 | ||
Bug Blocks: |
Chang Shu
https://developer.mozilla.org/en-US/docs/Code_snippets/StringView
The introduction from the proposal above provides a good reason for adding this feature.
"As web applications become more and more powerful, adding features such as audio and video manipulation, access to raw data using WebSockets, and so forth, it has become clear that there are times when it would be helpful for JavaScript code to be able to quickly and easily manipulate raw binary data. In the past, this had to be simulated by treating the raw data as a string and using the charCodeAt() method to read the bytes from the data buffer.
However, this is slow and error-prone, due to the need for multiple conversions (especially if the binary data is not actually byte-format data, but, for example, 32-bit integers or floats).
JavaScript typed arrays provide a mechanism for accessing raw binary data much more efficiently. The StringView constructor is one level above typed arrays."
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Chang Shu
It seems DataView serves the same purpose.
https://bugs.webkit.org/show_bug.cgi?id=46541
Brent Fulgham
I think this seeks to duplicate the DataView concept. Please re-open the bug if I have misunderstood.