mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
script: Move code generation and webidl files to new script_bindings crate. (#35157)
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
parent
a88b59534f
commit
af8d7c2de7
469 changed files with 187 additions and 137 deletions
36
components/script_bindings/webidls/WebSocket.webidl
Normal file
36
components/script_bindings/webidls/WebSocket.webidl
Normal file
|
@ -0,0 +1,36 @@
|
|||
/* 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 https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#the-websocket-interface
|
||||
|
||||
enum BinaryType { "blob", "arraybuffer" };
|
||||
|
||||
[Exposed=(Window,Worker)]
|
||||
interface WebSocket : EventTarget {
|
||||
[Throws] constructor(DOMString url, optional (DOMString or sequence<DOMString>) protocols);
|
||||
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 long bufferedAmount;
|
||||
|
||||
//networking
|
||||
attribute EventHandler onopen;
|
||||
attribute EventHandler onerror;
|
||||
attribute EventHandler onclose;
|
||||
//readonly attribute DOMString extensions;
|
||||
readonly attribute DOMString protocol;
|
||||
[Throws] undefined close(optional [Clamp] unsigned short code, optional USVString reason);
|
||||
|
||||
//messaging
|
||||
attribute EventHandler onmessage;
|
||||
attribute BinaryType binaryType;
|
||||
[Throws] undefined send(USVString data);
|
||||
[Throws] undefined send(Blob data);
|
||||
[Throws] undefined send(ArrayBuffer data);
|
||||
[Throws] undefined send(ArrayBufferView data);
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue