summaryrefslogtreecommitdiff
path: root/Source/WebCore/Modules/websockets/WebSocket.idl
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/Modules/websockets/WebSocket.idl')
-rw-r--r--Source/WebCore/Modules/websockets/WebSocket.idl56
1 files changed, 21 insertions, 35 deletions
diff --git a/Source/WebCore/Modules/websockets/WebSocket.idl b/Source/WebCore/Modules/websockets/WebSocket.idl
index 59de969b9..d71ed2b86 100644
--- a/Source/WebCore/Modules/websockets/WebSocket.idl
+++ b/Source/WebCore/Modules/websockets/WebSocket.idl
@@ -30,22 +30,18 @@
*/
[
- GlobalContext=DOMWindow&WorkerGlobalScope,
- EnabledAtRuntime,
- Conditional=WEB_SOCKETS,
ActiveDOMObject,
- Constructor(DOMString url),
- Constructor(DOMString url, sequence<DOMString> protocols),
- Constructor(DOMString url, DOMString protocol),
- ConstructorRaisesException,
+ Conditional=WEB_SOCKETS,
+ Constructor(USVString url, optional sequence<DOMString> protocols = []),
+ Constructor(USVString url, DOMString protocol),
+ ConstructorMayThrowException,
ConstructorCallWith=ScriptExecutionContext,
- EventTarget,
- JSNoStaticTables,
-] interface WebSocket {
- readonly attribute DOMString URL; // Lowercased .url is the one in the spec, but leaving .URL for compatibility reasons.
- readonly attribute DOMString url;
+ EnabledAtRuntime,
+ Exposed=(Window,Worker),
+] interface WebSocket : EventTarget {
+ readonly attribute USVString URL; // Lowercased .url is the one in the spec, but leaving .URL for compatibility reasons.
+ readonly attribute USVString url;
- // ready state
const unsigned short CONNECTING = 0;
const unsigned short OPEN = 1;
const unsigned short CLOSING = 2;
@@ -54,30 +50,20 @@
readonly attribute unsigned long bufferedAmount;
- // networking
- attribute EventListener onopen;
- attribute EventListener onmessage;
- attribute EventListener onerror;
- attribute EventListener onclose;
-
- [TreatReturnedNullStringAs=Undefined] readonly attribute DOMString protocol;
- [TreatReturnedNullStringAs=Undefined] readonly attribute DOMString extensions;
+ attribute EventHandler onopen;
+ attribute EventHandler onmessage;
+ attribute EventHandler onerror;
+ attribute EventHandler onclose;
- attribute DOMString binaryType;
+ readonly attribute DOMString? protocol;
+ readonly attribute DOMString? extensions;
- [RaisesException] void send(ArrayBuffer data);
- [RaisesException] void send(ArrayBufferView data);
- [RaisesException] void send(Blob data);
- [RaisesException] void send(DOMString data);
+ [SetterMayThrowException] attribute DOMString binaryType;
- [RaisesException] void close([Clamp] optional unsigned short code, optional DOMString reason);
+ [MayThrowException] void send(ArrayBuffer data);
+ [MayThrowException] void send(ArrayBufferView data);
+ [MayThrowException] void send(Blob data);
+ [MayThrowException] void send(USVString data);
- // EventTarget interface
- void addEventListener(DOMString type,
- EventListener listener,
- optional boolean useCapture);
- void removeEventListener(DOMString type,
- EventListener listener,
- optional boolean useCapture);
- [RaisesException] boolean dispatchEvent(Event evt);
+ [MayThrowException] void close([Clamp] optional unsigned short code, optional DOMString reason);
};