spec/fixtures/html5.idl in webidl-0.1.3 vs spec/fixtures/html5.idl in webidl-0.1.4
- old
+ new
@@ -1,8 +1,12 @@
+interface Example {
+ // this is an IDL definition
+};
interface HTMLAllCollection : HTMLCollection {
- // inherits length and item()
+ // inherits length and item(unsigned long index)
+ object? item(DOMString name);
legacycaller getter object? namedItem(DOMString name); // overrides inherited namedItem()
HTMLAllCollection tags(DOMString tagName);
};
interface HTMLFormControlsCollection : HTMLCollection {
@@ -17,14 +21,11 @@
interface HTMLOptionsCollection : HTMLCollection {
// inherits item()
attribute unsigned long length; // overrides inherited length
legacycaller getter object? namedItem(DOMString name); // overrides inherited namedItem()
setter creator void (unsigned long index, HTMLOptionElement option);
- void add(HTMLOptionElement element, optional HTMLElement? before);
- void add(HTMLOptGroupElement element, optional HTMLElement? before);
- void add(HTMLOptionElement element, long before);
- void add(HTMLOptGroupElement element, long before);
+ void add((HTMLOptionElement or HTMLOptGroupElement) element, optional (HTMLElement or long)? before = null);
void remove(long index);
attribute long selectedIndex;
};
interface HTMLPropertiesCollection : HTMLCollection {
@@ -106,14 +107,16 @@
readonly attribute HTMLCollection commands;
// event handler IDL attributes
[TreatNonCallableAsNull] attribute Function? onabort;
[TreatNonCallableAsNull] attribute Function? onblur;
+ [TreatNonCallableAsNull] attribute Function? oncancel;
[TreatNonCallableAsNull] attribute Function? oncanplay;
[TreatNonCallableAsNull] attribute Function? oncanplaythrough;
[TreatNonCallableAsNull] attribute Function? onchange;
[TreatNonCallableAsNull] attribute Function? onclick;
+ [TreatNonCallableAsNull] attribute Function? onclose;
[TreatNonCallableAsNull] attribute Function? oncontextmenu;
[TreatNonCallableAsNull] attribute Function? oncuechange;
[TreatNonCallableAsNull] attribute Function? ondblclick;
[TreatNonCallableAsNull] attribute Function? ondrag;
[TreatNonCallableAsNull] attribute Function? ondragend;
@@ -170,10 +173,11 @@
interface HTMLElement : Element {
// metadata attributes
attribute DOMString title;
attribute DOMString lang;
+ attribute boolean translate;
attribute DOMString dir;
attribute DOMString className;
readonly attribute DOMTokenList classList;
readonly attribute DOMStringMap dataset;
@@ -213,14 +217,16 @@
readonly attribute CSSStyleDeclaration style;
// event handler IDL attributes
[TreatNonCallableAsNull] attribute Function? onabort;
[TreatNonCallableAsNull] attribute Function? onblur;
+ [TreatNonCallableAsNull] attribute Function? oncancel;
[TreatNonCallableAsNull] attribute Function? oncanplay;
[TreatNonCallableAsNull] attribute Function? oncanplaythrough;
[TreatNonCallableAsNull] attribute Function? onchange;
[TreatNonCallableAsNull] attribute Function? onclick;
+ [TreatNonCallableAsNull] attribute Function? onclose;
[TreatNonCallableAsNull] attribute Function? oncontextmenu;
[TreatNonCallableAsNull] attribute Function? oncuechange;
[TreatNonCallableAsNull] attribute Function? ondblclick;
[TreatNonCallableAsNull] attribute Function? ondrag;
[TreatNonCallableAsNull] attribute Function? ondragend;
@@ -394,10 +400,14 @@
interface HTMLDataElement : HTMLElement {
attribute DOMString value;
};
+interface HTMLTimeElement : HTMLElement {
+ attribute DOMString datetime;
+};
+
interface HTMLSpanElement : HTMLElement {};
interface HTMLBRElement : HTMLElement {};
interface HTMLModElement : HTMLElement {
@@ -436,10 +446,11 @@
interface HTMLEmbedElement : HTMLElement {
attribute DOMString src;
attribute DOMString type;
attribute DOMString width;
attribute DOMString height;
+ legacycaller any (any... arguments);
};
interface HTMLObjectElement : HTMLElement {
attribute DOMString data;
attribute DOMString type;
@@ -455,10 +466,12 @@
readonly attribute boolean willValidate;
readonly attribute ValidityState validity;
readonly attribute DOMString validationMessage;
boolean checkValidity();
void setCustomValidity(DOMString error);
+
+ legacycaller any (any... arguments);
};
interface HTMLParamElement : HTMLElement {
attribute DOMString name;
attribute DOMString value;
@@ -526,13 +539,12 @@
readonly attribute unsigned short readyState;
readonly attribute boolean seeking;
// playback state
attribute double currentTime;
- readonly attribute double initialTime;
readonly attribute double duration;
- readonly attribute Date startOffsetTime;
+ readonly attribute Date startDate;
readonly attribute boolean paused;
attribute double defaultPlaybackRate;
attribute double playbackRate;
readonly attribute TimeRanges played;
readonly attribute TimeRanges seekable;
@@ -565,11 +577,11 @@
const unsigned short MEDIA_ERR_DECODE = 3;
const unsigned short MEDIA_ERR_SRC_NOT_SUPPORTED = 4;
readonly attribute unsigned short code;
};
-interface AudioTrackList {
+interface AudioTrackList : EventTarget {
readonly attribute unsigned long length;
getter AudioTrack (unsigned long index);
AudioTrack? getTrackById(DOMString id);
[TreatNonCallableAsNull] attribute Function? onchange;
@@ -582,11 +594,11 @@
readonly attribute DOMString label;
readonly attribute DOMString language;
attribute boolean enabled;
};
-interface VideoTrackList {
+interface VideoTrackList : EventTarget {
readonly attribute unsigned long length;
getter VideoTrack (unsigned long index);
VideoTrack? getTrackById(DOMString id);
readonly attribute long selectedIndex;
@@ -635,26 +647,24 @@
[TreatNonCallableAsNull] attribute Function? onpause;
[TreatNonCallableAsNull] attribute Function? onratechange;
[TreatNonCallableAsNull] attribute Function? onvolumechange;
};
-interface TextTrackList {
+interface TextTrackList : EventTarget {
readonly attribute unsigned long length;
getter TextTrack (unsigned long index);
[TreatNonCallableAsNull] attribute Function? onaddtrack;
};
+enum TextTrackMode { "disabled", "hidden", "showing" };
interface TextTrack : EventTarget {
readonly attribute DOMString kind;
readonly attribute DOMString label;
readonly attribute DOMString language;
- const unsigned short DISABLED = 0;
- const unsigned short HIDDEN = 1;
- const unsigned short SHOWING = 2;
- attribute unsigned short mode;
+ attribute TextTrackMode mode;
readonly attribute TextTrackCueList? cues;
readonly attribute TextTrackCueList? activeCues;
void addCue(TextTrackCue cue);
@@ -676,17 +686,17 @@
attribute DOMString id;
attribute double startTime;
attribute double endTime;
attribute boolean pauseOnExit;
- attribute DOMString direction;
+ attribute DOMString vertical;
attribute boolean snapToLines;
- attribute long linePosition;
- attribute long textPosition;
+ attribute long line;
+ attribute long position;
attribute long size;
- attribute DOMString alignment;
- attribute DOMString cueAsSource;
+ attribute DOMString align;
+ attribute DOMString text;
DocumentFragment getCueAsHTML();
[TreatNonCallableAsNull] attribute Function? onenter;
[TreatNonCallableAsNull] attribute Function? onexit;
};
@@ -701,19 +711,19 @@
interface TrackEvent : Event {
readonly attribute object? track;
};
dictionary TrackEventInit : EventInit {
- object? Track;
+ object? track;
};
interface HTMLCanvasElement : HTMLElement {
attribute unsigned long width;
attribute unsigned long height;
DOMString toDataURL(optional DOMString type, any... args);
- void toBlob(FileCallback? callback, optional DOMString type, any... args);
+ void toBlob(FileCallback? _callback, optional DOMString type, any... args);
object? getContext(DOMString contextId, any... args);
};
interface CanvasRenderingContext2D {
@@ -724,35 +734,29 @@
// state
void save(); // push state on state stack
void restore(); // pop state stack and restore state
// transformations (default transform is the identity matrix)
+ attribute SVGMatrix currentTransform;
void scale(double x, double y);
void rotate(double angle);
void translate(double x, double y);
void transform(double a, double b, double c, double d, double e, double f);
void setTransform(double a, double b, double c, double d, double e, double f);
+ void resetTransform();
// compositing
attribute double globalAlpha; // (default 1.0)
attribute DOMString globalCompositeOperation; // (default source-over)
- // colors and styles
+ // colors and styles (see also the CanvasDrawingStyles interface)
attribute any strokeStyle; // (default black)
attribute any fillStyle; // (default black)
CanvasGradient createLinearGradient(double x0, double y0, double x1, double y1);
CanvasGradient createRadialGradient(double x0, double y0, double r0, double x1, double y1, double r1);
- CanvasPattern createPattern(HTMLImageElement image, DOMString repetition);
- CanvasPattern createPattern(HTMLCanvasElement image, DOMString repetition);
- CanvasPattern createPattern(HTMLVideoElement image, DOMString repetition);
+ CanvasPattern createPattern((HTMLImageElement or HTMLCanvasElement or HTMLVideoElement) image, DOMString repetition);
- // line caps/joins
- attribute double lineWidth; // (default 1)
- attribute DOMString lineCap; // "butt", "round", "square" (default "butt")
- attribute DOMString lineJoin; // "round", "bevel", "miter" (default "miter")
- attribute double miterLimit; // (default 10)
-
// shadows
attribute double shadowOffsetX; // (default 0)
attribute double shadowOffsetY; // (default 0)
attribute double shadowBlur; // (default 0)
attribute DOMString shadowColor; // (default transparent black)
@@ -760,74 +764,157 @@
// rects
void clearRect(double x, double y, double w, double h);
void fillRect(double x, double y, double w, double h);
void strokeRect(double x, double y, double w, double h);
- // path API
+ // path API (see also CanvasPathMethods)
void beginPath();
- void closePath();
- void moveTo(double x, double y);
- void lineTo(double x, double y);
- void quadraticCurveTo(double cpx, double cpy, double x, double y);
- void bezierCurveTo(double cp1x, double cp1y, double cp2x, double cp2y, double x, double y);
- void arcTo(double x1, double y1, double x2, double y2, double radius);
- void rect(double x, double y, double w, double h);
- void arc(double x, double y, double radius, double startAngle, double endAngle, optional boolean anticlockwise);
void fill();
+ void fill(Path path);
void stroke();
+ void stroke(Path path);
void drawSystemFocusRing(Element element);
+ void drawSystemFocusRing(Path path, Element element);
boolean drawCustomFocusRing(Element element);
+ boolean drawCustomFocusRing(Path path, Element element);
void scrollPathIntoView();
+ void scrollPathIntoView(Path path);
void clip();
+ void clip(Path path);
+ void resetClip();
boolean isPointInPath(double x, double y);
+ boolean isPointInPath(Path path, double x, double y);
- // text
- attribute DOMString font; // (default 10px sans-serif)
- attribute DOMString textAlign; // "start", "end", "left", "right", "center" (default: "start")
- attribute DOMString textBaseline; // "top", "hanging", "middle", "alphabetic", "ideographic", "bottom" (default: "alphabetic")
+ // text (see also the CanvasDrawingStyles interface)
void fillText(DOMString text, double x, double y, optional double maxWidth);
void strokeText(DOMString text, double x, double y, optional double maxWidth);
TextMetrics measureText(DOMString text);
// drawing images
- void drawImage(HTMLImageElement image, double dx, double dy);
- void drawImage(HTMLImageElement image, double dx, double dy, double dw, double dh);
- void drawImage(HTMLImageElement image, double sx, double sy, double sw, double sh, double dx, double dy, double dw, double dh);
- void drawImage(HTMLCanvasElement image, double dx, double dy);
- void drawImage(HTMLCanvasElement image, double dx, double dy, double dw, double dh);
- void drawImage(HTMLCanvasElement image, double sx, double sy, double sw, double sh, double dx, double dy, double dw, double dh);
- void drawImage(HTMLVideoElement image, double dx, double dy);
- void drawImage(HTMLVideoElement image, double dx, double dy, double dw, double dh);
- void drawImage(HTMLVideoElement image, double sx, double sy, double sw, double sh, double dx, double dy, double dw, double dh);
+ attribute boolean imageSmoothingEnabled; // (default true)
+ void drawImage((HTMLImageElement or HTMLCanvasElement or HTMLVideoElement) image, double dx, double dy);
+ void drawImage((HTMLImageElement or HTMLCanvasElement or HTMLVideoElement) image, double dx, double dy, double dw, double dh);
+ void drawImage((HTMLImageElement or HTMLCanvasElement or HTMLVideoElement) image, double sx, double sy, double sw, double sh, double dx, double dy, double dw, double dh);
+ // hit regions
+ void addHitRegion(HitRegionOptions options);
+
// pixel manipulation
ImageData createImageData(double sw, double sh);
ImageData createImageData(ImageData imagedata);
ImageData getImageData(double sx, double sy, double sw, double sh);
void putImageData(ImageData imagedata, double dx, double dy);
void putImageData(ImageData imagedata, double dx, double dy, double dirtyX, double dirtyY, double dirtyWidth, double dirtyHeight);
};
+CanvasRenderingContext2D implements CanvasDrawingStyles;
+CanvasRenderingContext2D implements CanvasPathMethods;
+[NoInterfaceObject]
+interface CanvasDrawingStyles {
+ // line caps/joins
+ attribute double lineWidth; // (default 1)
+ attribute DOMString lineCap; // "butt", "round", "square" (default "butt")
+ attribute DOMString lineJoin; // "round", "bevel", "miter" (default "miter")
+ attribute double miterLimit; // (default 10)
+
+ // dashed lines
+ void setLineDash(sequence<double> segments); // default empty
+ sequence<double> getLineDash();
+ attribute double lineDashOffset;
+
+ // text
+ attribute DOMString font; // (default 10px sans-serif)
+ attribute DOMString textAlign; // "start", "end", "left", "right", "center" (default: "start")
+ attribute DOMString textBaseline; // "top", "hanging", "middle", "alphabetic", "ideographic", "bottom" (default: "alphabetic")
+};
+
+[NoInterfaceObject]
+interface CanvasPathMethods {
+ // shared path API methods
+ void closePath();
+ void moveTo(double x, double y);
+ void lineTo(double x, double y);
+ void quadraticCurveTo(double cpx, double cpy, double x, double y);
+ void bezierCurveTo(double cp1x, double cp1y, double cp2x, double cp2y, double x, double y);
+ void arcTo(double x1, double y1, double x2, double y2, double radius);
+ void arcTo(double x1, double y1, double x2, double y2, double radiusX, double radiusY, double rotation);
+ void rect(double x, double y, double w, double h);
+ void arc(double x, double y, double radius, double startAngle, double endAngle, optional boolean anticlockwise = false);
+ void ellipse(double x, double y, double radiusX, double radiusY, double rotation, double startAngle, double endAngle, boolean anticlockwise);
+};
+
interface CanvasGradient {
// opaque object
void addColorStop(double offset, DOMString color);
};
interface CanvasPattern {
// opaque object
+ void setTransform(SVGMatrix transform);
};
interface TextMetrics {
- readonly attribute double width;
+ // x-direction
+ readonly attribute double width; // advance width
+ readonly attribute double actualBoundingBoxLeft;
+ readonly attribute double actualBoundingBoxRight;
+
+ // y-direction
+ readonly attribute double fontBoundingBoxAscent;
+ readonly attribute double fontBoundingBoxDescent;
+ readonly attribute double actualBoundingBoxAscent;
+ readonly attribute double actualBoundingBoxDescent;
+ readonly attribute double emHeightAscent;
+ readonly attribute double emHeightDescent;
+ readonly attribute double hangingBaseline;
+ readonly attribute double alphabeticBaseline;
+ readonly attribute double ideographicBaseline;
};
+dictionary HitRegionOptions {
+ Path? path = null;
+ DOMString id = '';
+ DOMString? parentID = null;
+ DOMString cursor = 'inherit';
+ // for control-backed regions:
+ Element? control = null;
+ // for unbacked regions:
+ DOMString? label = null;
+ DOMString? role = null;
+};
+
interface ImageData {
readonly attribute unsigned long width;
readonly attribute unsigned long height;
readonly attribute Uint8ClampedArray data;
};
+[Constructor(optional Element scope)]
+interface DrawingStyle { };
+DrawingStyle implements CanvasDrawingStyles;
+
+[Constructor,
+ Constructor(Path path),
+ Constructor(DOMString d)]
+interface Path {
+ void addPath(Path path, SVGMatrix? transformation);
+ void addPathByStrokingPath(Path path, CanvasDrawingStyles styles, SVGMatrix? transformation);
+ void addText(DOMString text, CanvasDrawingStyles styles, SVGMatrix? transformation, double x, double y, optional double maxWidth);
+ void addPathByStrokingText(DOMString text, CanvasDrawingStyles styles, SVGMatrix? transformation, double x, double y, optional double maxWidth);
+ void addText(DOMString text, CanvasDrawingStyles styles, SVGMatrix? transformation, Path path, optional double maxWidth);
+ void addPathByStrokingText(DOMString text, CanvasDrawingStyles styles, SVGMatrix? transformation, Path path, optional double maxWidth);
+};
+Path implements CanvasPathMethods;
+
+partial interface MouseEvent {
+ readonly attribute DOMString? region;
+};
+
+partial dictionary MouseEventInit {
+ DOMString? region;
+};
+
interface HTMLMapElement : HTMLElement {
attribute DOMString name;
readonly attribute HTMLCollection areas;
readonly attribute HTMLCollection images;
};
@@ -989,11 +1076,11 @@
attribute DOMString src;
attribute DOMString step;
attribute DOMString type;
attribute DOMString defaultValue;
attribute DOMString value;
- attribute Date valueAsDate;
+ attribute Date? valueAsDate;
attribute double valueAsNumber;
attribute unsigned long width;
void stepUp(optional long n);
void stepDown(optional long n);
@@ -1008,10 +1095,14 @@
void select();
attribute unsigned long selectionStart;
attribute unsigned long selectionEnd;
attribute DOMString selectionDirection;
+
+ void setRangeText(DOMString replacement);
+ void setRangeText(DOMString replacement, unsigned long start, unsigned long end, optional SelectionMode selectionMode);
+
void setSelectionRange(unsigned long start, unsigned long end, optional DOMString direction);
};
interface HTMLButtonElement : HTMLElement {
attribute boolean autofocus;
@@ -1048,14 +1139,11 @@
readonly attribute HTMLOptionsCollection options;
attribute unsigned long length;
getter Element item(unsigned long index);
object namedItem(DOMString name);
- void add(HTMLOptionElement element, optional HTMLElement? before);
- void add(HTMLOptGroupElement element, optional HTMLElement? before);
- void add(HTMLOptionElement element, long before);
- void add(HTMLOptGroupElement element, long before);
+ void add((HTMLOptionElement or HTMLOptGroupElement) element, optional (HTMLElement or long)? before = null);
void remove(long index);
setter creator void (unsigned long index, HTMLOptionElement option);
readonly attribute HTMLCollection selectedOptions;
attribute long selectedIndex;
@@ -1125,10 +1213,14 @@
void select();
attribute unsigned long selectionStart;
attribute unsigned long selectionEnd;
attribute DOMString selectionDirection;
+
+ void setRangeText(DOMString replacement);
+ void setRangeText(DOMString replacement, unsigned long start, unsigned long end, optional SelectionMode selectionMode);
+
void setSelectionRange(unsigned long start, unsigned long end, optional DOMString direction);
};
interface HTMLKeygenElement : HTMLElement {
attribute boolean autofocus;
@@ -1182,10 +1274,18 @@
attribute double high;
attribute double optimum;
readonly attribute NodeList labels;
};
+
+enum SelectionMode {
+ 'select',
+ 'start',
+ 'end',
+ 'preserve',
+};
+
interface ValidityState {
readonly attribute boolean valueMissing;
readonly attribute boolean typeMismatch;
readonly attribute boolean patternMismatch;
readonly attribute boolean tooLong;
@@ -1205,17 +1305,26 @@
attribute DOMString label;
attribute DOMString icon;
attribute boolean disabled;
attribute boolean checked;
attribute DOMString radiogroup;
+ readonly attribute HTMLElement? command;
};
interface HTMLMenuElement : HTMLElement {
attribute DOMString type;
attribute DOMString label;
};
+interface HTMLDialogElement : HTMLElement {
+ attribute boolean open;
+ attribute DOMString returnValue;
+ void show(optional (MouseEvent or Element) anchor);
+ void showModal(optional (MouseEvent or Element) anchor);
+ void close(optional DOMString returnValue);
+};
+
[ReplaceableNamedProperties]
interface Window : EventTarget {
// the current browsing context
[Unforgeable] readonly attribute WindowProxy window;
[Replaceable] readonly attribute WindowProxy self;
@@ -1240,11 +1349,11 @@
// other browsing contexts
[Replaceable] readonly attribute WindowProxy frames;
[Replaceable] readonly attribute unsigned long length;
[Unforgeable] readonly attribute WindowProxy top;
- attribute WindowProxy opener;
+ attribute WindowProxy? opener;
readonly attribute WindowProxy parent;
readonly attribute Element? frameElement;
WindowProxy open(optional DOMString url, optional DOMString target, optional DOMString features, optional boolean replace);
getter WindowProxy (unsigned long index);
getter object (DOMString name);
@@ -1268,14 +1377,16 @@
[TreatNonCallableAsNull] attribute Function? onabort;
[TreatNonCallableAsNull] attribute Function? onafterprint;
[TreatNonCallableAsNull] attribute Function? onbeforeprint;
[TreatNonCallableAsNull] attribute Function? onbeforeunload;
[TreatNonCallableAsNull] attribute Function? onblur;
+ [TreatNonCallableAsNull] attribute Function? oncancel;
[TreatNonCallableAsNull] attribute Function? oncanplay;
[TreatNonCallableAsNull] attribute Function? oncanplaythrough;
[TreatNonCallableAsNull] attribute Function? onchange;
[TreatNonCallableAsNull] attribute Function? onclick;
+ [TreatNonCallableAsNull] attribute Function? onclose;
[TreatNonCallableAsNull] attribute Function? oncontextmenu;
[TreatNonCallableAsNull] attribute Function? oncuechange;
[TreatNonCallableAsNull] attribute Function? ondblclick;
[TreatNonCallableAsNull] attribute Function? ondrag;
[TreatNonCallableAsNull] attribute Function? ondragend;
@@ -1521,15 +1632,15 @@
};
interface DataTransferItem {
readonly attribute DOMString kind;
readonly attribute DOMString type;
- void getAsString(FunctionStringCallback? callback);
+ void getAsString(FunctionStringCallback? _callback);
File? getAsFile();
};
-[Callback=FunctionOnly, NoInterfaceObject]
+[Callback, NoInterfaceObject]
interface FunctionStringCallback {
void handleEvent(DOMString data);
};
[Constructor(DOMString type, optional DragEventInit eventInitDict)]
@@ -1539,108 +1650,10 @@
dictionary DragEventInit : MouseEventInit {
DataTransfer? dataTransfer;
};
-[NoInterfaceObject]
-interface NavigatorUserMedia {
- void getUserMedia(DOMString options, NavigatorUserMediaSuccessCallback? successCallback, optional NavigatorUserMediaErrorCallback? errorCallback);
-};
-Navigator implements NavigatorUserMedia;
-
-[Callback=FunctionOnly, NoInterfaceObject]
-interface NavigatorUserMediaSuccessCallback {
- void handleEvent(LocalMediaStream stream);
-};
-
-[NoInterfaceObject]
-interface NavigatorUserMediaError {
- const unsigned short PERMISSION_DENIED = 1;
- readonly attribute unsigned short code;
-};
-
-[Callback=FunctionOnly, NoInterfaceObject]
-interface NavigatorUserMediaErrorCallback {
- void handleEvent(NavigatorUserMediaError error);
-};
-
-[Constructor(MediaStream parentStream)]
-interface MediaStream : EventTarget {
- readonly attribute DOMString label;
- readonly attribute MediaStreamTrack[] tracks;
-
- MediaStreamRecorder record();
-
- const unsigned short LIVE = 1;
- const unsigned short ENDED = 2;
- readonly attribute unsigned short readyState;
- [TreatNonCallableAsNull] attribute Function? onended;
-};
-
-interface LocalMediaStream : MediaStream {
- void stop();
-};
-
-interface MediaStreamTrack {
- readonly attribute DOMString kind;
- readonly attribute DOMString label;
- attribute boolean enabled;
-};
-
-interface MediaStreamRecorder {
- void getRecordedData(BlobCallback? callback);
-};
-
-[Callback=FunctionOnly, NoInterfaceObject]
-interface BlobCallback {
- void handleEvent(Blob blob);
-};
-
-partial interface URL {
- static DOMString createObjectURL(MediaStream stream);
-};
-
-[Constructor(DOMString serverConfiguration, SignalingCallback signalingCallback)]
-interface PeerConnection : EventTarget {
- void processSignalingMessage(DOMString message);
-
- const unsigned short NEW = 0;
- const unsigned short NEGOTIATING = 1;
- const unsigned short ACTIVE = 2;
- const unsigned short CLOSED = 3;
- readonly attribute unsigned short readyState;
-
- void send(DOMString text);
- void addStream(MediaStream stream);
- void removeStream(MediaStream stream);
- readonly attribute MediaStream[] localStreams;
- readonly attribute MediaStream[] remoteStreams;
-
- void close();
-
- // connection quality information
- [TreatNonCallableAsNull] attribute Function? onconnecting;
- [TreatNonCallableAsNull] attribute Function? onopen;
- [TreatNonCallableAsNull] attribute Function? onmessage;
- [TreatNonCallableAsNull] attribute Function? onaddstream;
- [TreatNonCallableAsNull] attribute Function? onremovestream;
-};
-
-[Callback=FunctionOnly, NoInterfaceObject]
-interface SignalingCallback {
- void handleEvent(DOMString message, PeerConnection source);
-};
-
-[Constructor(DOMString type, optional MediaStreamEventInit eventInitDict)]
-interface MediaStreamEvent : Event {
- readonly attribute MediaStream? stream;
-};
-
-dictionary MediaStreamEventInit : EventInit {
- // DOMString MediaStream? stream;
-};
-
interface WorkerGlobalScope : EventTarget {
readonly attribute WorkerGlobalScope self;
readonly attribute WorkerLocation location;
void close();
@@ -1648,17 +1661,15 @@
[TreatNonCallableAsNull] attribute Function? onoffline;
[TreatNonCallableAsNull] attribute Function? ononline;
};
WorkerGlobalScope implements WorkerUtils;
-[Supplemental, NoInterfaceObject]
interface DedicatedWorkerGlobalScope : WorkerGlobalScope {
void postMessage(any message, optional sequence<Transferable> transfer);
[TreatNonCallableAsNull] attribute Function? onmessage;
};
-[Supplemental, NoInterfaceObject]
interface SharedWorkerGlobalScope : WorkerGlobalScope {
readonly attribute DOMString name;
readonly attribute ApplicationCache applicationCache;
[TreatNonCallableAsNull] attribute Function? onconnect;
};
@@ -1674,28 +1685,30 @@
DOMString message;
DOMString filename;
unsigned long lineno;
};
-[Supplemental, NoInterfaceObject]
-interface AbstractWorker : EventTarget {
+[NoInterfaceObject]
+interface AbstractWorker {
[TreatNonCallableAsNull] attribute Function? onerror;
};
[Constructor(DOMString scriptURL)]
-interface Worker : AbstractWorker {
+interface Worker : EventTarget {
void terminate();
void postMessage(any message, optional sequence<Transferable> transfer);
[TreatNonCallableAsNull] attribute Function? onmessage;
};
+Worker implements AbstractWorker;
[Constructor(DOMString scriptURL, optional DOMString name)]
-interface SharedWorker : AbstractWorker {
+interface SharedWorker : EventTarget {
readonly attribute MessagePort port;
};
+SharedWorker implements AbstractWorker;
[NoInterfaceObject]
interface WorkerUtils {
void importScripts(DOMString... urls);
readonly attribute WorkerNavigator navigator;
@@ -1756,12 +1769,11 @@
dictionary EventSourceInit {
boolean withCredentials = false;
};
-[Constructor(DOMString url, optional DOMString protocols),
- Constructor(DOMString url, optional DOMString[] protocols)]
+[Constructor(DOMString url, optional (DOMString or DOMString[]) protocols)]
interface WebSocket : EventTarget {
readonly attribute DOMString url;
// ready state
const unsigned short CONNECTING = 0;
@@ -1837,18 +1849,18 @@
};
Window implements WindowLocalStorage;
[Constructor(DOMString type, optional StorageEventInit eventInitDict)]
interface StorageEvent : Event {
- readonly attribute DOMString key;
+ readonly attribute DOMString? key;
readonly attribute DOMString? oldValue;
readonly attribute DOMString? newValue;
readonly attribute DOMString url;
readonly attribute Storage? storageArea;
};
dictionary StorageEventInit : EventInit {
- DOMString key;
+ DOMString? key;
DOMString? oldValue;
DOMString? newValue;
DOMString url;
Storage? storageArea;
};
\ No newline at end of file