Files
tubestation/servo/components/script/dom/webidls/WebSocket.webidl
Nikki 7808254b4d servo: Merge #8218 - #8213: Implement Blob variant of WebSocket.send (from nikkisquared:master); r=eefriedman
I'm working on resolving https://github.com/servo/servo/issues/8213 as per the spec online and feedback in the servo channel. Note that currently I cannot build (and thus test) my code, so this is a bit of a rough first draft. I'd still like feedback on my progress, and I hope that there is another way for my code to be tested.

Source-Repo: https://github.com/servo/servo
Source-Revision: 021f441d24893861d45fec0cef7ed88dc9e6543a
2015-11-05 09:54:27 +05:00

36 lines
1.3 KiB
Plaintext

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// https://html.spec.whatwg.org/multipage/#the-websocket-interface
enum BinaryType { "blob", "arraybuffer" };
[Constructor(DOMString url, optional /*(*/DOMString /*or DOMString[])*/ protocols)]
interface WebSocket : EventTarget {
readonly attribute DOMString url;
//ready state
const unsigned short CONNECTING = 0;
const unsigned short OPEN = 1;
const unsigned short CLOSING = 2;
const unsigned short CLOSED = 3;
readonly attribute unsigned short readyState;
readonly attribute unsigned long bufferedAmount;
//networking
attribute EventHandler onopen;
attribute EventHandler onerror;
attribute EventHandler onclose;
//readonly attribute DOMString extensions;
//readonly attribute DOMString protocol;
[Throws] void close([Clamp] optional unsigned short code, optional USVString reason);
//messaging
attribute EventHandler onmessage;
attribute BinaryType binaryType;
[Throws] void send(USVString data);
[Throws] void send(Blob data);
//void send(ArrayBuffer data);
//void send(ArrayBufferView data);
};