Bug 21111 - response property should return incremental data for ArrayBuffer and Blob
response property should return incremental data for ArrayBuffer and Blob
Status: RESOLVED WONTFIX
Product: WebAppsWG
Classification: Unclassified
Component: XHR
unspecified
PC All
: P2 normal
: ---
Assigned To: Anne
public-webapps-bugzilla
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-02-25 22:07 UTC by Elliott Sprehn
Modified: 2013-10-23 17:22 UTC (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Elliott Sprehn 2013-02-25 22:07:00 UTC
The spec currently says that response returns null if state is not DONE, but this prevents getting ArrayBuffer binary data (ex. textures for WebGL) in a stream for better performance.

For example you could download the assets for your game as an ArrayBuffer and then if the offsets are known inside the Buffer for where the individual textures exist you could create ArrayBufferViews and then convert back into an ImageData to draw into canvas.
Comment 1 Elliott Sprehn 2013-02-25 23:35:36 UTC
Note Mozilla already has support for some of this with special prefixed responseTypes:

https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest

"moz-blob"	Used by Firefox to allow retrieving partial Blob data from progress events. This lets your progress event handler start processing data while it's still being received. Requires Gecko 12.0

There's also 

"moz-chunked-text"	
"moz-chunked-arraybuffer"

which do actual streaming of the data where the buffer in the progress event is only the data received since the last event.
Comment 2 vic99999 2013-02-26 03:05:04 UTC
>>"moz-chunked-text"	
"moz-chunked-arraybuffer"

which do actual streaming of the data where the buffer in the progress event is only the data received since the last event.

no chance, that that will be in the spec
Comment 3 Anne 2013-02-26 10:10:19 UTC
Elliott, can you explain why the Streams API is no good for this case?