diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2019-07-12 04:35:46 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-12 04:35:46 -0400 |
commit | 026e550d3536115b23ad794e08b3c93147913dfb (patch) | |
tree | 5d83ec4a7d401706c2668ee5fac90e99ef734b1e /components/script/dom/webidls | |
parent | 5fdc7c0d2c787ef562809072e3dd7c3258dc8a83 (diff) | |
parent | 01151274f1487e630852680ba38ab5a651db44ec (diff) | |
download | servo-026e550d3536115b23ad794e08b3c93147913dfb.tar.gz servo-026e550d3536115b23ad794e08b3c93147913dfb.zip |
Auto merge of #23748 - saschanaz:default-dict, r=Manishearth
Sync WebIDL.py with gecko
<!-- Please describe your changes on the following line: -->
The new change requires default dictionary value for optional dictionary-type arguments.
---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [ ] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #23703
<!-- Either: -->
- [x] There are tests for these changes
<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->
<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23748)
<!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom/webidls')
68 files changed, 90 insertions, 89 deletions
diff --git a/components/script/dom/webidls/AnalyserNode.webidl b/components/script/dom/webidls/AnalyserNode.webidl index 6747cda0690..07826c16fab 100644 --- a/components/script/dom/webidls/AnalyserNode.webidl +++ b/components/script/dom/webidls/AnalyserNode.webidl @@ -14,7 +14,7 @@ dictionary AnalyserOptions : AudioNodeOptions { }; [Exposed=Window, - Constructor (BaseAudioContext context, optional AnalyserOptions options)] + Constructor (BaseAudioContext context, optional AnalyserOptions options = {})] interface AnalyserNode : AudioNode { void getFloatFrequencyData (Float32Array array); void getByteFrequencyData (Uint8Array array); diff --git a/components/script/dom/webidls/AudioBufferSourceNode.webidl b/components/script/dom/webidls/AudioBufferSourceNode.webidl index 929cdc05c1a..da1222a6935 100644 --- a/components/script/dom/webidls/AudioBufferSourceNode.webidl +++ b/components/script/dom/webidls/AudioBufferSourceNode.webidl @@ -16,7 +16,7 @@ dictionary AudioBufferSourceOptions { }; [Exposed=Window, - Constructor (BaseAudioContext context, optional AudioBufferSourceOptions options)] + Constructor (BaseAudioContext context, optional AudioBufferSourceOptions options = {})] interface AudioBufferSourceNode : AudioScheduledSourceNode { [Throws] attribute AudioBuffer? buffer; readonly attribute AudioParam playbackRate; diff --git a/components/script/dom/webidls/AudioContext.webidl b/components/script/dom/webidls/AudioContext.webidl index c47813d21e0..6acf7ec3e7c 100644 --- a/components/script/dom/webidls/AudioContext.webidl +++ b/components/script/dom/webidls/AudioContext.webidl @@ -23,7 +23,7 @@ dictionary AudioTimestamp { }; [Exposed=Window, - Constructor(optional AudioContextOptions contextOptions)] + Constructor(optional AudioContextOptions contextOptions = {})] interface AudioContext : BaseAudioContext { readonly attribute double baseLatency; readonly attribute double outputLatency; diff --git a/components/script/dom/webidls/BiquadFilterNode.webidl b/components/script/dom/webidls/BiquadFilterNode.webidl index e8ddaee1cac..d222e9a7297 100644 --- a/components/script/dom/webidls/BiquadFilterNode.webidl +++ b/components/script/dom/webidls/BiquadFilterNode.webidl @@ -26,7 +26,7 @@ dictionary BiquadFilterOptions : AudioNodeOptions { }; [Exposed=Window, - Constructor (BaseAudioContext context, optional BiquadFilterOptions options)] + Constructor (BaseAudioContext context, optional BiquadFilterOptions options = {})] interface BiquadFilterNode : AudioNode { attribute BiquadFilterType type; readonly attribute AudioParam frequency; diff --git a/components/script/dom/webidls/Blob.webidl b/components/script/dom/webidls/Blob.webidl index b06da6d2fae..d58c67a6398 100644 --- a/components/script/dom/webidls/Blob.webidl +++ b/components/script/dom/webidls/Blob.webidl @@ -5,7 +5,7 @@ // https://w3c.github.io/FileAPI/#blob [Constructor(optional sequence<BlobPart> blobParts, - optional BlobPropertyBag options), + optional BlobPropertyBag options = {}), Exposed=(Window,Worker)] interface Blob { diff --git a/components/script/dom/webidls/Bluetooth.webidl b/components/script/dom/webidls/Bluetooth.webidl index c5ae3f8f26c..4491a296c41 100644 --- a/components/script/dom/webidls/Bluetooth.webidl +++ b/components/script/dom/webidls/Bluetooth.webidl @@ -34,7 +34,7 @@ interface Bluetooth : EventTarget { // [SecureContext, SameObject] // readonly attribute BluetoothDevice? referringDevice; [SecureContext] - Promise<BluetoothDevice> requestDevice(optional RequestDeviceOptions options); + Promise<BluetoothDevice> requestDevice(optional RequestDeviceOptions options = {}); }; // Bluetooth implements BluetoothDeviceEventHandlers; diff --git a/components/script/dom/webidls/ChannelMergerNode.webidl b/components/script/dom/webidls/ChannelMergerNode.webidl index f8345fe4512..33fc0e6ea67 100644 --- a/components/script/dom/webidls/ChannelMergerNode.webidl +++ b/components/script/dom/webidls/ChannelMergerNode.webidl @@ -11,6 +11,6 @@ dictionary ChannelMergerOptions : AudioNodeOptions { }; [Exposed=Window, - Constructor (BaseAudioContext context, optional ChannelMergerOptions options)] + Constructor (BaseAudioContext context, optional ChannelMergerOptions options = {})] interface ChannelMergerNode : AudioNode { }; diff --git a/components/script/dom/webidls/ChannelSplitterNode.webidl b/components/script/dom/webidls/ChannelSplitterNode.webidl index 1056fce61bf..d776ac62ac3 100644 --- a/components/script/dom/webidls/ChannelSplitterNode.webidl +++ b/components/script/dom/webidls/ChannelSplitterNode.webidl @@ -11,6 +11,6 @@ dictionary ChannelSplitterOptions : AudioNodeOptions { }; [Exposed=Window, - Constructor (BaseAudioContext context, optional ChannelSplitterOptions options)] + Constructor (BaseAudioContext context, optional ChannelSplitterOptions options = {})] interface ChannelSplitterNode : AudioNode { }; diff --git a/components/script/dom/webidls/CloseEvent.webidl b/components/script/dom/webidls/CloseEvent.webidl index f69d08c37a8..a689b337328 100644 --- a/components/script/dom/webidls/CloseEvent.webidl +++ b/components/script/dom/webidls/CloseEvent.webidl @@ -3,7 +3,7 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ //https://html.spec.whatwg.org/multipage/#the-closeevent-interfaces -[Constructor(DOMString type, optional CloseEventInit eventInitDict), Exposed=(Window,Worker)] +[Constructor(DOMString type, optional CloseEventInit eventInitDict = {}), Exposed=(Window,Worker)] interface CloseEvent : Event { readonly attribute boolean wasClean; readonly attribute unsigned short code; diff --git a/components/script/dom/webidls/CompositionEvent.webidl b/components/script/dom/webidls/CompositionEvent.webidl index c018aa6deac..043873c9354 100644 --- a/components/script/dom/webidls/CompositionEvent.webidl +++ b/components/script/dom/webidls/CompositionEvent.webidl @@ -8,7 +8,7 @@ */ // https://w3c.github.io/uievents/#idl-compositionevent -[Pref="dom.compositionevent.enabled", Constructor(DOMString type, optional CompositionEventInit eventInitDict)] +[Pref="dom.compositionevent.enabled", Constructor(DOMString type, optional CompositionEventInit eventInitDict = {})] interface CompositionEvent : UIEvent { readonly attribute DOMString data; }; diff --git a/components/script/dom/webidls/CustomElementRegistry.webidl b/components/script/dom/webidls/CustomElementRegistry.webidl index 1072eed0031..d2ebff0bdf0 100644 --- a/components/script/dom/webidls/CustomElementRegistry.webidl +++ b/components/script/dom/webidls/CustomElementRegistry.webidl @@ -6,7 +6,7 @@ [Pref="dom.customelements.enabled"] interface CustomElementRegistry { [Throws, CEReactions] - void define(DOMString name, CustomElementConstructor constructor_, optional ElementDefinitionOptions options); + void define(DOMString name, CustomElementConstructor constructor_, optional ElementDefinitionOptions options = {}); any get(DOMString name); diff --git a/components/script/dom/webidls/CustomEvent.webidl b/components/script/dom/webidls/CustomEvent.webidl index 2e77d67fe4b..5bede1513f2 100644 --- a/components/script/dom/webidls/CustomEvent.webidl +++ b/components/script/dom/webidls/CustomEvent.webidl @@ -13,7 +13,7 @@ * http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0. */ -[Constructor(DOMString type, optional CustomEventInit eventInitDict), +[Constructor(DOMString type, optional CustomEventInit eventInitDict = {}), Exposed=(Window,Worker)] interface CustomEvent : Event { readonly attribute any detail; diff --git a/components/script/dom/webidls/DOMMatrix.webidl b/components/script/dom/webidls/DOMMatrix.webidl index d617f20af99..ffaa720b7d9 100644 --- a/components/script/dom/webidls/DOMMatrix.webidl +++ b/components/script/dom/webidls/DOMMatrix.webidl @@ -14,7 +14,7 @@ Exposed=(Window,Worker)] interface DOMMatrix : DOMMatrixReadOnly { - [NewObject, Throws] static DOMMatrix fromMatrix(optional DOMMatrixInit other); + [NewObject, Throws] static DOMMatrix fromMatrix(optional DOMMatrixInit other = {}); [NewObject, Throws] static DOMMatrix fromFloat32Array(Float32Array array32); [NewObject, Throws] static DOMMatrix fromFloat64Array(Float64Array array64); @@ -44,8 +44,8 @@ interface DOMMatrix : DOMMatrixReadOnly { inherit attribute unrestricted double m44; // Mutable transform methods - [Throws] DOMMatrix multiplySelf(optional DOMMatrixInit other); - [Throws] DOMMatrix preMultiplySelf(optional DOMMatrixInit other); + [Throws] DOMMatrix multiplySelf(optional DOMMatrixInit other = {}); + [Throws] DOMMatrix preMultiplySelf(optional DOMMatrixInit other = {}); DOMMatrix translateSelf(optional unrestricted double tx = 0, optional unrestricted double ty = 0, optional unrestricted double tz = 0); diff --git a/components/script/dom/webidls/DOMMatrixReadOnly.webidl b/components/script/dom/webidls/DOMMatrixReadOnly.webidl index eb7051ba529..ea5d8caf8e5 100644 --- a/components/script/dom/webidls/DOMMatrixReadOnly.webidl +++ b/components/script/dom/webidls/DOMMatrixReadOnly.webidl @@ -14,7 +14,7 @@ Exposed=(Window,Worker)] interface DOMMatrixReadOnly { - [NewObject, Throws] static DOMMatrixReadOnly fromMatrix(optional DOMMatrixInit other); + [NewObject, Throws] static DOMMatrixReadOnly fromMatrix(optional DOMMatrixInit other = {}); [NewObject, Throws] static DOMMatrixReadOnly fromFloat32Array(Float32Array array32); [NewObject, Throws] static DOMMatrixReadOnly fromFloat64Array(Float64Array array64); @@ -73,12 +73,12 @@ interface DOMMatrixReadOnly { optional unrestricted double angle = 0); DOMMatrix skewX(optional unrestricted double sx = 0); DOMMatrix skewY(optional unrestricted double sy = 0); - [Throws] DOMMatrix multiply(optional DOMMatrixInit other); + [Throws] DOMMatrix multiply(optional DOMMatrixInit other = {}); DOMMatrix flipX(); DOMMatrix flipY(); DOMMatrix inverse(); - DOMPoint transformPoint(optional DOMPointInit point); + DOMPoint transformPoint(optional DOMPointInit point = {}); Float32Array toFloat32Array(); Float64Array toFloat64Array(); // stringifier; diff --git a/components/script/dom/webidls/DOMPoint.webidl b/components/script/dom/webidls/DOMPoint.webidl index 9f75a1c835f..34a355f6085 100644 --- a/components/script/dom/webidls/DOMPoint.webidl +++ b/components/script/dom/webidls/DOMPoint.webidl @@ -14,7 +14,7 @@ optional unrestricted double z = 0, optional unrestricted double w = 1), Exposed=(Window,Worker)] interface DOMPoint : DOMPointReadOnly { - [NewObject] static DOMPoint fromPoint(optional DOMPointInit other = null); + [NewObject] static DOMPoint fromPoint(optional DOMPointInit other = {}); inherit attribute unrestricted double x; inherit attribute unrestricted double y; diff --git a/components/script/dom/webidls/DOMPointReadOnly.webidl b/components/script/dom/webidls/DOMPointReadOnly.webidl index b6478f31337..23643179333 100644 --- a/components/script/dom/webidls/DOMPointReadOnly.webidl +++ b/components/script/dom/webidls/DOMPointReadOnly.webidl @@ -14,7 +14,7 @@ optional unrestricted double z = 0, optional unrestricted double w = 1), Exposed=(Window,Worker)] interface DOMPointReadOnly { - [NewObject] static DOMPointReadOnly fromPoint(optional DOMPointInit other = null); + [NewObject] static DOMPointReadOnly fromPoint(optional DOMPointInit other = {}); readonly attribute unrestricted double x; readonly attribute unrestricted double y; diff --git a/components/script/dom/webidls/DOMQuad.webidl b/components/script/dom/webidls/DOMQuad.webidl index 397118a88aa..8711dd44215 100644 --- a/components/script/dom/webidls/DOMQuad.webidl +++ b/components/script/dom/webidls/DOMQuad.webidl @@ -10,12 +10,12 @@ * related or neighboring rights to this work. */ -[Constructor(optional DOMPointInit p1, optional DOMPointInit p2, - optional DOMPointInit p3, optional DOMPointInit p4), +[Constructor(optional DOMPointInit p1 = {}, optional DOMPointInit p2 = {}, + optional DOMPointInit p3 = {}, optional DOMPointInit p4 = {}), Exposed=(Window,Worker)] interface DOMQuad { - [NewObject] static DOMQuad fromRect(optional DOMRectInit other); - [NewObject] static DOMQuad fromQuad(optional DOMQuadInit other); + [NewObject] static DOMQuad fromRect(optional DOMRectInit other = {}); + [NewObject] static DOMQuad fromQuad(optional DOMQuadInit other = {}); [SameObject] readonly attribute DOMPoint p1; [SameObject] readonly attribute DOMPoint p2; @@ -25,8 +25,8 @@ interface DOMQuad { }; dictionary DOMQuadInit { - DOMPointInit p1 = null; - DOMPointInit p2 = null; - DOMPointInit p3 = null; - DOMPointInit p4 = null; + DOMPointInit p1 = {}; + DOMPointInit p2 = {}; + DOMPointInit p3 = {}; + DOMPointInit p4 = {}; }; diff --git a/components/script/dom/webidls/Document.webidl b/components/script/dom/webidls/Document.webidl index 85c3362f42e..0127f8ecf98 100644 --- a/components/script/dom/webidls/Document.webidl +++ b/components/script/dom/webidls/Document.webidl @@ -33,9 +33,9 @@ interface Document : Node { HTMLCollection getElementsByClassName(DOMString classNames); [CEReactions, NewObject, Throws] - Element createElement(DOMString localName, optional ElementCreationOptions options); + Element createElement(DOMString localName, optional ElementCreationOptions options = {}); [CEReactions, NewObject, Throws] - Element createElementNS(DOMString? namespace, DOMString qualifiedName, optional ElementCreationOptions options); + Element createElementNS(DOMString? namespace, DOMString qualifiedName, optional ElementCreationOptions options = {}); [NewObject] DocumentFragment createDocumentFragment(); [NewObject] diff --git a/components/script/dom/webidls/Element.webidl b/components/script/dom/webidls/Element.webidl index af14f81b373..f45dfe53f1a 100644 --- a/components/script/dom/webidls/Element.webidl +++ b/components/script/dom/webidls/Element.webidl @@ -91,12 +91,12 @@ partial interface Element { [NewObject] DOMRect getBoundingClientRect(); - void scroll(optional ScrollToOptions options); + void scroll(optional ScrollToOptions options = {}); void scroll(unrestricted double x, unrestricted double y); - void scrollTo(optional ScrollToOptions options); + void scrollTo(optional ScrollToOptions options = {}); void scrollTo(unrestricted double x, unrestricted double y); - void scrollBy(optional ScrollToOptions options); + void scrollBy(optional ScrollToOptions options = {}); void scrollBy(unrestricted double x, unrestricted double y); attribute unrestricted double scrollTop; attribute unrestricted double scrollLeft; diff --git a/components/script/dom/webidls/ErrorEvent.webidl b/components/script/dom/webidls/ErrorEvent.webidl index 9fb248e6095..165fbd35110 100644 --- a/components/script/dom/webidls/ErrorEvent.webidl +++ b/components/script/dom/webidls/ErrorEvent.webidl @@ -4,7 +4,7 @@ // https://html.spec.whatwg.org/multipage/#the-errorevent-interface -[Constructor(DOMString type, optional ErrorEventInit eventInitDict), Exposed=(Window,Worker)] +[Constructor(DOMString type, optional ErrorEventInit eventInitDict = {}), Exposed=(Window,Worker)] interface ErrorEvent : Event { readonly attribute DOMString message; readonly attribute DOMString filename; diff --git a/components/script/dom/webidls/Event.webidl b/components/script/dom/webidls/Event.webidl index 2bf103149d9..c688daedb2e 100644 --- a/components/script/dom/webidls/Event.webidl +++ b/components/script/dom/webidls/Event.webidl @@ -6,7 +6,7 @@ * https://dom.spec.whatwg.org/#event */ -[Constructor(DOMString type, optional EventInit eventInitDict), Exposed=(Window,Worker)] +[Constructor(DOMString type, optional EventInit eventInitDict = {}), Exposed=(Window,Worker)] interface Event { [Pure] readonly attribute DOMString type; diff --git a/components/script/dom/webidls/EventSource.webidl b/components/script/dom/webidls/EventSource.webidl index d1c33a6c3fc..7784c97d4ca 100644 --- a/components/script/dom/webidls/EventSource.webidl +++ b/components/script/dom/webidls/EventSource.webidl @@ -6,7 +6,7 @@ * https://html.spec.whatwg.org/multipage/#eventsource */ -[Constructor(DOMString url, optional EventSourceInit eventSourceInitDict), +[Constructor(DOMString url, optional EventSourceInit eventSourceInitDict = {}), Exposed=(Window,Worker)] interface EventSource : EventTarget { readonly attribute DOMString url; diff --git a/components/script/dom/webidls/EventTarget.webidl b/components/script/dom/webidls/EventTarget.webidl index b0a6e77035e..283f86a806f 100644 --- a/components/script/dom/webidls/EventTarget.webidl +++ b/components/script/dom/webidls/EventTarget.webidl @@ -10,13 +10,13 @@ interface EventTarget { void addEventListener( DOMString type, EventListener? callback, - optional (AddEventListenerOptions or boolean) options + optional (AddEventListenerOptions or boolean) options = {} ); void removeEventListener( DOMString type, EventListener? callback, - optional (EventListenerOptions or boolean) options + optional (EventListenerOptions or boolean) options = {} ); [Throws] diff --git a/components/script/dom/webidls/ExtendableEvent.webidl b/components/script/dom/webidls/ExtendableEvent.webidl index 7dc2983fe74..5d6c4786c3f 100644 --- a/components/script/dom/webidls/ExtendableEvent.webidl +++ b/components/script/dom/webidls/ExtendableEvent.webidl @@ -5,7 +5,7 @@ // https://w3c.github.io/ServiceWorker/#extendable-event [Constructor(DOMString type, - optional ExtendableEventInit eventInitDict), + optional ExtendableEventInit eventInitDict = {}), Exposed=ServiceWorker, Pref="dom.serviceworker.enabled"] interface ExtendableEvent : Event { diff --git a/components/script/dom/webidls/ExtendableMessageEvent.webidl b/components/script/dom/webidls/ExtendableMessageEvent.webidl index 3b06fb08cd8..e934d06b50b 100644 --- a/components/script/dom/webidls/ExtendableMessageEvent.webidl +++ b/components/script/dom/webidls/ExtendableMessageEvent.webidl @@ -4,7 +4,7 @@ // https://w3c.github.io/ServiceWorker/#extendablemessage-event-section -[Constructor(DOMString type, optional ExtendableMessageEventInit eventInitDict), +[Constructor(DOMString type, optional ExtendableMessageEventInit eventInitDict = {}), Exposed=ServiceWorker, Pref="dom.serviceworker.enabled"] interface ExtendableMessageEvent : ExtendableEvent { diff --git a/components/script/dom/webidls/Fetch.webidl b/components/script/dom/webidls/Fetch.webidl index 3b424ba85b6..ad0907d7436 100644 --- a/components/script/dom/webidls/Fetch.webidl +++ b/components/script/dom/webidls/Fetch.webidl @@ -7,5 +7,5 @@ [Exposed=(Window,Worker)] partial interface WindowOrWorkerGlobalScope { - [NewObject] Promise<Response> fetch(RequestInfo input, optional RequestInit init); + [NewObject] Promise<Response> fetch(RequestInfo input, optional RequestInit init = {}); }; diff --git a/components/script/dom/webidls/File.webidl b/components/script/dom/webidls/File.webidl index 00e1709ecc1..04e670723e4 100644 --- a/components/script/dom/webidls/File.webidl +++ b/components/script/dom/webidls/File.webidl @@ -6,7 +6,7 @@ [Constructor(sequence<BlobPart> fileBits, DOMString fileName, - optional FilePropertyBag options), + optional FilePropertyBag options = {}), Exposed=(Window,Worker)] interface File : Blob { readonly attribute DOMString name; diff --git a/components/script/dom/webidls/FocusEvent.webidl b/components/script/dom/webidls/FocusEvent.webidl index 5371399228f..67dec33a952 100644 --- a/components/script/dom/webidls/FocusEvent.webidl +++ b/components/script/dom/webidls/FocusEvent.webidl @@ -3,7 +3,7 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://w3c.github.io/uievents/#interface-FocusEvent -[Constructor(DOMString typeArg, optional FocusEventInit focusEventInitDict), +[Constructor(DOMString typeArg, optional FocusEventInit focusEventInitDict = {}), Exposed=Window] interface FocusEvent : UIEvent { readonly attribute EventTarget? relatedTarget; diff --git a/components/script/dom/webidls/FormDataEvent.webidl b/components/script/dom/webidls/FormDataEvent.webidl index d34f57b3a09..e478a33a729 100644 --- a/components/script/dom/webidls/FormDataEvent.webidl +++ b/components/script/dom/webidls/FormDataEvent.webidl @@ -4,7 +4,7 @@ // https://html.spec.whatwg.org/multipage/#the-formdataevent-interface [Exposed=Window, - Constructor(DOMString type, optional FormDataEventInit eventInitDict)] + Constructor(DOMString type, optional FormDataEventInit eventInitDict = {})] interface FormDataEvent : Event { readonly attribute FormData formData; }; diff --git a/components/script/dom/webidls/GainNode.webidl b/components/script/dom/webidls/GainNode.webidl index 02bbbacb697..97b205e63e9 100644 --- a/components/script/dom/webidls/GainNode.webidl +++ b/components/script/dom/webidls/GainNode.webidl @@ -11,7 +11,7 @@ dictionary GainOptions : AudioNodeOptions { }; [Exposed=Window, - Constructor (BaseAudioContext context, optional GainOptions options)] + Constructor (BaseAudioContext context, optional GainOptions options = {})] interface GainNode : AudioNode { readonly attribute AudioParam gain; }; diff --git a/components/script/dom/webidls/HashChangeEvent.webidl b/components/script/dom/webidls/HashChangeEvent.webidl index ec2065aa49e..e5049e75129 100644 --- a/components/script/dom/webidls/HashChangeEvent.webidl +++ b/components/script/dom/webidls/HashChangeEvent.webidl @@ -3,7 +3,7 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#hashchangeevent -[Constructor(DOMString type, optional HashChangeEventInit eventInitDict), +[Constructor(DOMString type, optional HashChangeEventInit eventInitDict = {}), Exposed=Window] interface HashChangeEvent : Event { readonly attribute USVString oldURL; diff --git a/components/script/dom/webidls/InputEvent.webidl b/components/script/dom/webidls/InputEvent.webidl index 23a62c06b2a..49fb9dc9695 100644 --- a/components/script/dom/webidls/InputEvent.webidl +++ b/components/script/dom/webidls/InputEvent.webidl @@ -8,7 +8,7 @@ */ // https://w3c.github.io/uievents/#idl-inputevent -[Constructor(DOMString type, optional InputEventInit eventInitDict)] +[Constructor(DOMString type, optional InputEventInit eventInitDict = {})] interface InputEvent : UIEvent { readonly attribute DOMString? data; readonly attribute boolean isComposing; diff --git a/components/script/dom/webidls/KeyboardEvent.webidl b/components/script/dom/webidls/KeyboardEvent.webidl index ed9350a9f29..f30265a87d8 100644 --- a/components/script/dom/webidls/KeyboardEvent.webidl +++ b/components/script/dom/webidls/KeyboardEvent.webidl @@ -7,7 +7,7 @@ * */ -[Constructor(DOMString typeArg, optional KeyboardEventInit keyboardEventInitDict)] +[Constructor(DOMString typeArg, optional KeyboardEventInit keyboardEventInitDict = {})] interface KeyboardEvent : UIEvent { // KeyLocationCode const unsigned long DOM_KEY_LOCATION_STANDARD = 0x00; diff --git a/components/script/dom/webidls/MediaDevices.webidl b/components/script/dom/webidls/MediaDevices.webidl index 866e1e964d0..0d9c3b9e98b 100644 --- a/components/script/dom/webidls/MediaDevices.webidl +++ b/components/script/dom/webidls/MediaDevices.webidl @@ -18,7 +18,7 @@ partial interface Navigator { partial interface MediaDevices { // MediaTrackSupportedConstraints getSupportedConstraints(); - Promise<MediaStream> getUserMedia(optional MediaStreamConstraints constraints); + Promise<MediaStream> getUserMedia(optional MediaStreamConstraints constraints = {}); }; diff --git a/components/script/dom/webidls/MediaQueryListEvent.webidl b/components/script/dom/webidls/MediaQueryListEvent.webidl index 9f194a6feb6..36464230e1b 100644 --- a/components/script/dom/webidls/MediaQueryListEvent.webidl +++ b/components/script/dom/webidls/MediaQueryListEvent.webidl @@ -3,7 +3,7 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://drafts.csswg.org/cssom-view/#dom-mediaquerylistevent-mediaquerylistevent -[Constructor(DOMString type, optional MediaQueryListEventInit eventInitDict), Exposed=(Window)] +[Constructor(DOMString type, optional MediaQueryListEventInit eventInitDict = {}), Exposed=(Window)] interface MediaQueryListEvent : Event { readonly attribute DOMString media; readonly attribute boolean matches; diff --git a/components/script/dom/webidls/MessageEvent.webidl b/components/script/dom/webidls/MessageEvent.webidl index c2ef9732096..fc43c463743 100644 --- a/components/script/dom/webidls/MessageEvent.webidl +++ b/components/script/dom/webidls/MessageEvent.webidl @@ -3,7 +3,7 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#messageevent -[Constructor(DOMString type, optional MessageEventInit eventInitDict), Exposed=(Window,Worker)] +[Constructor(DOMString type, optional MessageEventInit eventInitDict = {}), Exposed=(Window,Worker)] interface MessageEvent : Event { readonly attribute any data; readonly attribute DOMString origin; diff --git a/components/script/dom/webidls/MouseEvent.webidl b/components/script/dom/webidls/MouseEvent.webidl index 29d5872f65e..ca39c759c04 100644 --- a/components/script/dom/webidls/MouseEvent.webidl +++ b/components/script/dom/webidls/MouseEvent.webidl @@ -3,7 +3,7 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://w3c.github.io/uievents/#interface-mouseevent -[Constructor(DOMString typeArg, optional MouseEventInit mouseEventInitDict), +[Constructor(DOMString typeArg, optional MouseEventInit mouseEventInitDict = {}), Exposed=Window] interface MouseEvent : UIEvent { readonly attribute long screenX; diff --git a/components/script/dom/webidls/MutationObserver.webidl b/components/script/dom/webidls/MutationObserver.webidl index 28e59d8244d..a2f223da800 100644 --- a/components/script/dom/webidls/MutationObserver.webidl +++ b/components/script/dom/webidls/MutationObserver.webidl @@ -10,7 +10,7 @@ [Pref="dom.mutation_observer.enabled", Constructor(MutationCallback callback)] interface MutationObserver { [Throws] - void observe(Node target, optional MutationObserverInit options); + void observe(Node target, optional MutationObserverInit options = {}); void disconnect(); sequence<MutationRecord> takeRecords(); }; diff --git a/components/script/dom/webidls/Node.webidl b/components/script/dom/webidls/Node.webidl index 9433e96efa2..37943477bd3 100644 --- a/components/script/dom/webidls/Node.webidl +++ b/components/script/dom/webidls/Node.webidl @@ -32,7 +32,7 @@ interface Node : EventTarget { readonly attribute Document? ownerDocument; [Pure] - Node getRootNode(optional GetRootNodeOptions options); + Node getRootNode(optional GetRootNodeOptions options = {}); [Pure] readonly attribute Node? parentNode; diff --git a/components/script/dom/webidls/OscillatorNode.webidl b/components/script/dom/webidls/OscillatorNode.webidl index 510b87880a7..ee21e96ffea 100644 --- a/components/script/dom/webidls/OscillatorNode.webidl +++ b/components/script/dom/webidls/OscillatorNode.webidl @@ -22,7 +22,7 @@ dictionary OscillatorOptions : AudioNodeOptions { }; [Exposed=Window, - Constructor (BaseAudioContext context, optional OscillatorOptions options)] + Constructor (BaseAudioContext context, optional OscillatorOptions options = {})] interface OscillatorNode : AudioScheduledSourceNode { [SetterThrows] attribute OscillatorType type; diff --git a/components/script/dom/webidls/PageTransitionEvent.webidl b/components/script/dom/webidls/PageTransitionEvent.webidl index 147a2d2e0c1..c2f438a89b5 100644 --- a/components/script/dom/webidls/PageTransitionEvent.webidl +++ b/components/script/dom/webidls/PageTransitionEvent.webidl @@ -3,7 +3,7 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#the-pagetransitionevent-interface -[Constructor(DOMString type, optional PageTransitionEventInit eventInitDict), +[Constructor(DOMString type, optional PageTransitionEventInit eventInitDict = {}), Exposed=Window] interface PageTransitionEvent : Event { readonly attribute boolean persisted; diff --git a/components/script/dom/webidls/PannerNode.webidl b/components/script/dom/webidls/PannerNode.webidl index 8c9f8f1913e..08733377fef 100644 --- a/components/script/dom/webidls/PannerNode.webidl +++ b/components/script/dom/webidls/PannerNode.webidl @@ -35,7 +35,7 @@ enum PanningModelType { }; [Exposed=Window, - Constructor (BaseAudioContext context, optional PannerOptions options)] + Constructor (BaseAudioContext context, optional PannerOptions options = {})] interface PannerNode : AudioNode { attribute PanningModelType panningModel; readonly attribute AudioParam positionX; diff --git a/components/script/dom/webidls/PopStateEvent.webidl b/components/script/dom/webidls/PopStateEvent.webidl index 933ec3e7efa..1bd7637a647 100644 --- a/components/script/dom/webidls/PopStateEvent.webidl +++ b/components/script/dom/webidls/PopStateEvent.webidl @@ -3,7 +3,7 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://html.spec.whatwg.org/multipage/#the-popstateevent-interface -[Constructor(DOMString type, optional PopStateEventInit eventInitDict), +[Constructor(DOMString type, optional PopStateEventInit eventInitDict = {}), Exposed=Window] interface PopStateEvent : Event { readonly attribute any state; diff --git a/components/script/dom/webidls/ProgressEvent.webidl b/components/script/dom/webidls/ProgressEvent.webidl index 4168c2e6b1d..698ec828877 100644 --- a/components/script/dom/webidls/ProgressEvent.webidl +++ b/components/script/dom/webidls/ProgressEvent.webidl @@ -12,7 +12,7 @@ * http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0. */ -[Constructor(DOMString type, optional ProgressEventInit eventInitDict), +[Constructor(DOMString type, optional ProgressEventInit eventInitDict = {}), Exposed=(Window,Worker)] interface ProgressEvent : Event { readonly attribute boolean lengthComputable; diff --git a/components/script/dom/webidls/PromiseRejectionEvent.webidl b/components/script/dom/webidls/PromiseRejectionEvent.webidl index 3a1ee3dc128..43eb391ccfc 100644 --- a/components/script/dom/webidls/PromiseRejectionEvent.webidl +++ b/components/script/dom/webidls/PromiseRejectionEvent.webidl @@ -4,7 +4,7 @@ // https://html.spec.whatwg.org/multipage/#the-promiserejectionevent-interface -[Constructor(DOMString type, optional PromiseRejectionEventInit eventInitDict), Exposed=(Window,Worker)] +[Constructor(DOMString type, optional PromiseRejectionEventInit eventInitDict = {}), Exposed=(Window,Worker)] interface PromiseRejectionEvent : Event { readonly attribute Promise<any> promise; readonly attribute any reason; diff --git a/components/script/dom/webidls/RTCIceCandidate.webidl b/components/script/dom/webidls/RTCIceCandidate.webidl index 538805c88db..01fd9a42034 100644 --- a/components/script/dom/webidls/RTCIceCandidate.webidl +++ b/components/script/dom/webidls/RTCIceCandidate.webidl @@ -5,7 +5,7 @@ // https://w3c.github.io/webrtc-pc/#rtcicecandidate-interface -[Constructor(optional RTCIceCandidateInit candidateInitDict), +[Constructor(optional RTCIceCandidateInit candidateInitDict = {}), Exposed=Window, Pref="dom.webrtc.enabled"] interface RTCIceCandidate { readonly attribute DOMString candidate; diff --git a/components/script/dom/webidls/RTCPeerConnection.webidl b/components/script/dom/webidls/RTCPeerConnection.webidl index 58cb7301ea3..b702a70f71d 100644 --- a/components/script/dom/webidls/RTCPeerConnection.webidl +++ b/components/script/dom/webidls/RTCPeerConnection.webidl @@ -4,11 +4,11 @@ // https://w3c.github.io/webrtc-pc/#interface-definition -[Constructor(optional RTCConfiguration configuration), +[Constructor(optional RTCConfiguration configuration = {}), Exposed=Window, Pref="dom.webrtc.enabled"] interface RTCPeerConnection : EventTarget { - Promise<RTCSessionDescriptionInit> createOffer(optional RTCOfferOptions options); - Promise<RTCSessionDescriptionInit> createAnswer(optional RTCAnswerOptions options); + Promise<RTCSessionDescriptionInit> createOffer(optional RTCOfferOptions options = {}); + Promise<RTCSessionDescriptionInit> createAnswer(optional RTCAnswerOptions options = {}); Promise<void> setLocalDescription(RTCSessionDescriptionInit description); readonly attribute RTCSessionDescription? localDescription; // readonly attribute RTCSessionDescription? currentLocalDescription; @@ -17,7 +17,7 @@ interface RTCPeerConnection : EventTarget { readonly attribute RTCSessionDescription? remoteDescription; // readonly attribute RTCSessionDescription? currentRemoteDescription; // readonly attribute RTCSessionDescription? pendingRemoteDescription; - Promise<void> addIceCandidate(optional RTCIceCandidateInit candidate); + Promise<void> addIceCandidate(optional RTCIceCandidateInit candidate = {}); readonly attribute RTCSignalingState signalingState; readonly attribute RTCIceGatheringState iceGatheringState; readonly attribute RTCIceConnectionState iceConnectionState; diff --git a/components/script/dom/webidls/RTCPeerConnectionIceEvent.webidl b/components/script/dom/webidls/RTCPeerConnectionIceEvent.webidl index 26a3919b21f..0d2c2b72879 100644 --- a/components/script/dom/webidls/RTCPeerConnectionIceEvent.webidl +++ b/components/script/dom/webidls/RTCPeerConnectionIceEvent.webidl @@ -4,7 +4,7 @@ // https://w3c.github.io/webrtc-pc/#rtcpeerconnectioniceevent -[Constructor(DOMString type, optional RTCPeerConnectionIceEventInit eventInitDict), +[Constructor(DOMString type, optional RTCPeerConnectionIceEventInit eventInitDict = {}), Exposed=Window, Pref="dom.webrtc.enabled"] interface RTCPeerConnectionIceEvent : Event { readonly attribute RTCIceCandidate? candidate; diff --git a/components/script/dom/webidls/Request.webidl b/components/script/dom/webidls/Request.webidl index 79c1da9bad5..52f258446f3 100644 --- a/components/script/dom/webidls/Request.webidl +++ b/components/script/dom/webidls/Request.webidl @@ -6,7 +6,7 @@ typedef (Request or USVString) RequestInfo; -[Constructor(RequestInfo input, optional RequestInit init), +[Constructor(RequestInfo input, optional RequestInit init = {}), Exposed=(Window,Worker)] interface Request { diff --git a/components/script/dom/webidls/Response.webidl b/components/script/dom/webidls/Response.webidl index eaf8fb8b066..7297d64ae9b 100644 --- a/components/script/dom/webidls/Response.webidl +++ b/components/script/dom/webidls/Response.webidl @@ -4,7 +4,7 @@ // https://fetch.spec.whatwg.org/#response-class - [Constructor(optional BodyInit? body = null, optional ResponseInit init), + [Constructor(optional BodyInit? body = null, optional ResponseInit init = {}), Exposed=(Window,Worker)] interface Response { [NewObject] static Response error(); diff --git a/components/script/dom/webidls/ServiceWorkerContainer.webidl b/components/script/dom/webidls/ServiceWorkerContainer.webidl index ec7ae1a43e8..18deb5e58f4 100644 --- a/components/script/dom/webidls/ServiceWorkerContainer.webidl +++ b/components/script/dom/webidls/ServiceWorkerContainer.webidl @@ -8,7 +8,8 @@ interface ServiceWorkerContainer : EventTarget { readonly attribute ServiceWorker? controller; //readonly attribute Promise<ServiceWorkerRegistration> ready; - [NewObject] Promise<ServiceWorkerRegistration> register(USVString scriptURL, optional RegistrationOptions options); + [NewObject] Promise<ServiceWorkerRegistration> register(USVString scriptURL, + optional RegistrationOptions options = {}); //[NewObject] Promise<any> getRegistration(optional USVString clientURL = ""); //[NewObject] Promise<FrozenArray<ServiceWorkerRegistration>> getRegistrations(); diff --git a/components/script/dom/webidls/StereoPannerNode.webidl b/components/script/dom/webidls/StereoPannerNode.webidl index 69b58a408c1..1795ce79bdf 100644 --- a/components/script/dom/webidls/StereoPannerNode.webidl +++ b/components/script/dom/webidls/StereoPannerNode.webidl @@ -11,7 +11,7 @@ dictionary StereoPannerOptions: AudioNodeOptions { }; [Exposed=Window, - Constructor (BaseAudioContext context, optional StereoPannerOptions options)] + Constructor (BaseAudioContext context, optional StereoPannerOptions options = {})] interface StereoPannerNode : AudioScheduledSourceNode { readonly attribute AudioParam pan; }; diff --git a/components/script/dom/webidls/StorageEvent.webidl b/components/script/dom/webidls/StorageEvent.webidl index 72330c77f9e..060a82c0d05 100644 --- a/components/script/dom/webidls/StorageEvent.webidl +++ b/components/script/dom/webidls/StorageEvent.webidl @@ -9,7 +9,7 @@ * Event sent to a window when a storage area changes. */ -[Constructor(DOMString type, optional StorageEventInit eventInitDict), Exposed=Window] +[Constructor(DOMString type, optional StorageEventInit eventInitDict = {}), Exposed=Window] interface StorageEvent : Event { readonly attribute DOMString? key; readonly attribute DOMString? oldValue; diff --git a/components/script/dom/webidls/TestBinding.webidl b/components/script/dom/webidls/TestBinding.webidl index cc942fd06b8..36f91806d4a 100644 --- a/components/script/dom/webidls/TestBinding.webidl +++ b/components/script/dom/webidls/TestBinding.webidl @@ -32,7 +32,7 @@ dictionary TestDictionary { Blob interfaceValue; any anyValue; object objectValue; - TestDictionaryDefaults dict = null; + TestDictionaryDefaults dict = {}; sequence<TestDictionaryDefaults> seqDict; // Testing codegen to import Element correctly, ensure no other code references Element directly sequence<Element> elementSequence; diff --git a/components/script/dom/webidls/TestWorklet.webidl b/components/script/dom/webidls/TestWorklet.webidl index 3c5d84d2b09..3be494d4825 100644 --- a/components/script/dom/webidls/TestWorklet.webidl +++ b/components/script/dom/webidls/TestWorklet.webidl @@ -7,6 +7,6 @@ [Pref="dom.worklet.testing.enabled", Exposed=(Window), Constructor] interface TestWorklet { - [NewObject] Promise<void> addModule(USVString moduleURL, optional WorkletOptions options); + [NewObject] Promise<void> addModule(USVString moduleURL, optional WorkletOptions options = {}); DOMString? lookup(DOMString key); }; diff --git a/components/script/dom/webidls/TextDecoder.webidl b/components/script/dom/webidls/TextDecoder.webidl index 5f1a0cc881a..a2454ab4e05 100644 --- a/components/script/dom/webidls/TextDecoder.webidl +++ b/components/script/dom/webidls/TextDecoder.webidl @@ -12,11 +12,11 @@ dictionary TextDecodeOptions { boolean stream = false; }; -[Constructor(optional DOMString label = "utf-8", optional TextDecoderOptions options), Exposed=(Window,Worker)] +[Constructor(optional DOMString label = "utf-8", optional TextDecoderOptions options = {}), Exposed=(Window,Worker)] interface TextDecoder { readonly attribute DOMString encoding; readonly attribute boolean fatal; readonly attribute boolean ignoreBOM; [Throws] - USVString decode(optional BufferSource input, optional TextDecodeOptions options); + USVString decode(optional BufferSource input, optional TextDecodeOptions options = {}); }; diff --git a/components/script/dom/webidls/TrackEvent.webidl b/components/script/dom/webidls/TrackEvent.webidl index 214583e3245..f87fa0472a1 100644 --- a/components/script/dom/webidls/TrackEvent.webidl +++ b/components/script/dom/webidls/TrackEvent.webidl @@ -5,7 +5,7 @@ // https://html.spec.whatwg.org/multipage/#the-trackevent-interface [Exposed=Window, - Constructor(DOMString type, optional TrackEventInit eventInitDict)] + Constructor(DOMString type, optional TrackEventInit eventInitDict = {})] interface TrackEvent : Event { readonly attribute (VideoTrack or AudioTrack or TextTrack)? track; }; diff --git a/components/script/dom/webidls/TransitionEvent.webidl b/components/script/dom/webidls/TransitionEvent.webidl index 505d6bc2941..05998ececfb 100644 --- a/components/script/dom/webidls/TransitionEvent.webidl +++ b/components/script/dom/webidls/TransitionEvent.webidl @@ -6,7 +6,7 @@ * https://dom.spec.whatwg.org/#event */ -[Constructor(DOMString type, optional TransitionEventInit transitionEventInitDict), +[Constructor(DOMString type, optional TransitionEventInit transitionEventInitDict = {}), Exposed=Window] interface TransitionEvent : Event { readonly attribute DOMString propertyName; diff --git a/components/script/dom/webidls/UIEvent.webidl b/components/script/dom/webidls/UIEvent.webidl index 7e895a34448..20be43aec90 100644 --- a/components/script/dom/webidls/UIEvent.webidl +++ b/components/script/dom/webidls/UIEvent.webidl @@ -3,7 +3,7 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://w3c.github.io/uievents/#interface-uievent -[Constructor(DOMString type, optional UIEventInit eventInitDict)] +[Constructor(DOMString type, optional UIEventInit eventInitDict = {})] interface UIEvent : Event { // readonly attribute WindowProxy? view; readonly attribute Window? view; diff --git a/components/script/dom/webidls/WebGLContextEvent.webidl b/components/script/dom/webidls/WebGLContextEvent.webidl index 308f3ec7610..f8a2dbf2137 100644 --- a/components/script/dom/webidls/WebGLContextEvent.webidl +++ b/components/script/dom/webidls/WebGLContextEvent.webidl @@ -3,7 +3,7 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.15 -[Constructor(DOMString type, optional WebGLContextEventInit eventInit), +[Constructor(DOMString type, optional WebGLContextEventInit eventInit = {}), Exposed=Window] interface WebGLContextEvent : Event { readonly attribute DOMString statusMessage; diff --git a/components/script/dom/webidls/WheelEvent.webidl b/components/script/dom/webidls/WheelEvent.webidl index a38b87dd97d..b202d7f2c24 100644 --- a/components/script/dom/webidls/WheelEvent.webidl +++ b/components/script/dom/webidls/WheelEvent.webidl @@ -3,7 +3,7 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ // https://w3c.github.io/uievents/#interface-wheelevent -[Constructor(DOMString typeArg, optional WheelEventInit wheelEventInitDict), +[Constructor(DOMString typeArg, optional WheelEventInit wheelEventInitDict = {}), Exposed=Window] interface WheelEvent : MouseEvent { const unsigned long DOM_DELTA_PIXEL = 0x00; diff --git a/components/script/dom/webidls/Window.webidl b/components/script/dom/webidls/Window.webidl index 81ffee9283e..56d9d06a819 100644 --- a/components/script/dom/webidls/Window.webidl +++ b/components/script/dom/webidls/Window.webidl @@ -118,11 +118,11 @@ partial interface Window { [Replaceable] readonly attribute long pageXOffset; [Replaceable] readonly attribute long scrollY; [Replaceable] readonly attribute long pageYOffset; - void scroll(optional ScrollToOptions options); + void scroll(optional ScrollToOptions options = {}); void scroll(unrestricted double x, unrestricted double y); - void scrollTo(optional ScrollToOptions options); + void scrollTo(optional ScrollToOptions options = {}); void scrollTo(unrestricted double x, unrestricted double y); - void scrollBy(optional ScrollToOptions options); + void scrollBy(optional ScrollToOptions options = {}); void scrollBy(unrestricted double x, unrestricted double y); // client diff --git a/components/script/dom/webidls/Worker.webidl b/components/script/dom/webidls/Worker.webidl index 2c17e459fa8..f09b565f31a 100644 --- a/components/script/dom/webidls/Worker.webidl +++ b/components/script/dom/webidls/Worker.webidl @@ -9,7 +9,7 @@ interface AbstractWorker { }; // https://html.spec.whatwg.org/multipage/#worker -[Constructor(USVString scriptURL, optional WorkerOptions options), Exposed=(Window,Worker)] +[Constructor(USVString scriptURL, optional WorkerOptions options = {}), Exposed=(Window,Worker)] interface Worker : EventTarget { void terminate(); diff --git a/components/script/dom/webidls/Worklet.webidl b/components/script/dom/webidls/Worklet.webidl index 9e954925ab0..16ec8e8d7c9 100644 --- a/components/script/dom/webidls/Worklet.webidl +++ b/components/script/dom/webidls/Worklet.webidl @@ -5,7 +5,7 @@ // https://drafts.css-houdini.org/worklets/#worklet [Pref="dom.worklet.enabled", Exposed=(Window)] interface Worklet { - [NewObject] Promise<void> addModule(USVString moduleURL, optional WorkletOptions options); + [NewObject] Promise<void> addModule(USVString moduleURL, optional WorkletOptions options = {}); }; dictionary WorkletOptions { diff --git a/components/script/dom/webidls/XR.webidl b/components/script/dom/webidls/XR.webidl index 58732edd42b..0b3debeaee6 100644 --- a/components/script/dom/webidls/XR.webidl +++ b/components/script/dom/webidls/XR.webidl @@ -7,7 +7,7 @@ interface XR: EventTarget { // Methods Promise<void> supportsSessionMode(XRSessionMode mode); - Promise<XRSession> requestSession(optional XRSessionCreationOptions parameters); + Promise<XRSession> requestSession(optional XRSessionCreationOptions parameters = {}); // Events // attribute EventHandler ondevicechange; diff --git a/components/script/dom/webidls/XRRigidTransform.webidl b/components/script/dom/webidls/XRRigidTransform.webidl index 089dc1732a6..b58a8c339e4 100644 --- a/components/script/dom/webidls/XRRigidTransform.webidl +++ b/components/script/dom/webidls/XRRigidTransform.webidl @@ -5,7 +5,7 @@ // https://immersive-web.github.io/webxr/#xrrigidtransform-interface [SecureContext, Exposed=Window, Pref="dom.webxr.enabled", - Constructor(optional DOMPointInit position, optional DOMPointInit orientation)] + Constructor(optional DOMPointInit position = {}, optional DOMPointInit orientation = {})] interface XRRigidTransform { readonly attribute DOMPointReadOnly position; readonly attribute DOMPointReadOnly orientation; diff --git a/components/script/dom/webidls/XRSession.webidl b/components/script/dom/webidls/XRSession.webidl index 59ccecb521a..d35f724f87e 100644 --- a/components/script/dom/webidls/XRSession.webidl +++ b/components/script/dom/webidls/XRSession.webidl @@ -29,7 +29,7 @@ interface XRSession : EventTarget { // FrozenArray<XRInputSource> getInputSources(); sequence<XRInputSource> getInputSources(); - void updateRenderState(optional XRRenderStateInit state); + void updateRenderState(optional XRRenderStateInit state = {}); long requestAnimationFrame(XRFrameRequestCallback callback); void cancelAnimationFrame(long handle); diff --git a/components/script/dom/webidls/XRWebGLLayer.webidl b/components/script/dom/webidls/XRWebGLLayer.webidl index 0df8296be34..f551096fc05 100644 --- a/components/script/dom/webidls/XRWebGLLayer.webidl +++ b/components/script/dom/webidls/XRWebGLLayer.webidl @@ -19,7 +19,7 @@ dictionary XRWebGLLayerInit { [SecureContext, Exposed=Window, Constructor(XRSession session, XRWebGLRenderingContext context, - optional XRWebGLLayerInit layerInit), + optional XRWebGLLayerInit layerInit = {}), Pref="dom.webxr.enabled"] interface XRWebGLLayer : XRLayer { // // Attributes |