diff options
Diffstat (limited to 'components/script_bindings')
11 files changed, 86 insertions, 17 deletions
diff --git a/components/script_bindings/codegen/Bindings.conf b/components/script_bindings/codegen/Bindings.conf index cb33188804f..2a9874a386f 100644 --- a/components/script_bindings/codegen/Bindings.conf +++ b/components/script_bindings/codegen/Bindings.conf @@ -88,7 +88,7 @@ DOMInterfaces = { }, 'Clipboard': { - 'canGc': ['WriteText'] + 'canGc': ['ReadText', 'WriteText'] }, 'ClipboardItem': { diff --git a/components/script_bindings/conversions.rs b/components/script_bindings/conversions.rs index 4d8e7aa595c..953dca889a8 100644 --- a/components/script_bindings/conversions.rs +++ b/components/script_bindings/conversions.rs @@ -532,7 +532,7 @@ where /// Returns whether `value` is an array-like object (Array, FileList, /// HTMLCollection, HTMLFormControlsCollection, HTMLOptionsCollection, -/// NodeList). +/// NodeList, DOMTokenList). /// /// # Safety /// `cx` must point to a valid, non-null JSContext. @@ -548,6 +548,10 @@ pub unsafe fn is_array_like<D: crate::DomTypes>(cx: *mut JSContext, value: Handl _ => return false, }; + // TODO: HTMLAllCollection + if root_from_object::<D::DOMTokenList>(object, cx).is_ok() { + return true; + } if root_from_object::<D::FileList>(object, cx).is_ok() { return true; } diff --git a/components/script_bindings/webidls/CanvasRenderingContext2D.webidl b/components/script_bindings/webidls/CanvasRenderingContext2D.webidl index 0c4960fe6ad..46d91683577 100644 --- a/components/script_bindings/webidls/CanvasRenderingContext2D.webidl +++ b/components/script_bindings/webidls/CanvasRenderingContext2D.webidl @@ -254,7 +254,7 @@ interface CanvasPattern { Serializable] interface ImageData { [Throws] constructor(unsigned long sw, unsigned long sh/*, optional ImageDataSettings settings = {}*/); - [Throws] constructor(/* Uint8ClampedArray */ object data, unsigned long sw, optional unsigned long sh + [Throws] constructor(Uint8ClampedArray data, unsigned long sw, optional unsigned long sh /*, optional ImageDataSettings settings = {}*/); readonly attribute unsigned long width; diff --git a/components/script_bindings/webidls/Clipboard.webidl b/components/script_bindings/webidls/Clipboard.webidl index 7562adbfa38..b77e975917e 100644 --- a/components/script_bindings/webidls/Clipboard.webidl +++ b/components/script_bindings/webidls/Clipboard.webidl @@ -9,7 +9,7 @@ typedef sequence<ClipboardItem> ClipboardItems; [SecureContext, Exposed=Window, Pref="dom_async_clipboard_enabled"] interface Clipboard : EventTarget { // Promise<ClipboardItems> read(); - // Promise<DOMString> readText(); + Promise<DOMString> readText(); // Promise<undefined> write(ClipboardItems data); Promise<undefined> writeText(DOMString data); }; diff --git a/components/script_bindings/webidls/Document.webidl b/components/script_bindings/webidls/Document.webidl index 737e74d3bf2..e878b1642e4 100644 --- a/components/script_bindings/webidls/Document.webidl +++ b/components/script_bindings/webidls/Document.webidl @@ -154,7 +154,6 @@ partial /*sealed*/ interface Document { // also has obsolete members }; Document includes GlobalEventHandlers; -Document includes DocumentAndElementEventHandlers; // https://html.spec.whatwg.org/multipage/#Document-partial partial interface Document { diff --git a/components/script_bindings/webidls/EventHandler.webidl b/components/script_bindings/webidls/EventHandler.webidl index f597ce237d3..d32302f4b37 100644 --- a/components/script_bindings/webidls/EventHandler.webidl +++ b/components/script_bindings/webidls/EventHandler.webidl @@ -28,6 +28,10 @@ typedef OnBeforeUnloadEventHandlerNonNull? OnBeforeUnloadEventHandler; [Exposed=Window] interface mixin GlobalEventHandlers { attribute EventHandler onabort; + attribute EventHandler onauxclick; + attribute EventHandler onbeforeinput; + attribute EventHandler onbeforematch; + attribute EventHandler onbeforetoggle; attribute EventHandler onblur; attribute EventHandler oncancel; attribute EventHandler oncanplay; @@ -35,13 +39,17 @@ interface mixin GlobalEventHandlers { attribute EventHandler onchange; attribute EventHandler onclick; attribute EventHandler onclose; + attribute EventHandler oncommand; + attribute EventHandler oncontextlost; attribute EventHandler oncontextmenu; + attribute EventHandler oncontextrestored; + attribute EventHandler oncopy; attribute EventHandler oncuechange; + attribute EventHandler oncut; attribute EventHandler ondblclick; attribute EventHandler ondrag; attribute EventHandler ondragend; attribute EventHandler ondragenter; - attribute EventHandler ondragexit; attribute EventHandler ondragleave; attribute EventHandler ondragover; attribute EventHandler ondragstart; @@ -68,7 +76,7 @@ interface mixin GlobalEventHandlers { attribute EventHandler onmouseout; attribute EventHandler onmouseover; attribute EventHandler onmouseup; - attribute EventHandler onwheel; + attribute EventHandler onpaste; attribute EventHandler onpause; attribute EventHandler onplay; attribute EventHandler onplaying; @@ -77,11 +85,12 @@ interface mixin GlobalEventHandlers { attribute EventHandler onreset; attribute EventHandler onresize; attribute EventHandler onscroll; + attribute EventHandler onscrollend; attribute EventHandler onsecuritypolicyviolation; attribute EventHandler onseeked; attribute EventHandler onseeking; attribute EventHandler onselect; - attribute EventHandler onshow; + attribute EventHandler onslotchange; attribute EventHandler onstalled; attribute EventHandler onsubmit; attribute EventHandler onsuspend; @@ -89,6 +98,11 @@ interface mixin GlobalEventHandlers { attribute EventHandler ontoggle; attribute EventHandler onvolumechange; attribute EventHandler onwaiting; + attribute EventHandler onwebkitanimationend; + attribute EventHandler onwebkitanimationiteration; + attribute EventHandler onwebkitanimationstart; + attribute EventHandler onwebkittransitionend; + attribute EventHandler onwheel; }; // https://drafts.csswg.org/css-animations/#interface-globaleventhandlers-idl @@ -123,18 +137,12 @@ interface mixin WindowEventHandlers { attribute EventHandler onoffline; attribute EventHandler ononline; attribute EventHandler onpagehide; + attribute EventHandler onpagereveal; attribute EventHandler onpageshow; + attribute EventHandler onpageswap; attribute EventHandler onpopstate; attribute EventHandler onrejectionhandled; attribute EventHandler onstorage; attribute EventHandler onunhandledrejection; attribute EventHandler onunload; }; - -// https://html.spec.whatwg.org/multipage/#documentandelementeventhandlers -[Exposed=Window] -interface mixin DocumentAndElementEventHandlers { - attribute EventHandler oncopy; - attribute EventHandler oncut; - attribute EventHandler onpaste; -}; diff --git a/components/script_bindings/webidls/HTMLElement.webidl b/components/script_bindings/webidls/HTMLElement.webidl index 76bfada1b94..19a4b515d11 100644 --- a/components/script_bindings/webidls/HTMLElement.webidl +++ b/components/script_bindings/webidls/HTMLElement.webidl @@ -73,7 +73,6 @@ partial interface HTMLElement { }; HTMLElement includes GlobalEventHandlers; -HTMLElement includes DocumentAndElementEventHandlers; HTMLElement includes ElementContentEditable; HTMLElement includes ElementCSSInlineStyle; HTMLElement includes HTMLOrSVGElement; diff --git a/components/script_bindings/webidls/TransformStream.webidl b/components/script_bindings/webidls/TransformStream.webidl new file mode 100644 index 00000000000..c36a49b114a --- /dev/null +++ b/components/script_bindings/webidls/TransformStream.webidl @@ -0,0 +1,18 @@ +/* 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/. + * + * The origin of this IDL file is + * https://streams.spec.whatwg.org/#ts-class-definition + */ + +[Exposed=*] // [Transferable] - See Bug 1562065 +interface TransformStream { + [Throws] + constructor(optional object transformer, + optional QueuingStrategy writableStrategy = {}, + optional QueuingStrategy readableStrategy = {}); + + readonly attribute ReadableStream readable; + readonly attribute WritableStream writable; +}; diff --git a/components/script_bindings/webidls/TransformStreamDefaultController.webidl b/components/script_bindings/webidls/TransformStreamDefaultController.webidl new file mode 100644 index 00000000000..5f5511ed4b6 --- /dev/null +++ b/components/script_bindings/webidls/TransformStreamDefaultController.webidl @@ -0,0 +1,15 @@ +/* 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/. + * + * The origin of this IDL file is + * https://streams.spec.whatwg.org/#ts-default-controller-class-definition + */ + +[Exposed=*] +interface TransformStreamDefaultController { + readonly attribute unrestricted double? desiredSize; + [Throws] undefined enqueue(optional any chunk); + [Throws] undefined error(optional any reason); + [Throws] undefined terminate(); +}; diff --git a/components/script_bindings/webidls/Transformer.webidl b/components/script_bindings/webidls/Transformer.webidl new file mode 100644 index 00000000000..652511450a4 --- /dev/null +++ b/components/script_bindings/webidls/Transformer.webidl @@ -0,0 +1,22 @@ +/* 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/. + * + * The origin of this IDL file is + * https://streams.spec.whatwg.org/#transformer-api + */ + +[GenerateInit] +dictionary Transformer { + TransformerStartCallback start; + TransformerTransformCallback transform; + TransformerFlushCallback flush; + TransformerCancelCallback cancel; + any readableType; + any writableType; +}; + +callback TransformerStartCallback = any (TransformStreamDefaultController controller); +callback TransformerFlushCallback = Promise<undefined> (TransformStreamDefaultController controller); +callback TransformerTransformCallback = Promise<undefined> (any chunk, TransformStreamDefaultController controller); +callback TransformerCancelCallback = Promise<undefined> (any reason); diff --git a/components/script_bindings/webidls/Window.webidl b/components/script_bindings/webidls/Window.webidl index eb7c3e1d03d..929279f7951 100644 --- a/components/script_bindings/webidls/Window.webidl +++ b/components/script_bindings/webidls/Window.webidl @@ -150,6 +150,10 @@ partial interface Window { undefined webdriverCallback(optional any result); undefined webdriverException(optional any result); undefined webdriverTimeout(); + Element? webdriverElement(DOMString id); + Element? webdriverFrame(DOMString id); + Window? webdriverWindow(DOMString id); + ShadowRoot? webdriverShadowRoot(DOMString id); }; // https://html.spec.whatwg.org/multipage/#dom-sessionstorage |