This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 21111 - response property should return incremental data for ArrayBuffer and Blob
Summary: response property should return incremental data for ArrayBuffer and Blob
Status: RESOLVED WONTFIX
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: XHR (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Anne
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-25 22:07 UTC by Elliott Sprehn
Modified: 2013-10-23 17:22 UTC (History)
5 users (show)

See Also:


Attachments

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?