Bug 85961 - XHR/WebSocket: send(ArrayBuffer) -> send(ArrayBufferView)
Summary: XHR/WebSocket: send(ArrayBuffer) -> send(ArrayBufferView)
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: XML (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on: 90536 90877
Blocks:
  Show dependency treegraph
 
Reported: 2012-05-09 00:16 PDT by Yuta Kitamura
Modified: 2013-04-08 06:39 PDT (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yuta Kitamura 2012-05-09 00:16:42 PDT
Recently, annevk and hixie have changed XHR/WebSocket spec so {XMLHttpRequest,WebSocket}.send() could accept ArrayBufferView instead of ArrayBuffer:

http://dvcs.w3.org/hg/xhr/rev/f0c81ac5c134  (XHR spec change)
http://dvcs.w3.org/hg/xhr/raw-file/tip/Overview.html#the-send()-method  (XHR latest spec)

http://html5.org/tools/web-apps-tracker?from=7084&to=7085  (WebSocket spec change)
http://dev.w3.org/html5/websockets/#dom-websocket-send  (WebSocket latest spec)

Related discussion:
http://lists.w3.org/Archives/Public/public-webapps/2012AprJun/0141.html


However, this change yields compatibility breakage (i.e. existing code using send(ArrayBuffer) will no longer work), so we might want to discuss how to deal with it before implementing it.
Comment 1 Ian 'Hixie' Hickson 2012-09-26 12:48:03 PDT
The spec was updated to allow both ArrayBuffer and ArrayBufferView to be sent in WebSocket.

The XHR spec has moved to http://xhr.spec.whatwg.org/ but still only has ArrayBufferView.
Comment 2 Takeshi Yoshino 2013-04-08 06:39:46 PDT
WebSocket spec:
As Hixie said, we added ArrayBufferView but also kept ArrayBuffer basically for compatibility.
https://www.w3.org/Bugs/Public/show_bug.cgi?id=17263
http://dev.w3.org/html5/websockets/

WebSocket WebCore implementation:
It conforms to the latest spec, i.e. both ArrayBuffer and ArrayBufferView
https://bugs.webkit.org/show_bug.cgi?id=90877
http://trac.webkit.org/browser/trunk/Source/WebCore/Modules/websockets/WebSocket.idl?rev=124846

XHR:
Seems there's no active discussion after dropping ArrayBuffer and adding ArrayBufferView.

As it's a matter of spec discussion, it's ok to close this bug for now, I think.

http://lists.w3.org/Archives/Public/public-webapps/2012AprJun/0214.html

Simon's summary of conclusion.
https://www.w3.org/Bugs/Public/show_bug.cgi?id=16732