Bug 1562680. Implement the new syntax for Web IDL dictionary defaulting. r=peterv
authorBoris Zbarsky <bzbarsky@mit.edu>
Wed, 03 Jul 2019 07:52:35 +0000
changeset 481127 59c08b215af55370b0a8eef16528e99654ffa558
parent 481126 9e1e48c8cd7de0633bd9cd7e8fdfc97da26be04c
child 481128 0ab7f6c67d4be16e78cdac5b729729646a3375e5
push id36234
push useropoprus@mozilla.com
push dateThu, 04 Jul 2019 03:31:17 +0000
treeherdermozilla-central@8ad5fbc5b935 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspeterv
bugs1562680
milestone69.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1562680. Implement the new syntax for Web IDL dictionary defaulting. r=peterv `= {}` can now be used to indicate that an optional dictionary should have the default value of 'default-initialized dictionary' Differential Revision: https://phabricator.services.mozilla.com/D36504
dom/bindings/Codegen.py
dom/bindings/parser/WebIDL.py
dom/bindings/parser/tests/test_dictionary.py
dom/bindings/parser/tests/test_distinguishability.py
dom/bindings/test/TestCodeGen.webidl
dom/bindings/test/TestExampleGen.webidl
dom/bindings/test/TestJSImplGen.webidl
dom/chrome-webidl/ChannelWrapper.webidl
dom/chrome-webidl/ChromeUtils.webidl
dom/chrome-webidl/InspectorUtils.webidl
dom/chrome-webidl/JSWindowActor.webidl
dom/chrome-webidl/L10nOverlays.webidl
dom/chrome-webidl/MatchPattern.webidl
dom/chrome-webidl/MessageManager.webidl
dom/chrome-webidl/SessionStoreUtils.webidl
dom/chrome-webidl/TelemetryStopwatch.webidl
dom/webidl/AddonManager.webidl
dom/webidl/AnalyserNode.webidl
dom/webidl/Animatable.webidl
dom/webidl/AnimationEffect.webidl
dom/webidl/AnimationEvent.webidl
dom/webidl/AnimationPlaybackEvent.webidl
dom/webidl/AnonymousContent.webidl
dom/webidl/AppNotificationServiceOptions.webidl
dom/webidl/AudioBufferSourceNode.webidl
dom/webidl/AudioContext.webidl
dom/webidl/AudioWorkletNode.webidl
dom/webidl/AudioWorkletProcessor.webidl
dom/webidl/BaseAudioContext.webidl
dom/webidl/BiquadFilterNode.webidl
dom/webidl/Blob.webidl
dom/webidl/BlobEvent.webidl
dom/webidl/CSPReport.webidl
dom/webidl/Cache.webidl
dom/webidl/CacheStorage.webidl
dom/webidl/CanvasRenderingContext2D.webidl
dom/webidl/CaretStateChangedEvent.webidl
dom/webidl/ChannelMergerNode.webidl
dom/webidl/ChannelSplitterNode.webidl
dom/webidl/Client.webidl
dom/webidl/Clients.webidl
dom/webidl/ClipboardEvent.webidl
dom/webidl/CloseEvent.webidl
dom/webidl/CompositionEvent.webidl
dom/webidl/Console.webidl
dom/webidl/ConstantSourceNode.webidl
dom/webidl/ConvolverNode.webidl
dom/webidl/CredentialManagement.webidl
dom/webidl/CustomElementRegistry.webidl
dom/webidl/CustomEvent.webidl
dom/webidl/DOMMatrix.webidl
dom/webidl/DOMPoint.webidl
dom/webidl/DOMQuad.webidl
dom/webidl/DOMRect.webidl
dom/webidl/DedicatedWorkerGlobalScope.webidl
dom/webidl/DelayNode.webidl
dom/webidl/DeviceLightEvent.webidl
dom/webidl/DeviceMotionEvent.webidl
dom/webidl/DeviceOrientationEvent.webidl
dom/webidl/DeviceProximityEvent.webidl
dom/webidl/Document.webidl
dom/webidl/DocumentTimeline.webidl
dom/webidl/DragEvent.webidl
dom/webidl/DynamicsCompressorNode.webidl
dom/webidl/Element.webidl
dom/webidl/ErrorEvent.webidl
dom/webidl/Event.webidl
dom/webidl/EventSource.webidl
dom/webidl/EventTarget.webidl
dom/webidl/ExtendableEvent.webidl
dom/webidl/ExtendableMessageEvent.webidl
dom/webidl/File.webidl
dom/webidl/FileSystemDirectoryEntry.webidl
dom/webidl/FocusEvent.webidl
dom/webidl/FontFace.webidl
dom/webidl/FontFaceSetLoadEvent.webidl
dom/webidl/FrameCrashedEvent.webidl
dom/webidl/FuzzingFunctions.webidl
dom/webidl/GainNode.webidl
dom/webidl/GamepadAxisMoveEvent.webidl
dom/webidl/GamepadButtonEvent.webidl
dom/webidl/GamepadEvent.webidl
dom/webidl/Geolocation.webidl
dom/webidl/GeometryUtils.webidl
dom/webidl/HTMLInputElement.webidl
dom/webidl/HTMLSlotElement.webidl
dom/webidl/HashChangeEvent.webidl
dom/webidl/HiddenPluginEvent.webidl
dom/webidl/IDBDatabase.webidl
dom/webidl/IDBFactory.webidl
dom/webidl/IDBFileHandle.webidl
dom/webidl/IDBObjectStore.webidl
dom/webidl/IDBVersionChangeEvent.webidl
dom/webidl/ImageCaptureErrorEvent.webidl
dom/webidl/InputEvent.webidl
dom/webidl/IntersectionObserver.webidl
dom/webidl/IntlUtils.webidl
dom/webidl/KeyboardEvent.webidl
dom/webidl/KeyframeEffect.webidl
dom/webidl/MIDIConnectionEvent.webidl
dom/webidl/MIDIMessageEvent.webidl
dom/webidl/MediaDevices.webidl
dom/webidl/MediaEncryptedEvent.webidl
dom/webidl/MediaKeys.webidl
dom/webidl/MediaQueryListEvent.webidl
dom/webidl/MediaRecorder.webidl
dom/webidl/MediaStreamAudioDestinationNode.webidl
dom/webidl/MediaStreamEvent.webidl
dom/webidl/MediaStreamTrack.webidl
dom/webidl/MerchantValidationEvent.webidl
dom/webidl/MessageEvent.webidl
dom/webidl/MessagePort.webidl
dom/webidl/MouseEvent.webidl
dom/webidl/MozApplicationEvent.webidl
dom/webidl/MozFrameLoaderOwner.webidl
dom/webidl/MutationObserver.webidl
dom/webidl/Navigator.webidl
dom/webidl/Node.webidl
dom/webidl/Notification.webidl
dom/webidl/OscillatorNode.webidl
dom/webidl/PageTransitionEvent.webidl
dom/webidl/PannerNode.webidl
dom/webidl/PaymentMethodChangeEvent.webidl
dom/webidl/PaymentRequest.webidl
dom/webidl/PaymentRequestUpdateEvent.webidl
dom/webidl/PaymentResponse.webidl
dom/webidl/PeerConnectionImpl.webidl
dom/webidl/PeerConnectionObserver.webidl
dom/webidl/PerformanceEntryEvent.webidl
dom/webidl/PerformanceObserver.webidl
dom/webidl/PerformanceObserverEntryList.webidl
dom/webidl/PeriodicWave.webidl
dom/webidl/PluginCrashedEvent.webidl
dom/webidl/PointerEvent.webidl
dom/webidl/PopStateEvent.webidl
dom/webidl/PopupBlockedEvent.webidl
dom/webidl/ProgressEvent.webidl
dom/webidl/PushEvent.webidl
dom/webidl/PushManager.webidl
dom/webidl/PushSubscription.webidl
dom/webidl/RTCDTMFToneChangeEvent.webidl
dom/webidl/RTCIceCandidate.webidl
dom/webidl/RTCIdentityProvider.webidl
dom/webidl/RTCPeerConnection.webidl
dom/webidl/RTCPeerConnectionIceEvent.webidl
dom/webidl/RTCRtpSender.webidl
dom/webidl/RTCSessionDescription.webidl
dom/webidl/Reporting.webidl
dom/webidl/Request.webidl
dom/webidl/ResizeObserver.webidl
dom/webidl/Response.webidl
dom/webidl/SVGGeometryElement.webidl
dom/webidl/SVGGraphicsElement.webidl
dom/webidl/SVGTextContentElement.webidl
dom/webidl/ScrollViewChangeEvent.webidl
dom/webidl/SecurityPolicyViolationEvent.webidl
dom/webidl/ServiceWorker.webidl
dom/webidl/ServiceWorkerContainer.webidl
dom/webidl/ServiceWorkerRegistration.webidl
dom/webidl/SharedWorker.webidl
dom/webidl/SpeechRecognitionError.webidl
dom/webidl/SpeechRecognitionEvent.webidl
dom/webidl/StereoPannerNode.webidl
dom/webidl/StorageEvent.webidl
dom/webidl/StreamFilterDataEvent.webidl
dom/webidl/StyleRuleChangeEvent.webidl
dom/webidl/StyleSheetApplicableStateChangeEvent.webidl
dom/webidl/StyleSheetChangeEvent.webidl
dom/webidl/TCPServerSocket.webidl
dom/webidl/TCPServerSocketEvent.webidl
dom/webidl/TCPSocket.webidl
dom/webidl/TCPSocketErrorEvent.webidl
dom/webidl/TCPSocketEvent.webidl
dom/webidl/TestInterfaceJS.webidl
dom/webidl/TextDecoder.webidl
dom/webidl/TouchEvent.webidl
dom/webidl/TrackEvent.webidl
dom/webidl/TransitionEvent.webidl
dom/webidl/UDPMessageEvent.webidl
dom/webidl/UDPSocket.webidl
dom/webidl/UIEvent.webidl
dom/webidl/UserProximityEvent.webidl
dom/webidl/WaveShaperNode.webidl
dom/webidl/WebAuthentication.webidl
dom/webidl/WebGLContextEvent.webidl
dom/webidl/WebGPU.webidl
dom/webidl/WebrtcDeprecated.webidl
dom/webidl/WheelEvent.webidl
dom/webidl/Window.webidl
dom/webidl/WindowOrWorkerGlobalScope.webidl
dom/webidl/Worker.webidl
dom/webidl/Worklet.webidl
dom/webidl/XMLHttpRequest.webidl
dom/webidl/XULPopupElement.webidl
--- a/dom/bindings/Codegen.py
+++ b/dom/bindings/Codegen.py
@@ -8,17 +8,17 @@ import os
 import re
 import string
 import math
 import textwrap
 import functools
 
 from perfecthash import PerfectHash
 
-from WebIDL import BuiltinTypes, IDLBuiltinType, IDLNullValue, IDLSequenceType, IDLType, IDLAttribute, IDLInterfaceMember, IDLUndefinedValue, IDLEmptySequenceValue, IDLDictionary
+from WebIDL import BuiltinTypes, IDLBuiltinType, IDLDefaultDictionaryValue, IDLNullValue, IDLSequenceType, IDLType, IDLAttribute, IDLInterfaceMember, IDLUndefinedValue, IDLEmptySequenceValue, IDLDictionary
 from Configuration import NoSuchDescriptorError, getTypesFromDescriptor, getTypesFromDictionary, getTypesFromCallback, getAllTypes, Descriptor, MemberIsUnforgeable, iteratorNativeType
 
 AUTOGENERATED_WARNING_COMMENT = \
     "/* THIS FILE IS AUTOGENERATED BY Codegen.py - DO NOT EDIT */\n\n"
 AUTOGENERATED_WITH_SOURCE_WARNING_COMMENT = \
     "/* THIS FILE IS AUTOGENERATED FROM %s BY Codegen.py - DO NOT EDIT */\n\n"
 ADDPROPERTY_HOOK_NAME = '_addProperty'
 FINALIZE_HOOK_NAME = '_finalize'
@@ -5482,17 +5482,19 @@ def getJSToNativeConversionInfo(type, de
             constructHolder = None
 
         if not isMember and isCallbackReturnValue:
             declType = CGWrapper(declType, post="&")
             declArgs = "aRetVal"
         else:
             declArgs = None
 
-        if defaultValue and not isinstance(defaultValue, IDLNullValue):
+        if (defaultValue and
+            not isinstance(defaultValue, IDLNullValue) and
+            not isinstance(defaultValue, IDLDefaultDictionaryValue)):
             tag = defaultValue.type.tag()
 
             if tag in numericSuffixes or tag is IDLType.Tags.bool:
                 defaultStr = getHandleDefault(defaultValue)
                 # Make sure we actually construct the thing inside the nullable.
                 value = declLoc + (".SetValue()" if nullable else "")
                 name = getUnionMemberName(defaultValue.type)
                 default = CGGeneric("%s.RawSetAs%s() = %s;\n" %
@@ -5530,17 +5532,17 @@ def getJSToNativeConversionInfo(type, de
                     extraConditionForNull = "!(${haveValue}) || "
                 else:
                     extraConditionForNull = "(${haveValue}) && "
             else:
                 extraConditionForNull = ""
             templateBody = handleNull(templateBody, declLoc,
                                       extraConditionForNull=extraConditionForNull)
         elif (not type.hasNullableType and defaultValue and
-              isinstance(defaultValue, IDLNullValue)):
+              isinstance(defaultValue, IDLDefaultDictionaryValue)):
             assert type.hasDictionaryType()
             assert defaultValue.type.isDictionary()
             if not isOwningUnion and typeNeedsRooting(defaultValue.type):
                 ctorArgs = "cx"
             else:
                 ctorArgs = ""
             initDictionaryWithNull = CGIfWrapper(
                 CGGeneric("return false;\n"),
@@ -6194,24 +6196,27 @@ def getJSToNativeConversionInfo(type, de
         if not isMember and not isCallbackReturnValue:
             # Since we're not a member and not nullable or optional, no one will
             # see our real type, so we can do the fast version of the dictionary
             # that doesn't pre-initialize members.
             typeName = "binding_detail::Fast" + typeName
 
         declType = CGGeneric(typeName)
 
-        # We do manual default value handling here, because we
-        # actually do want a jsval, and we only handle null anyway
+        # We do manual default value handling here, because we actually do want
+        # a jsval, and we only handle the default-dictionary case (which we map
+        # into initialization with the JS value `null`) anyway
         # NOTE: if isNullOrUndefined or isDefinitelyObject are true,
         # we know we have a value, so we don't have to worry about the
         # default value.
         if (not isNullOrUndefined and not isDefinitelyObject and
             defaultValue is not None):
-            assert(isinstance(defaultValue, IDLNullValue))
+            assert(isinstance(defaultValue, IDLDefaultDictionaryValue))
+            # Initializing from JS null does the right thing to give
+            # us a default-initialized dictionary.
             val = "(${haveValue}) ? ${val} : JS::NullHandleValue"
         else:
             val = "${val}"
 
         dictLoc = "${declName}"
         if type.nullable():
             dictLoc += ".SetValue()"
 
--- a/dom/bindings/parser/WebIDL.py
+++ b/dom/bindings/parser/WebIDL.py
@@ -3599,18 +3599,16 @@ class IDLNullValue(IDLObject):
     def __init__(self, location):
         IDLObject.__init__(self, location)
         self.type = None
         self.value = None
 
     def coerceToType(self, type, location):
         if (not isinstance(type, IDLNullableType) and
             not (type.isUnion() and type.hasNullableType) and
-            not (type.isUnion() and type.hasDictionaryType()) and
-            not type.isDictionary() and
             not type.isAny()):
             raise WebIDLError("Cannot coerce null value to type %s." % type,
                               [location])
 
         nullValue = IDLNullValue(self.location)
         if type.isUnion() and not type.nullable() and type.hasDictionaryType():
             # We're actually a default value for the union's dictionary member.
             # Use its type.
@@ -3649,16 +3647,45 @@ class IDLEmptySequenceValue(IDLObject):
         emptySequenceValue = IDLEmptySequenceValue(self.location)
         emptySequenceValue.type = type
         return emptySequenceValue
 
     def _getDependentObjects(self):
         return set()
 
 
+class IDLDefaultDictionaryValue(IDLObject):
+    def __init__(self, location):
+        IDLObject.__init__(self, location)
+        self.type = None
+        self.value = None
+
+    def coerceToType(self, type, location):
+        if type.isUnion():
+            # We use the flat member types here, because if we have a nullable
+            # member type, or a nested union, we want the type the value
+            # actually coerces to, not the nullable or nested union type.
+            for subtype in type.unroll().flatMemberTypes:
+                try:
+                    return self.coerceToType(subtype, location)
+                except:
+                    pass
+
+        if not type.isDictionary():
+            raise WebIDLError("Cannot coerce default dictionary value to type %s." % type,
+                              [location])
+
+        defaultDictionaryValue = IDLDefaultDictionaryValue(self.location)
+        defaultDictionaryValue.type = type
+        return defaultDictionaryValue
+
+    def _getDependentObjects(self):
+        return set()
+
+
 class IDLUndefinedValue(IDLObject):
     def __init__(self, location):
         IDLObject.__init__(self, location)
         self.type = None
         self.value = None
 
     def coerceToType(self, type, location):
         if not type.isAny():
@@ -4648,24 +4675,17 @@ class IDLArgument(IDLObjectWithIdentifie
 
         if not self.type.isComplete():
             type = self.type.complete(scope)
             assert not isinstance(type, IDLUnresolvedType)
             assert not isinstance(type, IDLTypedefType)
             assert not isinstance(type.name, IDLUnresolvedIdentifier)
             self.type = type
 
-        if ((self.type.isDictionary() or
-             self.type.isUnion() and self.type.unroll().hasDictionaryType()) and
-            self.optional and not self.defaultValue and not self.variadic and
-            not self.dictionaryMember):
-            # Default optional non-variadic dictionary arguments to null,
-            # for simplicity, so the codegen doesn't have to special-case this.
-            self.defaultValue = IDLNullValue(self.location)
-        elif self.type.isAny():
+        if self.type.isAny():
             assert (self.defaultValue is None or
                     isinstance(self.defaultValue, IDLNullValue))
             # optional 'any' values always have a default value
             if self.optional and not self.defaultValue and not self.variadic:
                 # Set the default value to undefined, for simplicity, so the
                 # codegen doesn't have to special-case this.
                 self.defaultValue = IDLUndefinedValue(self.location)
 
@@ -5095,16 +5115,25 @@ class IDLMethod(IDLInterfaceMember, IDLS
                         all(arg.optional for arg in arguments[idx+1:])):
                         raise WebIDLError("Dictionary argument without any "
                                           "required fields or union argument "
                                           "containing such dictionary not "
                                           "followed by a required argument "
                                           "must be optional",
                                           [argument.location])
 
+                    if (not argument.defaultValue and
+                        all(arg.optional for arg in arguments[idx+1:])):
+                        raise WebIDLError("Dictionary argument without any "
+                                          "required fields or union argument "
+                                          "containing such dictionary not "
+                                          "followed by a required argument "
+                                          "must have a default value",
+                                          [argument.location])
+
                     # An argument cannot be a Nullable Dictionary
                     if argument.type.nullable():
                         raise WebIDLError("An argument cannot be a nullable "
                                           "dictionary or nullable union "
                                           "containing a dictionary",
                                           [argument.location])
 
                 # Only the last argument can be variadic
@@ -5964,22 +5993,27 @@ class Parser(Tokenizer):
             p[0] = p[2]
         else:
             p[0] = None
 
     def p_DefaultValue(self, p):
         """
             DefaultValue : ConstValue
                          | LBRACKET RBRACKET
+                         | LBRACE RBRACE
         """
         if len(p) == 2:
             p[0] = p[1]
         else:
-            assert len(p) == 3  # Must be []
-            p[0] = IDLEmptySequenceValue(self.getLocation(p, 1))
+            assert len(p) == 3  # Must be [] or {}
+            if p[1] == "[":
+                p[0] = IDLEmptySequenceValue(self.getLocation(p, 1))
+            else:
+                assert p[1] == "{"
+                p[0] = IDLDefaultDictionaryValue(self.getLocation(p, 1))
 
     def p_DefaultValueNull(self, p):
         """
             DefaultValue : NULL
         """
         p[0] = IDLNullValue(self.getLocation(p, 1))
 
     def p_Exception(self, p):
--- a/dom/bindings/parser/tests/test_dictionary.py
+++ b/dom/bindings/parser/tests/test_dictionary.py
@@ -169,16 +169,32 @@ def WebIDLTest(parser, harness):
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             dictionary A {
             };
             interface X {
+              void doFoo(optional A arg);
+            };
+        """)
+        results = parser.finish()
+    except:
+        threw = True
+
+    harness.ok(threw, "Trailing dictionary arg must have a default value")
+
+    parser = parser.reset()
+    threw = False
+    try:
+        parser.parse("""
+            dictionary A {
+            };
+            interface X {
               void doFoo((A or DOMString) arg);
             };
         """)
         results = parser.finish()
     except:
         threw = True
 
     harness.ok(threw,
@@ -186,32 +202,65 @@ def WebIDLTest(parser, harness):
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             dictionary A {
             };
             interface X {
+              void doFoo(optional (A or DOMString) arg);
+            };
+        """)
+        results = parser.finish()
+    except:
+        threw = True
+
+    harness.ok(threw,
+               "Trailing union arg containing a dictionary must have a default value")
+
+    parser = parser.reset()
+    threw = False
+    try:
+        parser.parse("""
+            dictionary A {
+            };
+            interface X {
               void doFoo(A arg1, optional long arg2);
             };
         """)
         results = parser.finish()
     except:
         threw = True
 
     harness.ok(threw, "Dictionary arg followed by optional arg must be optional")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             dictionary A {
             };
             interface X {
+              void doFoo(optional A arg1, optional long arg2);
+            };
+        """)
+        results = parser.finish()
+    except:
+        threw = True
+
+    harness.ok(threw, "Dictionary arg followed by optional arg must have default value")
+
+    parser = parser.reset()
+    threw = False
+    try:
+        parser.parse("""
+            dictionary A {
+            };
+            interface X {
               void doFoo(A arg1, optional long arg2, long arg3);
             };
         """)
         results = parser.finish()
     except:
         threw = True
 
     harness.ok(not threw,
@@ -231,16 +280,34 @@ def WebIDLTest(parser, harness):
     except:
         threw = True
 
     harness.ok(threw,
                "Union arg containing dictionary followed by optional arg must "
                "be optional")
 
     parser = parser.reset()
+    threw = False
+    try:
+        parser.parse("""
+            dictionary A {
+            };
+            interface X {
+              void doFoo(optional (A or DOMString) arg1, optional long arg2);
+            };
+        """)
+        results = parser.finish()
+    except:
+        threw = True
+
+    harness.ok(threw,
+               "Union arg containing dictionary followed by optional arg must "
+               "have a default value")
+
+    parser = parser.reset()
     parser.parse("""
             dictionary A {
             };
             interface X {
               void doFoo(A arg1, long arg2);
             };
         """)
     results = parser.finish()
@@ -321,34 +388,45 @@ def WebIDLTest(parser, harness):
     results = parser.finish()
     harness.ok(True, "Dictionary return value can be nullable")
 
     parser = parser.reset()
     parser.parse("""
         dictionary A {
         };
         interface X {
-          void doFoo(optional A arg);
+          void doFoo(optional A arg = {});
         };
     """)
     results = parser.finish()
     harness.ok(True, "Dictionary arg should actually parse")
 
     parser = parser.reset()
     parser.parse("""
         dictionary A {
         };
         interface X {
-          void doFoo(optional (A or DOMString) arg);
+          void doFoo(optional (A or DOMString) arg = {});
         };
     """)
     results = parser.finish()
     harness.ok(True, "Union arg containing a dictionary should actually parse")
 
     parser = parser.reset()
+    parser.parse("""
+        dictionary A {
+        };
+        interface X {
+          void doFoo(optional (A or DOMString) arg = "abc");
+        };
+    """)
+    results = parser.finish()
+    harness.ok(True, "Union arg containing a dictionary with string default should actually parse")
+
+    parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             dictionary Foo {
               Foo foo;
             };
         """)
         results = parser.finish()
--- a/dom/bindings/parser/tests/test_distinguishability.py
+++ b/dom/bindings/parser/tests/test_distinguishability.py
@@ -1,20 +1,23 @@
 def firstArgType(method):
     return method.signatures()[0][1][0].type
 
 def WebIDLTest(parser, harness):
     parser.parse("""
+      // Give our dictionary a required member so we don't need to
+      // mess with optional and default values.
       dictionary Dict {
+        required long member;
       };
       callback interface Foo {
       };
       interface Bar {
         // Bit of a pain to get things that have dictionary types
-        void passDict(optional Dict arg);
+        void passDict(Dict arg);
         void passFoo(Foo arg);
         void passNullableUnion((object? or DOMString) arg);
         void passNullable(Foo? arg);
       };
     """)
     results = parser.finish()
 
     iface = results[2]
@@ -151,50 +154,50 @@ def WebIDLTest(parser, harness):
 
     # Now let's test our whole distinguishability table
     argTypes = [ "long", "short", "long?", "short?", "boolean",
                  "boolean?", "DOMString", "ByteString", "Enum", "Enum2",
                  "Interface", "Interface?",
                  "AncestorInterface", "UnrelatedInterface",
                  "ImplementedInterface", "CallbackInterface",
                  "CallbackInterface?", "CallbackInterface2",
-                 "object", "Callback", "Callback2", "optional Dict",
-                 "optional Dict2", "sequence<long>", "sequence<short>",
+                 "object", "Callback", "Callback2", "Dict",
+                 "Dict2", "sequence<long>", "sequence<short>",
                  "record<DOMString, object>",
                  "record<USVString, Dict>",
                  "record<ByteString, long>",
                  "Date", "Date?", "any",
                  "Promise<any>", "Promise<any>?",
                  "USVString", "ArrayBuffer", "ArrayBufferView", "SharedArrayBuffer",
                  "Uint8Array", "Uint16Array",
-                 "(long or Callback)", "optional (long or Dict)",
+                 "(long or Callback)", "(long or Dict)",
     ]
     # When we can parse Date, we need to add it here.
     # XXXbz we can, and should really do that...
 
     # Try to categorize things a bit to keep list lengths down
     def allBut(list1, list2):
         return [a for a in list1 if a not in list2 and
                 (a != "any" and a != "Promise<any>" and a != "Promise<any>?")]
-    unions = [ "(long or Callback)", "optional (long or Dict)" ]
+    unions = [ "(long or Callback)", "(long or Dict)" ]
     numerics = [ "long", "short", "long?", "short?" ]
     booleans = [ "boolean", "boolean?" ]
     primitives = numerics + booleans
     nonNumerics = allBut(argTypes, numerics + unions)
     nonBooleans = allBut(argTypes, booleans)
     strings = [ "DOMString", "ByteString", "Enum", "Enum2", "USVString" ]
     nonStrings = allBut(argTypes, strings)
     nonObjects = primitives + strings
     objects = allBut(argTypes, nonObjects )
     bufferSourceTypes = ["ArrayBuffer", "ArrayBufferView", "Uint8Array", "Uint16Array"]
     sharedBufferSourceTypes = ["SharedArrayBuffer"]
     interfaces = [ "Interface", "Interface?", "AncestorInterface",
                    "UnrelatedInterface", "ImplementedInterface" ] + bufferSourceTypes + sharedBufferSourceTypes
     nullables = (["long?", "short?", "boolean?", "Interface?",
-                  "CallbackInterface?", "optional Dict", "optional Dict2",
+                  "CallbackInterface?", "Dict", "Dict2",
                   "Date?", "any", "Promise<any>?"] +
                  allBut(unions, [ "(long or Callback)" ]))
     dates = [ "Date", "Date?" ]
     sequences = [ "sequence<long>", "sequence<short>" ]
     nonUserObjects = nonObjects + interfaces + dates + sequences
     otherObjects = allBut(argTypes, nonUserObjects + ["object"])
     notRelatedInterfaces = (nonObjects + ["UnrelatedInterface"] +
                             otherObjects + dates + sequences + bufferSourceTypes + sharedBufferSourceTypes)
@@ -228,18 +231,18 @@ def WebIDLTest(parser, harness):
                        allBut(argTypes, ["object", "UnrelatedInterface"]))
     setDistinguishable("ImplementedInterface", notRelatedInterfaces)
     setDistinguishable("CallbackInterface", nonUserObjects)
     setDistinguishable("CallbackInterface?", allBut(nonUserObjects, nullables))
     setDistinguishable("CallbackInterface2", nonUserObjects)
     setDistinguishable("object", nonObjects)
     setDistinguishable("Callback", nonUserObjects)
     setDistinguishable("Callback2", nonUserObjects)
-    setDistinguishable("optional Dict", allBut(nonUserObjects, nullables))
-    setDistinguishable("optional Dict2", allBut(nonUserObjects, nullables))
+    setDistinguishable("Dict", allBut(nonUserObjects, nullables))
+    setDistinguishable("Dict2", allBut(nonUserObjects, nullables))
     setDistinguishable("sequence<long>",
                        allBut(argTypes, sequences + ["object"]))
     setDistinguishable("sequence<short>",
                        allBut(argTypes, sequences + ["object"]))
     setDistinguishable("record<DOMString, object>", nonUserObjects)
     setDistinguishable("record<USVString, Dict>", nonUserObjects)
     setDistinguishable("record<ByteString, long>", nonUserObjects)
     setDistinguishable("Date", allBut(argTypes, dates + ["object"]))
@@ -249,17 +252,17 @@ def WebIDLTest(parser, harness):
     setDistinguishable("Promise<any>?", [])
     setDistinguishable("ArrayBuffer", allBut(argTypes, ["ArrayBuffer", "object"]))
     setDistinguishable("ArrayBufferView", allBut(argTypes, ["ArrayBufferView", "Uint8Array", "Uint16Array", "object"]))
     setDistinguishable("Uint8Array", allBut(argTypes, ["ArrayBufferView", "Uint8Array", "object"]))
     setDistinguishable("Uint16Array", allBut(argTypes, ["ArrayBufferView", "Uint16Array", "object"]))
     setDistinguishable("SharedArrayBuffer", allBut(argTypes, ["SharedArrayBuffer", "object"]))
     setDistinguishable("(long or Callback)",
                        allBut(nonUserObjects, numerics))
-    setDistinguishable("optional (long or Dict)",
+    setDistinguishable("(long or Dict)",
                        allBut(nonUserObjects, numerics + nullables))
 
     def areDistinguishable(type1, type2):
         return data[type1].get(type2, False)
 
     def checkDistinguishability(parser, type1, type2):
         idlTemplate = """
           enum Enum { "a", "b" };
@@ -268,18 +271,20 @@ def WebIDLTest(parser, harness):
           interface AncestorInterface {};
           interface UnrelatedInterface {};
           interface ImplementedInterface {};
           Interface implements ImplementedInterface;
           callback interface CallbackInterface {};
           callback interface CallbackInterface2 {};
           callback Callback = any();
           callback Callback2 = long(short arg);
-          dictionary Dict {};
-          dictionary Dict2 {};
+          // Give our dictionaries required members so we don't need to
+          // mess with optional and default values.
+          dictionary Dict { required long member; };
+          dictionary Dict2 { required long member; };
           interface TestInterface {%s
           };
         """
         methodTemplate = """
             void myMethod(%s arg);"""
         methods = (methodTemplate % type1) + (methodTemplate % type2)
         idl = idlTemplate % methods
         parser = parser.reset()
--- a/dom/bindings/test/TestCodeGen.webidl
+++ b/dom/bindings/test/TestCodeGen.webidl
@@ -630,35 +630,35 @@ interface TestInterface {
   void passUnion2((long or boolean) arg);
   void passUnion3((object or long or boolean) arg);
   void passUnion4((Node or long or boolean) arg);
   void passUnion5((object or boolean) arg);
   void passUnion6((object or DOMString) arg);
   void passUnion7((object or DOMString or long) arg);
   void passUnion8((object or DOMString or boolean) arg);
   void passUnion9((object or DOMString or long or boolean) arg);
-  void passUnion10(optional (EventInit or long) arg);
-  void passUnion11(optional (CustomEventInit or long) arg);
+  void passUnion10(optional (EventInit or long) arg = {});
+  void passUnion11(optional (CustomEventInit or long) arg = {});
   void passUnion12(optional (EventInit or long) arg = 5);
   void passUnion13(optional (object or long?) arg = null);
   void passUnion14(optional (object or long?) arg = 5);
   void passUnion15((sequence<long> or long) arg);
   void passUnion16(optional (sequence<long> or long) arg);
   void passUnion17(optional (sequence<long>? or long) arg = 5);
   void passUnion18((sequence<object> or long) arg);
   void passUnion19(optional (sequence<object> or long) arg);
   void passUnion20(optional (sequence<object> or long) arg = []);
   void passUnion21((record<DOMString, long> or long) arg);
   void passUnion22((record<DOMString, object> or long) arg);
   void passUnion23((sequence<ImageData> or long) arg);
   void passUnion24((sequence<ImageData?> or long) arg);
   void passUnion25((sequence<sequence<ImageData>> or long) arg);
   void passUnion26((sequence<sequence<ImageData?>> or long) arg);
-  void passUnion27(optional (sequence<DOMString> or EventInit) arg);
-  void passUnion28(optional (EventInit or sequence<DOMString>) arg);
+  void passUnion27(optional (sequence<DOMString> or EventInit) arg = {});
+  void passUnion28(optional (EventInit or sequence<DOMString>) arg = {});
   void passUnionWithCallback((EventHandler or long) arg);
   void passUnionWithByteString((ByteString or long) arg);
   void passUnionWithRecord((record<DOMString, DOMString> or DOMString) arg);
   void passUnionWithRecordAndSequence((record<DOMString, DOMString> or sequence<DOMString>) arg);
   void passUnionWithSequenceAndRecord((sequence<DOMString> or record<DOMString, DOMString>) arg);
   void passUnionWithUSVS((USVString or long) arg);
 #endif
   void passUnionWithNullable((object? or long) arg);
@@ -775,42 +775,42 @@ interface TestInterface {
   [BinaryName="otherMethodRenamedTo"]
   void otherMethodRenamedFrom();
   void methodRenamedFrom(byte argument);
   readonly attribute byte attributeGetterRenamedFrom;
   attribute byte attributeRenamedFrom;
   [BinaryName="otherAttributeRenamedTo"]
   attribute byte otherAttributeRenamedFrom;
 
-  void passDictionary(optional Dict x);
+  void passDictionary(optional Dict x = {});
   void passDictionary2(Dict x);
   [Cached, Pure]
   readonly attribute Dict readonlyDictionary;
   [Cached, Pure]
   readonly attribute Dict? readonlyNullableDictionary;
   [Cached, Pure]
   attribute Dict writableDictionary;
   [Cached, Pure, Frozen]
   readonly attribute Dict readonlyFrozenDictionary;
   [Cached, Pure, Frozen]
   readonly attribute Dict? readonlyFrozenNullableDictionary;
   [Cached, Pure, Frozen]
   attribute Dict writableFrozenDictionary;
   Dict receiveDictionary();
   Dict? receiveNullableDictionary();
-  void passOtherDictionary(optional GrandparentDict x);
+  void passOtherDictionary(optional GrandparentDict x = {});
   void passSequenceOfDictionaries(sequence<Dict> x);
   void passRecordOfDictionaries(record<DOMString, GrandparentDict> x);
   // No support for nullable dictionaries inside a sequence (nor should there be)
   //  void passSequenceOfNullableDictionaries(sequence<Dict?> x);
-  void passDictionaryOrLong(optional Dict x);
+  void passDictionaryOrLong(optional Dict x = {});
   void passDictionaryOrLong(long x);
 
-  void passDictContainingDict(optional DictContainingDict arg);
-  void passDictContainingSequence(optional DictContainingSequence arg);
+  void passDictContainingDict(optional DictContainingDict arg = {});
+  void passDictContainingSequence(optional DictContainingSequence arg = {});
   DictContainingSequence receiveDictContainingSequence();
   void passVariadicDictionary(Dict... arg);
 
   // EnforceRange/Clamp tests
   void dontEnforceRangeOrClamp(byte arg);
   void doEnforceRange([EnforceRange] byte arg);
   void doClamp([Clamp] byte arg);
   attribute [EnforceRange] byte enforcedByte;
@@ -846,17 +846,17 @@ interface TestInterface {
   [Deprecated="EnablePrivilege"]
   static void staticDeprecatedMethodWithContext(any arg);
 
   // Overload resolution tests
   //void overload1(DOMString... strs);
   boolean overload1(TestInterface arg);
   TestInterface overload1(DOMString strs, TestInterface arg);
   void overload2(TestInterface arg);
-  void overload2(optional Dict arg);
+  void overload2(optional Dict arg = {});
   void overload2(boolean arg);
   void overload2(DOMString arg);
   void overload2(Date arg);
   void overload3(TestInterface arg);
   void overload3(TestCallback arg);
   void overload3(boolean arg);
   void overload4(TestInterface arg);
   void overload4(TestCallbackInterface arg);
@@ -886,18 +886,18 @@ interface TestInterface {
   void overload15(optional TestInterface arg);
   void overload16(long arg);
   void overload16(optional TestInterface? arg);
   void overload17(sequence<long> arg);
   void overload17(record<DOMString, long> arg);
   void overload18(record<DOMString, DOMString> arg);
   void overload18(sequence<DOMString> arg);
   void overload19(sequence<long> arg);
-  void overload19(optional Dict arg);
-  void overload20(optional Dict arg);
+  void overload19(optional Dict arg = {});
+  void overload20(optional Dict arg = {});
   void overload20(sequence<long> arg);
 
   // Variadic handling
   void passVariadicThirdArg(DOMString arg1, long arg2, TestInterface... arg3);
 
   // Conditionally exposed methods/attributes
   [Pref="abc.def"]
   readonly attribute boolean prefable1;
@@ -985,17 +985,17 @@ interface TestInterface {
   [NeedsSubjectPrincipal=NonSystem] attribute boolean needsNonSystemSubjectPrincipalAttr;
   [CEReactions] void ceReactionsMethod();
   [CEReactions] void ceReactionsMethodOverload();
   [CEReactions] void ceReactionsMethodOverload(DOMString bar);
   [CEReactions] attribute boolean ceReactionsAttr;
   legacycaller short(unsigned long arg1, TestInterface arg2);
   void passArgsWithDefaults(optional long arg1,
                             optional TestInterface? arg2 = null,
-                            optional Dict arg3, optional double arg4 = 5.0,
+                            optional Dict arg3 = {}, optional double arg4 = 5.0,
                             optional float arg5);
 
   attribute any toJSONShouldSkipThis;
   attribute TestParentInterface toJSONShouldSkipThis2;
   attribute TestCallbackInterface toJSONShouldSkipThis3;
   [Default] object toJSON();
 
   attribute byte dashed-attribute;
@@ -1119,18 +1119,18 @@ dictionary Dict : ParentDict {
   (object or long) objectOrLong;
 #ifdef DEBUG
   (EventInit or long) eventInitOrLong;
   (EventInit or long)? nullableEventInitOrLong;
   (HTMLElement or long)? nullableHTMLElementOrLong;
   // CustomEventInit is useful to test because it needs rooting.
   (CustomEventInit or long) eventInitOrLong2;
   (CustomEventInit or long)? nullableEventInitOrLong2;
-  (EventInit or long) eventInitOrLongWithDefaultValue = null;
-  (CustomEventInit or long) eventInitOrLongWithDefaultValue2 = null;
+  (EventInit or long) eventInitOrLongWithDefaultValue = {};
+  (CustomEventInit or long) eventInitOrLongWithDefaultValue2 = {};
   (EventInit or long) eventInitOrLongWithDefaultValue3 = 5;
   (CustomEventInit or long) eventInitOrLongWithDefaultValue4 = 5;
   (EventInit or long)? nullableEventInitOrLongWithDefaultValue = null;
   (CustomEventInit or long)? nullableEventInitOrLongWithDefaultValue2 = null;
   (EventInit or long)? nullableEventInitOrLongWithDefaultValue3 = 5;
   (CustomEventInit or long)? nullableEventInitOrLongWithDefaultValue4 = 5;
   (sequence<object> or long) objectSequenceOrLong;
   (sequence<object> or long) objectSequenceOrLongWithDefaultValue1 = 1;
--- a/dom/bindings/test/TestExampleGen.webidl
+++ b/dom/bindings/test/TestExampleGen.webidl
@@ -439,35 +439,35 @@ interface TestExampleInterface {
   void passUnion2((long or boolean) arg);
   void passUnion3((object or long or boolean) arg);
   void passUnion4((Node or long or boolean) arg);
   void passUnion5((object or boolean) arg);
   void passUnion6((object or DOMString) arg);
   void passUnion7((object or DOMString or long) arg);
   void passUnion8((object or DOMString or boolean) arg);
   void passUnion9((object or DOMString or long or boolean) arg);
-  void passUnion10(optional (EventInit or long) arg);
-  void passUnion11(optional (CustomEventInit or long) arg);
+  void passUnion10(optional (EventInit or long) arg = {});
+  void passUnion11(optional (CustomEventInit or long) arg = {});
   void passUnion12(optional (EventInit or long) arg = 5);
   void passUnion13(optional (object or long?) arg = null);
   void passUnion14(optional (object or long?) arg = 5);
   void passUnion15((sequence<long> or long) arg);
   void passUnion16(optional (sequence<long> or long) arg);
   void passUnion17(optional (sequence<long>? or long) arg = 5);
   void passUnion18((sequence<object> or long) arg);
   void passUnion19(optional (sequence<object> or long) arg);
   void passUnion20(optional (sequence<object> or long) arg = []);
   void passUnion21((record<DOMString, long> or long) arg);
   void passUnion22((record<DOMString, object> or long) arg);
   void passUnion23((sequence<ImageData> or long) arg);
   void passUnion24((sequence<ImageData?> or long) arg);
   void passUnion25((sequence<sequence<ImageData>> or long) arg);
   void passUnion26((sequence<sequence<ImageData?>> or long) arg);
-  void passUnion27(optional (sequence<DOMString> or EventInit) arg);
-  void passUnion28(optional (EventInit or sequence<DOMString>) arg);
+  void passUnion27(optional (sequence<DOMString> or EventInit) arg = {});
+  void passUnion28(optional (EventInit or sequence<DOMString>) arg = {});
   void passUnionWithCallback((EventHandler or long) arg);
   void passUnionWithByteString((ByteString or long) arg);
   void passUnionWithRecord((record<DOMString, DOMString> or DOMString) arg);
   void passUnionWithRecordAndSequence((record<DOMString, DOMString> or sequence<DOMString>) arg);
   void passUnionWithSequenceAndRecord((sequence<DOMString> or record<DOMString, DOMString>) arg);
   void passUnionWithSVS((USVString or long) arg);
 #endif
   void passUnionWithNullable((object? or long) arg);
@@ -584,42 +584,42 @@ interface TestExampleInterface {
   [BinaryName="otherMethodRenamedTo"]
   void otherMethodRenamedFrom();
   void methodRenamedFrom(byte argument);
   readonly attribute byte attributeGetterRenamedFrom;
   attribute byte attributeRenamedFrom;
   [BinaryName="otherAttributeRenamedTo"]
   attribute byte otherAttributeRenamedFrom;
 
-  void passDictionary(optional Dict x);
+  void passDictionary(optional Dict x = {});
   void passDictionary2(Dict x);
   [Cached, Pure]
   readonly attribute Dict readonlyDictionary;
   [Cached, Pure]
   readonly attribute Dict? readonlyNullableDictionary;
   [Cached, Pure]
   attribute Dict writableDictionary;
   [Cached, Pure, Frozen]
   readonly attribute Dict readonlyFrozenDictionary;
   [Cached, Pure, Frozen]
   readonly attribute Dict? readonlyFrozenNullableDictionary;
   [Cached, Pure, Frozen]
   attribute Dict writableFrozenDictionary;
   Dict receiveDictionary();
   Dict? receiveNullableDictionary();
-  void passOtherDictionary(optional GrandparentDict x);
+  void passOtherDictionary(optional GrandparentDict x = {});
   void passSequenceOfDictionaries(sequence<Dict> x);
   void passRecordOfDictionaries(record<DOMString, GrandparentDict> x);
   // No support for nullable dictionaries inside a sequence (nor should there be)
   //  void passSequenceOfNullableDictionaries(sequence<Dict?> x);
-  void passDictionaryOrLong(optional Dict x);
+  void passDictionaryOrLong(optional Dict x = {});
   void passDictionaryOrLong(long x);
 
-  void passDictContainingDict(optional DictContainingDict arg);
-  void passDictContainingSequence(optional DictContainingSequence arg);
+  void passDictContainingDict(optional DictContainingDict arg = {});
+  void passDictContainingSequence(optional DictContainingSequence arg = {});
   DictContainingSequence receiveDictContainingSequence();
   void passVariadicDictionary(Dict... arg);
 
   // EnforceRange/Clamp tests
   void dontEnforceRangeOrClamp(byte arg);
   void doEnforceRange([EnforceRange] byte arg);
   void doClamp([Clamp] byte arg);
   attribute [EnforceRange] byte enforcedByte;
@@ -652,17 +652,17 @@ interface TestExampleInterface {
   [Deprecated="EnablePrivilege"]
   static void staticDeprecatedMethodWithContext(any arg);
 
   // Overload resolution tests
   //void overload1(DOMString... strs);
   boolean overload1(TestInterface arg);
   TestInterface overload1(DOMString strs, TestInterface arg);
   void overload2(TestInterface arg);
-  void overload2(optional Dict arg);
+  void overload2(optional Dict arg = {});
   void overload2(boolean arg);
   void overload2(DOMString arg);
   void overload2(Date arg);
   void overload3(TestInterface arg);
   void overload3(TestCallback arg);
   void overload3(boolean arg);
   void overload4(TestInterface arg);
   void overload4(TestCallbackInterface arg);
@@ -692,18 +692,18 @@ interface TestExampleInterface {
   void overload15(optional TestInterface arg);
   void overload16(long arg);
   void overload16(optional TestInterface? arg);
   void overload17(sequence<long> arg);
   void overload17(record<DOMString, long> arg);
   void overload18(record<DOMString, DOMString> arg);
   void overload18(sequence<DOMString> arg);
   void overload19(sequence<long> arg);
-  void overload19(optional Dict arg);
-  void overload20(optional Dict arg);
+  void overload19(optional Dict arg = {});
+  void overload20(optional Dict arg = {});
   void overload20(sequence<long> arg);
 
   // Variadic handling
   void passVariadicThirdArg(DOMString arg1, long arg2, TestInterface... arg3);
 
   // Conditionally exposed methods/attributes
   [Pref="abc.def"]
   readonly attribute boolean prefable1;
@@ -789,17 +789,17 @@ interface TestExampleInterface {
   [NeedsCallerType] attribute boolean needsCallerTypeAttr;
   [CEReactions] void ceReactionsMethod();
   [CEReactions] void ceReactionsMethodOverload();
   [CEReactions] void ceReactionsMethodOverload(DOMString bar);
   [CEReactions] attribute boolean ceReactionsAttr;
   legacycaller short(unsigned long arg1, TestInterface arg2);
   void passArgsWithDefaults(optional long arg1,
                             optional TestInterface? arg2 = null,
-                            optional Dict arg3, optional double arg4 = 5.0,
+                            optional Dict arg3 = {}, optional double arg4 = 5.0,
                             optional float arg5);
   attribute any toJSONShouldSkipThis;
   attribute TestParentInterface toJSONShouldSkipThis2;
   attribute TestCallbackInterface toJSONShouldSkipThis3;
   [Default] object toJSON();
 
   attribute byte dashed-attribute;
   void dashed-method();
--- a/dom/bindings/test/TestJSImplGen.webidl
+++ b/dom/bindings/test/TestJSImplGen.webidl
@@ -453,35 +453,35 @@ interface TestJSImplInterface {
   void passUnion2((long or boolean) arg);
   void passUnion3((object or long or boolean) arg);
   void passUnion4((Node or long or boolean) arg);
   void passUnion5((object or boolean) arg);
   void passUnion6((object or DOMString) arg);
   void passUnion7((object or DOMString or long) arg);
   void passUnion8((object or DOMString or boolean) arg);
   void passUnion9((object or DOMString or long or boolean) arg);
-  void passUnion10(optional (EventInit or long) arg);
-  void passUnion11(optional (CustomEventInit or long) arg);
+  void passUnion10(optional (EventInit or long) arg = {});
+  void passUnion11(optional (CustomEventInit or long) arg = {});
   void passUnion12(optional (EventInit or long) arg = 5);
   void passUnion13(optional (object or long?) arg = null);
   void passUnion14(optional (object or long?) arg = 5);
   void passUnion15((sequence<long> or long) arg);
   void passUnion16(optional (sequence<long> or long) arg);
   void passUnion17(optional (sequence<long>? or long) arg = 5);
   void passUnion18((sequence<object> or long) arg);
   void passUnion19(optional (sequence<object> or long) arg);
   void passUnion20(optional (sequence<object> or long) arg = []);
   void passUnion21((record<DOMString, long> or long) arg);
   void passUnion22((record<DOMString, object> or long) arg);
   void passUnion23((sequence<ImageData> or long) arg);
   void passUnion24((sequence<ImageData?> or long) arg);
   void passUnion25((sequence<sequence<ImageData>> or long) arg);
   void passUnion26((sequence<sequence<ImageData?>> or long) arg);
-  void passUnion27(optional (sequence<DOMString> or EventInit) arg);
-  void passUnion28(optional (EventInit or sequence<DOMString>) arg);
+  void passUnion27(optional (sequence<DOMString> or EventInit) arg = {});
+  void passUnion28(optional (EventInit or sequence<DOMString>) arg = {});
   void passUnionWithCallback((EventHandler or long) arg);
   void passUnionWithByteString((ByteString or long) arg);
   void passUnionWithRecord((record<DOMString, DOMString> or DOMString) arg);
   void passUnionWithRecordAndSequence((record<DOMString, DOMString> or sequence<DOMString>) arg);
   void passUnionWithSequenceAndRecord((sequence<DOMString> or record<DOMString, DOMString>) arg);
   void passUnionWithSVS((USVString or long) arg);
 #endif
   void passUnionWithNullable((object? or long) arg);
@@ -598,43 +598,43 @@ interface TestJSImplInterface {
   [BinaryName="otherMethodRenamedTo"]
   void otherMethodRenamedFrom();
   void methodRenamedFrom(byte argument);
   readonly attribute byte attributeGetterRenamedFrom;
   attribute byte attributeRenamedFrom;
   [BinaryName="otherAttributeRenamedTo"]
   attribute byte otherAttributeRenamedFrom;
 
-  void passDictionary(optional Dict x);
+  void passDictionary(optional Dict x = {});
   void passDictionary2(Dict x);
   // [Cached] is not supported in JS-implemented WebIDL.
   //[Cached, Pure]
   //readonly attribute Dict readonlyDictionary;
   //[Cached, Pure]
   //readonly attribute Dict? readonlyNullableDictionary;
   //[Cached, Pure]
   //attribute Dict writableDictionary;
   //[Cached, Pure, Frozen]
   //readonly attribute Dict readonlyFrozenDictionary;
   //[Cached, Pure, Frozen]
   //readonly attribute Dict? readonlyFrozenNullableDictionary;
   //[Cached, Pure, Frozen]
   //attribute Dict writableFrozenDictionary;
   Dict receiveDictionary();
   Dict? receiveNullableDictionary();
-  void passOtherDictionary(optional GrandparentDict x);
+  void passOtherDictionary(optional GrandparentDict x = {});
   void passSequenceOfDictionaries(sequence<Dict> x);
   void passRecordOfDictionaries(record<DOMString, GrandparentDict> x);
   // No support for nullable dictionaries inside a sequence (nor should there be)
   //  void passSequenceOfNullableDictionaries(sequence<Dict?> x);
-  void passDictionaryOrLong(optional Dict x);
+  void passDictionaryOrLong(optional Dict x = {});
   void passDictionaryOrLong(long x);
 
-  void passDictContainingDict(optional DictContainingDict arg);
-  void passDictContainingSequence(optional DictContainingSequence arg);
+  void passDictContainingDict(optional DictContainingDict arg = {});
+  void passDictContainingSequence(optional DictContainingSequence arg = {});
   DictContainingSequence receiveDictContainingSequence();
   void passVariadicDictionary(Dict... arg);
 
   // EnforceRange/Clamp tests
   void dontEnforceRangeOrClamp(byte arg);
   void doEnforceRange([EnforceRange] byte arg);
   void doClamp([Clamp] byte arg);
   attribute [EnforceRange] byte enforcedByte;
@@ -670,17 +670,17 @@ interface TestJSImplInterface {
   static byte staticDeprecatedMethodWithContext();
   */
 
   // Overload resolution tests
   //void overload1(DOMString... strs);
   boolean overload1(TestJSImplInterface arg);
   TestJSImplInterface overload1(DOMString strs, TestJSImplInterface arg);
   void overload2(TestJSImplInterface arg);
-  void overload2(optional Dict arg);
+  void overload2(optional Dict arg = {});
   void overload2(boolean arg);
   void overload2(DOMString arg);
   void overload2(Date arg);
   void overload3(TestJSImplInterface arg);
   void overload3(MyTestCallback arg);
   void overload3(boolean arg);
   void overload4(TestJSImplInterface arg);
   void overload4(TestCallbackInterface arg);
@@ -710,18 +710,18 @@ interface TestJSImplInterface {
   void overload15(optional TestInterface arg);
   void overload16(long arg);
   void overload16(optional TestInterface? arg);
   void overload17(sequence<long> arg);
   void overload17(record<DOMString, long> arg);
   void overload18(record<DOMString, DOMString> arg);
   void overload18(sequence<DOMString> arg);
   void overload19(sequence<long> arg);
-  void overload19(optional Dict arg);
-  void overload20(optional Dict arg);
+  void overload19(optional Dict arg = {});
+  void overload20(optional Dict arg = {});
   void overload20(sequence<long> arg);
 
   // Variadic handling
   void passVariadicThirdArg(DOMString arg1, long arg2, TestJSImplInterface... arg3);
 
   // Conditionally exposed methods/attributes
   [Pref="abc.def"]
   readonly attribute boolean prefable1;
@@ -811,17 +811,17 @@ interface TestJSImplInterface {
   [CEReactions] attribute boolean ceReactionsAttr;
   // NeedsSubjectPrincipal not supported on JS-implemented things for
   // now, because we always pass in the caller principal anyway.
   //  [NeedsSubjectPrincipal] void needsSubjectPrincipalMethod();
   //  [NeedsSubjectPrincipal] attribute boolean needsSubjectPrincipalAttr;
   // legacycaller short(unsigned long arg1, TestInterface arg2);
   void passArgsWithDefaults(optional long arg1,
                             optional TestInterface? arg2 = null,
-                            optional Dict arg3, optional double arg4 = 5.0,
+                            optional Dict arg3 = {}, optional double arg4 = 5.0,
                             optional float arg5);
   attribute any toJSONShouldSkipThis;
   attribute TestParentInterface toJSONShouldSkipThis2;
   attribute TestCallbackInterface toJSONShouldSkipThis3;
   [Default] object toJSON();
 
   attribute byte dashed-attribute;
   void dashed-method();
--- a/dom/chrome-webidl/ChannelWrapper.webidl
+++ b/dom/chrome-webidl/ChannelWrapper.webidl
@@ -144,19 +144,19 @@ interface ChannelWrapper : EventTarget {
   [Cached, Pure]
   readonly attribute DOMString finalURL;
 
 
   /**
    * Returns true if the request matches the given request filter, and the
    * given extension has permission to access it.
    */
-  boolean matches(optional MozRequestFilter filter,
+  boolean matches(optional MozRequestFilter filter = {},
                   optional WebExtensionPolicy? extension = null,
-                  optional MozRequestMatchOptions options);
+                  optional MozRequestMatchOptions options = {});
 
 
   /**
    * Register's this channel as traceable by the given add-on when accessed
    * via the process of the given RemoteTab.
    */
   void registerTraceableChannel(WebExtensionPolicy extension, RemoteTab? remoteTab);
 
--- a/dom/chrome-webidl/ChromeUtils.webidl
+++ b/dom/chrome-webidl/ChromeUtils.webidl
@@ -34,27 +34,27 @@ namespace ChromeUtils {
    * @param boundaries        The portion of the heap graph to write.
    *
    * @returns                 The path to the file the heap snapshot was written
    *                          to. This is guaranteed to be within the temp
    *                          directory and its file name will match the regexp
    *                          `\d+(\-\d+)?\.fxsnapshot`.
    */
   [Throws]
-  DOMString saveHeapSnapshot(optional HeapSnapshotBoundaries boundaries);
+  DOMString saveHeapSnapshot(optional HeapSnapshotBoundaries boundaries = {});
 
   /**
    * This is the same as saveHeapSnapshot, but with a different return value.
    *
    * @returns                 The snapshot ID of the file. This is the file name
    *                          without the temp directory or the trailing
    *                          `.fxsnapshot`.
    */
   [Throws]
-  DOMString saveHeapSnapshotGetId(optional HeapSnapshotBoundaries boundaries);
+  DOMString saveHeapSnapshotGetId(optional HeapSnapshotBoundaries boundaries = {});
 
   /**
    * Deserialize a core dump into a HeapSnapshot.
    *
    * @param filePath          The file path to read the heap snapshot from.
    */
   [Throws, NewObject]
   HeapSnapshot readHeapSnapshot(DOMString filePath);
@@ -163,28 +163,28 @@ namespace ChromeUtils {
 [Exposed=Window]
 partial namespace ChromeUtils {
   /**
    * A helper that converts OriginAttributesDictionary to a opaque suffix string.
    *
    * @param originAttrs       The originAttributes from the caller.
    */
   ByteString
-  originAttributesToSuffix(optional OriginAttributesDictionary originAttrs);
+  originAttributesToSuffix(optional OriginAttributesDictionary originAttrs = {});
 
   /**
    * Returns true if the members of |originAttrs| match the provided members
    * of |pattern|.
    *
    * @param originAttrs       The originAttributes under consideration.
    * @param pattern           The pattern to use for matching.
    */
   boolean
-  originAttributesMatchPattern(optional OriginAttributesDictionary originAttrs,
-                               optional OriginAttributesPatternDictionary pattern);
+  originAttributesMatchPattern(optional OriginAttributesDictionary originAttrs = {},
+                               optional OriginAttributesPatternDictionary pattern = {});
 
   /**
    * Returns an OriginAttributesDictionary with values from the |origin| suffix
    * and unspecified attributes added and assigned default values.
    *
    * @param origin            The origin URI to create from.
    * @returns                 An OriginAttributesDictionary with values from
    *                          the origin suffix and unspecified attributes
@@ -199,33 +199,33 @@ partial namespace ChromeUtils {
    * unspecified attributes added and assigned default values.
    *
    * @param originAttrs       The origin attributes to copy.
    * @returns                 An OriginAttributesDictionary copy of |originAttrs|
    *                          with unspecified attributes added and assigned
    *                          default values.
    */
   OriginAttributesDictionary
-  fillNonDefaultOriginAttributes(optional OriginAttributesDictionary originAttrs);
+  fillNonDefaultOriginAttributes(optional OriginAttributesDictionary originAttrs = {});
 
   /**
    * Returns true if the 2 OriginAttributes are equal.
    */
   boolean
-  isOriginAttributesEqual(optional OriginAttributesDictionary aA,
-                          optional OriginAttributesDictionary aB);
+  isOriginAttributesEqual(optional OriginAttributesDictionary aA = {},
+                          optional OriginAttributesDictionary aB = {});
 
   /**
    * Loads and compiles the script at the given URL and returns an object
    * which may be used to execute it repeatedly, in different globals, without
    * re-parsing.
    */
   [NewObject]
   Promise<PrecompiledScript>
-  compileScript(DOMString url, optional CompileScriptOptionsDictionary options);
+  compileScript(DOMString url, optional CompileScriptOptionsDictionary options = {});
 
   /**
    * Returns an optimized QueryInterface method which, when called from
    * JavaScript, acts as an ordinary QueryInterface function call, and when
    * called from XPConnect, circumvents JSAPI entirely.
    *
    * The list of interfaces may include a mix of JS ID objects and interface
    * name strings.
@@ -270,17 +270,17 @@ partial namespace ChromeUtils {
 
   /**
    * Dispatches the given callback to the main thread when it would be
    * otherwise idle. Similar to Window.requestIdleCallback, but not bound to a
    * particular DOM windw.
    */
   [Throws]
   void idleDispatch(IdleRequestCallback callback,
-                    optional IdleRequestOptions options);
+                    optional IdleRequestOptions options = {});
 
   /**
    * Synchronously loads and evaluates the js file located at
    * 'aResourceURI' with a new, fully privileged global object.
    *
    * If `aTargetObj` is specified, and non-null, all properties exported by
    * the module are copied to that object.
    *
@@ -414,17 +414,17 @@ partial namespace ChromeUtils {
 
   /**
    * Register a new toplevel window global actor. This method may only be
    * called in the parent process. |name| must be globally unique.
    *
    * See JSWindowActor.webidl for WindowActorOptions fields documentation.
    */
   [ChromeOnly, Throws]
-  void registerWindowActor(DOMString aName, optional WindowActorOptions aOptions);
+  void registerWindowActor(DOMString aName, optional WindowActorOptions aOptions = {});
 
   [ChromeOnly]
   void unregisterWindowActor(DOMString aName);
 
   [ChromeOnly]
   // aError should a nsresult.
   boolean isClassifierBlockingErrorCode(unsigned long aError);
 };
--- a/dom/chrome-webidl/InspectorUtils.webidl
+++ b/dom/chrome-webidl/InspectorUtils.webidl
@@ -26,17 +26,17 @@ namespace InspectorUtils {
   [Throws] unsigned long long getSpecificity(CSSStyleRule rule,
                                              unsigned long selectorIndex);
   [Throws] boolean selectorMatchesElement(
       Element element,
       CSSStyleRule rule,
       unsigned long selectorIndex,
       optional [TreatNullAs=EmptyString] DOMString pseudo = "");
   boolean isInheritedProperty(DOMString property);
-  sequence<DOMString> getCSSPropertyNames(optional PropertyNamesOptions options);
+  sequence<DOMString> getCSSPropertyNames(optional PropertyNamesOptions options = {});
   sequence<PropertyPref> getCSSPropertyPrefs();
   [Throws] sequence<DOMString> getCSSValuesForProperty(DOMString property);
   [Throws] DOMString rgbToColorName(octet r, octet g, octet b);
   InspectorRGBATuple? colorToRGBA(DOMString colorString);
   boolean isValidCSSColor(DOMString colorString);
   [Throws] sequence<DOMString> getSubpropertiesForCSSProperty(DOMString property);
   [Throws] boolean cssPropertyIsShorthand(DOMString property);
 
--- a/dom/chrome-webidl/JSWindowActor.webidl
+++ b/dom/chrome-webidl/JSWindowActor.webidl
@@ -123,18 +123,18 @@ dictionary WindowActorOptions {
   /**
    * Optional list of regular expressions for remoteTypes which are
    * allowed to instantiate this actor. If not passed, all content
    * processes are allowed to instantiate the actor.
    */
   sequence<DOMString> remoteTypes;
 
   /** This fields are used for configuring individual sides of the actor. */
-  WindowActorSidedOptions parent = null;
-  WindowActorChildOptions child = null;
+  WindowActorSidedOptions parent = {};
+  WindowActorChildOptions child = {};
 };
 
 dictionary WindowActorSidedOptions {
   /**
    * The JSM path which should be loaded for the actor on this side.
    * If not passed, the specified side cannot receive messages, but may send
    * them using `sendAsyncMessage` or `sendQuery`.
    */
@@ -156,9 +156,9 @@ dictionary WindowActorChildOptions : Win
   * topic in the list.
   *
   * Observer notifications in the list use nsGlobalWindowInner object as their
   * subject, and the events will only be dispatched to the corresponding window
   * actor. If additional observer notification's subjects are needed, please
   * file a bug for that.
   **/
   sequence<ByteString> observers;
-};
\ No newline at end of file
+};
--- a/dom/chrome-webidl/L10nOverlays.webidl
+++ b/dom/chrome-webidl/L10nOverlays.webidl
@@ -12,10 +12,10 @@ dictionary L10nOverlaysError {
 
 [ChromeOnly]
 namespace L10nOverlays {
   const unsigned short ERROR_FORBIDDEN_TYPE = 1;
   const unsigned short ERROR_NAMED_ELEMENT_MISSING = 2;
   const unsigned short ERROR_NAMED_ELEMENT_TYPE_MISMATCH = 3;
   const unsigned short ERROR_UNKNOWN = 4;
 
-  sequence<L10nOverlaysError>? translateElement(Element element, optional L10nMessage translation);
-};
\ No newline at end of file
+  sequence<L10nOverlaysError>? translateElement(Element element, optional L10nMessage translation = {});
+};
--- a/dom/chrome-webidl/MatchPattern.webidl
+++ b/dom/chrome-webidl/MatchPattern.webidl
@@ -24,17 +24,17 @@ interface URI;
  *      match a specific host, the wildcard character "*", to match any host,
  *      or a subdomain pattern, with "*." followed by a domain name, to match
  *      that domain name or any subdomain thereof.
  *    - <path>
  *      A glob pattern for paths to match. A "*" may appear anywhere within
  *      the path, and will match any string of characters. If no "*" appears,
  *      the URL path must exactly match the pattern path.
  */
-[Constructor(DOMString pattern, optional MatchPatternOptions options),
+[Constructor(DOMString pattern, optional MatchPatternOptions options = {}),
  ChromeOnly, Exposed=Window]
 interface MatchPattern {
   /**
    * Returns true if the given URI matches the pattern.
    *
    * If explicit is true, only explicit domain matches, without wildcards, are
    * considered.
    */
@@ -74,17 +74,17 @@ interface MatchPattern {
   [Constant]
   readonly attribute DOMString pattern;
 };
 
 /**
  * A set of MatchPattern objects, which implements the MatchPattern API and
  * matches when any of its sub-patterns matches.
  */
-[Constructor(sequence<(DOMString or MatchPattern)> patterns, optional MatchPatternOptions options),
+[Constructor(sequence<(DOMString or MatchPattern)> patterns, optional MatchPatternOptions options = {}),
  ChromeOnly, Exposed=Window]
 interface MatchPatternSet {
   /**
    * Returns true if the given URI matches any sub-pattern.
    *
    * If explicit is true, only explicit domain matches, without wildcards, are
    * considered.
    */
--- a/dom/chrome-webidl/MessageManager.webidl
+++ b/dom/chrome-webidl/MessageManager.webidl
@@ -212,17 +212,17 @@ callback interface MessageListener
    * When the listener is called, 'this' value is the target of the message.
    *
    * If the message is synchronous, the possible return value is
    * returned as JSON (will be changed to use structured clones).
    * When there are multiple listeners to sync messages, each
    * listener's return value is sent back as an array.  |undefined|
    * return values show up as undefined values in the array.
    */
-  any receiveMessage(optional ReceiveMessageArgument argument);
+  any receiveMessage(ReceiveMessageArgument argument);
 };
 
 [ChromeOnly]
 interface MessageListenerManager
 {
   /**
    * Register |listener| to receive |messageName|.  All listener
    * callbacks for a particular message are invoked when that message
--- a/dom/chrome-webidl/SessionStoreUtils.webidl
+++ b/dom/chrome-webidl/SessionStoreUtils.webidl
@@ -80,17 +80,17 @@ namespace SessionStoreUtils {
   CollectedData? collectScrollPosition(WindowProxy window);
 
   /**
    * Restores scroll position data for any given |frame| in the frame hierarchy.
    *
    * @param frame (DOMWindow)
    * @param value (object, see collectScrollPosition())
    */
-  void restoreScrollPosition(Window frame, optional CollectedData data);
+  void restoreScrollPosition(Window frame, optional CollectedData data = {});
 
   /**
    * Collect form data for a given |frame| *not* including any subframes.
    *
    * The returned object may have an "id", "xpath", or "innerHTML" key or a
    * combination of those three. Form data stored under "id" is for input
    * fields with id attributes. Data stored under "xpath" is used for input
    * fields that don't have a unique id and need to be queried using XPath.
@@ -105,17 +105,17 @@ namespace SessionStoreUtils {
    *     }
    *   }
    *
    * @return object
    *         Returns null when there is no scroll data
    */
   CollectedData? collectFormData(WindowProxy window);
 
-  boolean restoreFormData(Document document, optional CollectedData data);
+  boolean restoreFormData(Document document, optional CollectedData data = {});
 
   /**
    * Updates all sessionStorage "super cookies"
    * @param content
    *        A tab's global, i.e. the root frame we want to collect for.
    * @return Returns a nested object that will have hosts as keys and per-origin
    *         session storage data as strings. For example:
    *         {"https://example.com^userContextId=1": {"key": "value", "my_number": "123"}}
--- a/dom/chrome-webidl/TelemetryStopwatch.webidl
+++ b/dom/chrome-webidl/TelemetryStopwatch.webidl
@@ -25,17 +25,17 @@ namespace TelemetryStopwatch {
    *        false.
    *
    * @returns True if the timer was successfully started, false
    *          otherwise. If a timer already exists, it can't be
    *          started again, and the existing one will be cleared in
    *          order to avoid measurements errors.
    */
   boolean start(HistogramID histogram, optional object? obj = null,
-                optional TelemetryStopwatchOptions options);
+                optional TelemetryStopwatchOptions options = {});
 
   /**
    * Returns whether a timer associated with a telemetry histogram is currently
    * running. The timer can be directly associated with a histogram, or with a
    * pair of a histogram and an object.
    *
    * @param histogram - a string which must be a valid histogram name.
    *
@@ -135,17 +135,17 @@ namespace TelemetryStopwatch {
    *
    * @returns True if the timer was successfully started, false
    *          otherwise. If a timer already exists, it can't be
    *          started again, and the existing one will be cleared in
    *          order to avoid measurements errors.
    */
   boolean startKeyed(HistogramID histogram, HistogramKey key,
                      optional object? obj = null,
-                     optional TelemetryStopwatchOptions options);
+                     optional TelemetryStopwatchOptions options = {});
 
   /**
    * Returns whether a timer associated with a telemetry histogram is currently
    * running. Similarly to @see{TelemetryStopwatch.running} the timer and its
    * key can be associated with an object. Each key may have multiple associated
    * objects and each object can be associated with multiple keys.
    *
    * @param histogram - a string which must be a valid histogram name.
--- a/dom/webidl/AddonManager.webidl
+++ b/dom/webidl/AddonManager.webidl
@@ -71,17 +71,17 @@ interface AddonManager : EventTarget {
 
   /**
    * Creates an AddonInstall object for a given URL.
    *
    * @param options
    *        Only one supported option: 'url', the URL of the addon to install.
    * @return A promise that resolves to an instance of AddonInstall.
    */
-  Promise<AddonInstall> createInstall(optional addonInstallOptions options);
+  Promise<AddonInstall> createInstall(optional addonInstallOptions options = {});
 
   // Indicator to content whether permissions prompts are enabled
   readonly attribute boolean permissionPromptsEnabled;
 };
 
 [ChromeOnly,Exposed=Window,HeaderFile="mozilla/AddonManagerWebAPI.h"]
 namespace AddonManagerPermissions {
   boolean isHostPermitted(DOMString host);
--- a/dom/webidl/AnalyserNode.webidl
+++ b/dom/webidl/AnalyserNode.webidl
@@ -13,17 +13,17 @@
 dictionary AnalyserOptions : AudioNodeOptions {
              unsigned long fftSize = 2048;
              double        maxDecibels = -30;
              double        minDecibels = -100;
              double        smoothingTimeConstant = 0.8;
 };
 
 [Pref="dom.webaudio.enabled",
- Constructor(BaseAudioContext context, optional AnalyserOptions options)]
+ Constructor(BaseAudioContext context, optional AnalyserOptions options = {})]
 interface AnalyserNode : AudioNode {
 
     // Real-time frequency-domain data
     void getFloatFrequencyData(Float32Array array);
     void getByteFrequencyData(Uint8Array array);
 
     // Real-time waveform data
     void getFloatTimeDomainData(Float32Array array);
--- a/dom/webidl/Animatable.webidl
+++ b/dom/webidl/Animatable.webidl
@@ -17,12 +17,12 @@ dictionary KeyframeAnimationOptions : Ke
 dictionary GetAnimationsOptions {
   boolean subtree = false;
 };
 
 [NoInterfaceObject]
 interface Animatable {
   [Throws]
   Animation animate(object? keyframes,
-                    optional UnrestrictedDoubleOrKeyframeAnimationOptions options);
+                    optional UnrestrictedDoubleOrKeyframeAnimationOptions options = {});
   [Func="Document::IsWebAnimationsGetAnimationsEnabled"]
-  sequence<Animation> getAnimations(optional GetAnimationsOptions options);
+  sequence<Animation> getAnimations(optional GetAnimationsOptions options = {});
 };
--- a/dom/webidl/AnimationEffect.webidl
+++ b/dom/webidl/AnimationEffect.webidl
@@ -56,10 +56,10 @@ dictionary ComputedEffectTiming : Effect
 };
 
 [Func="Document::IsWebAnimationsEnabled"]
 interface AnimationEffect {
   EffectTiming getTiming();
   [BinaryName="getComputedTimingAsDict"]
   ComputedEffectTiming getComputedTiming();
   [Throws]
-  void updateTiming(optional OptionalEffectTiming timing);
+  void updateTiming(optional OptionalEffectTiming timing = {});
 };
--- a/dom/webidl/AnimationEvent.webidl
+++ b/dom/webidl/AnimationEvent.webidl
@@ -6,17 +6,17 @@
  * The origin of this IDL file is
  * http://www.w3.org/TR/css3-animations/#animation-events-
  * http://dev.w3.org/csswg/css3-animations/#animation-events-
  *
  * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
  * liability, trademark and document use rules apply.
  */
 
-[Constructor(DOMString type, optional AnimationEventInit eventInitDict)]
+[Constructor(DOMString type, optional AnimationEventInit eventInitDict = {})]
 interface AnimationEvent : Event {
   readonly attribute DOMString animationName;
   readonly attribute float     elapsedTime;
   readonly attribute DOMString pseudoElement;
 };
 
 dictionary AnimationEventInit : EventInit {
   DOMString animationName = "";
--- a/dom/webidl/AnimationPlaybackEvent.webidl
+++ b/dom/webidl/AnimationPlaybackEvent.webidl
@@ -7,17 +7,17 @@
  * https://drafts.csswg.org/web-animations/#animationplaybackevent
  *
  * Copyright © 2015 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
  * liability, trademark and document use rules apply.
  */
 
 [Func="Document::IsWebAnimationsEnabled",
  Constructor(DOMString type,
-             optional AnimationPlaybackEventInit eventInitDict)]
+             optional AnimationPlaybackEventInit eventInitDict = {})]
 interface AnimationPlaybackEvent : Event {
   readonly attribute double? currentTime;
   readonly attribute double? timelineTime;
 };
 
 dictionary AnimationPlaybackEventInit : EventInit {
   double? currentTime = null;
   double? timelineTime = null;
--- a/dom/webidl/AnonymousContent.webidl
+++ b/dom/webidl/AnonymousContent.webidl
@@ -61,17 +61,17 @@ interface AnonymousContent {
   [Throws]
   nsISupports? getCanvasContext(DOMString elementId,
                                 DOMString contextId);
 
   [Throws]
   Animation setAnimationForElement(DOMString elementId,
                                    object? keyframes,
                                    optional UnrestrictedDoubleOrKeyframeAnimationOptions
-                                     options);
+                                     options = {});
 
   /**
    * Accepts a list of (possibly overlapping) DOMRects which describe a shape
    * in CSS pixels relative to the element's border box. This shape will be
    * excluded from the element's background color rendering. The element will
    * not render any background images once this method has been called.
    */
   [Throws]
--- a/dom/webidl/AppNotificationServiceOptions.webidl
+++ b/dom/webidl/AppNotificationServiceOptions.webidl
@@ -10,10 +10,10 @@ dictionary AppNotificationServiceOptions
   boolean textClickable = false;
   DOMString manifestURL = "";
   DOMString id = "";
   DOMString dbId = "";
   DOMString dir = "";
   DOMString lang = "";
   DOMString tag = "";
   DOMString data = "";
-  NotificationBehavior mozbehavior = null;
+  NotificationBehavior mozbehavior = {};
 };
--- a/dom/webidl/AudioBufferSourceNode.webidl
+++ b/dom/webidl/AudioBufferSourceNode.webidl
@@ -15,17 +15,17 @@ dictionary AudioBufferSourceOptions {
              float        detune = 0;
              boolean      loop = false;
              double       loopEnd = 0;
              double       loopStart = 0;
              float        playbackRate = 1;
 };
 
 [Pref="dom.webaudio.enabled",
- Constructor(BaseAudioContext context, optional AudioBufferSourceOptions options)]
+ Constructor(BaseAudioContext context, optional AudioBufferSourceOptions options = {})]
 interface AudioBufferSourceNode : AudioScheduledSourceNode {
 
     attribute AudioBuffer? buffer;
 
     readonly attribute AudioParam playbackRate;
     readonly attribute AudioParam detune;
 
     attribute boolean loop;
--- a/dom/webidl/AudioContext.webidl
+++ b/dom/webidl/AudioContext.webidl
@@ -10,17 +10,17 @@
  * liability, trademark and document use rules apply.
  */
 
 dictionary AudioContextOptions {
              float        sampleRate = 0;
 };
 
 [Pref="dom.webaudio.enabled",
- Constructor(optional AudioContextOptions contextOptions)]
+ Constructor(optional AudioContextOptions contextOptions = {})]
 interface AudioContext : BaseAudioContext {
 
     // Bug 1324545: readonly        attribute double outputLatency;
     // Bug 1324545: AudioTimestamp                  getOutputTimestamp ();
 
     [Throws]
     Promise<void> suspend();
     [Throws]
--- a/dom/webidl/AudioWorkletNode.webidl
+++ b/dom/webidl/AudioWorkletNode.webidl
@@ -14,16 +14,16 @@ dictionary AudioWorkletNodeOptions : Aud
              unsigned long             numberOfInputs = 1;
              unsigned long             numberOfOutputs = 1;
              sequence<unsigned long>   outputChannelCount;
              record<DOMString, double> parameterData;
              object?                   processorOptions = null;
 };
 
 [SecureContext, Pref="dom.audioworklet.enabled",
- Constructor (BaseAudioContext context, DOMString name, optional AudioWorkletNodeOptions options)]
+ Constructor (BaseAudioContext context, DOMString name, optional AudioWorkletNodeOptions options = {})]
 interface AudioWorkletNode : AudioNode {
     [Throws]
     readonly        attribute AudioParamMap              parameters;
     [Throws]
     readonly        attribute MessagePort                port;
                     attribute EventHandler               onprocessorerror;
 };
--- a/dom/webidl/AudioWorkletProcessor.webidl
+++ b/dom/webidl/AudioWorkletProcessor.webidl
@@ -6,13 +6,13 @@
  * The origin of this IDL file is
  * https://webaudio.github.io/web-audio-api/#audioworkletprocessor
  *
  * Copyright © 2018 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
  * liability, trademark and document use rules apply.
  */
 
 [Exposed=AudioWorklet,
- Constructor (optional AudioWorkletNodeOptions options)]
+ Constructor (optional AudioWorkletNodeOptions options = {})]
 interface AudioWorkletProcessor {
     [Throws]
     readonly attribute MessagePort port;
 };
--- a/dom/webidl/BaseAudioContext.webidl
+++ b/dom/webidl/BaseAudioContext.webidl
@@ -93,10 +93,10 @@ interface BaseAudioContext : EventTarget
     DynamicsCompressorNode createDynamicsCompressor();
 
     [NewObject, Throws]
     OscillatorNode createOscillator();
 
     [NewObject, Throws]
     PeriodicWave createPeriodicWave(Float32Array real,
                                     Float32Array imag,
-                                    optional PeriodicWaveConstraints constraints);
+                                    optional PeriodicWaveConstraints constraints = {});
 };
--- a/dom/webidl/BiquadFilterNode.webidl
+++ b/dom/webidl/BiquadFilterNode.webidl
@@ -25,17 +25,17 @@ dictionary BiquadFilterOptions : AudioNo
              BiquadFilterType type = "lowpass";
              float            Q = 1;
              float            detune = 0;
              float            frequency = 350;
              float            gain = 0;
 };
 
 [Pref="dom.webaudio.enabled",
- Constructor(BaseAudioContext context, optional BiquadFilterOptions options)]
+ Constructor(BaseAudioContext context, optional BiquadFilterOptions options = {})]
 interface BiquadFilterNode : AudioNode {
 
     attribute BiquadFilterType type;
     readonly attribute AudioParam frequency; // in Hertz
     readonly attribute AudioParam detune; // in Cents
     readonly attribute AudioParam Q; // Quality factor
     readonly attribute AudioParam gain; // in Decibels
 
--- a/dom/webidl/Blob.webidl
+++ b/dom/webidl/Blob.webidl
@@ -8,17 +8,17 @@
  *
  * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
  * liability, trademark and document use rules apply.
  */
 
 typedef (BufferSource or Blob or USVString) BlobPart;
 
 [Constructor(optional sequence<BlobPart> blobParts,
-             optional BlobPropertyBag options),
+             optional BlobPropertyBag options = {}),
  Exposed=(Window,Worker)]
 interface Blob {
 
   [GetterThrows]
   readonly attribute unsigned long long size;
 
   readonly attribute DOMString type;
 
--- a/dom/webidl/BlobEvent.webidl
+++ b/dom/webidl/BlobEvent.webidl
@@ -1,15 +1,15 @@
 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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/.
  */
 
-[Constructor(DOMString type, optional BlobEventInit eventInitDict)]
+[Constructor(DOMString type, optional BlobEventInit eventInitDict = {})]
 interface BlobEvent : Event
 {
   readonly attribute Blob? data;
 };
 
 dictionary BlobEventInit : EventInit
 {
   Blob? data = null;
--- a/dom/webidl/CSPReport.webidl
+++ b/dom/webidl/CSPReport.webidl
@@ -17,10 +17,10 @@ dictionary CSPReportProperties {
   DOMString script-sample;
   long line-number;
   long column-number;
 };
 
 dictionary CSPReport {
   // We always want to have a "csp-report" property, so just pre-initialize it
   // to an empty dictionary..
-  CSPReportProperties csp-report = null;
+  CSPReportProperties csp-report = {};
 };
--- a/dom/webidl/Cache.webidl
+++ b/dom/webidl/Cache.webidl
@@ -9,29 +9,29 @@
  */
 
 // https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html#cache
 
 [Exposed=(Window,Worker),
  Pref="dom.caches.enabled"]
 interface Cache {
   [NewObject]
-  Promise<Response> match(RequestInfo request, optional CacheQueryOptions options);
+  Promise<Response> match(RequestInfo request, optional CacheQueryOptions options = {});
   [NewObject]
-  Promise<sequence<Response>> matchAll(optional RequestInfo request, optional CacheQueryOptions options);
+  Promise<sequence<Response>> matchAll(optional RequestInfo request, optional CacheQueryOptions options = {});
   [NewObject, NeedsCallerType]
   Promise<void> add(RequestInfo request);
   [NewObject, NeedsCallerType]
   Promise<void> addAll(sequence<RequestInfo> requests);
   [NewObject]
   Promise<void> put(RequestInfo request, Response response);
   [NewObject]
-  Promise<boolean> delete(RequestInfo request, optional CacheQueryOptions options);
+  Promise<boolean> delete(RequestInfo request, optional CacheQueryOptions options = {});
   [NewObject]
-  Promise<sequence<Request>> keys(optional RequestInfo request, optional CacheQueryOptions options);
+  Promise<sequence<Request>> keys(optional RequestInfo request, optional CacheQueryOptions options = {});
 };
 
 dictionary CacheQueryOptions {
   boolean ignoreSearch = false;
   boolean ignoreMethod = false;
   boolean ignoreVary = false;
   DOMString cacheName;
 };
--- a/dom/webidl/CacheStorage.webidl
+++ b/dom/webidl/CacheStorage.webidl
@@ -12,17 +12,17 @@
 
 interface Principal;
 
 [Exposed=(Window,Worker),
  ChromeConstructor(CacheStorageNamespace namespace, Principal principal),
  Pref="dom.caches.enabled"]
 interface CacheStorage {
   [NewObject]
-  Promise<Response> match(RequestInfo request, optional CacheQueryOptions options);
+  Promise<Response> match(RequestInfo request, optional CacheQueryOptions options = {});
   [NewObject]
   Promise<boolean> has(DOMString cacheName);
   [NewObject]
   Promise<Cache> open(DOMString cacheName);
   [NewObject]
   Promise<boolean> delete(DOMString cacheName);
   [NewObject]
   Promise<sequence<DOMString>> keys();
--- a/dom/webidl/CanvasRenderingContext2D.webidl
+++ b/dom/webidl/CanvasRenderingContext2D.webidl
@@ -335,17 +335,17 @@ interface CanvasPathMethods {
 
   [Throws, LenientFloat]
   void ellipse(double x, double y, double radiusX, double radiusY, double rotation, double startAngle, double endAngle, optional boolean anticlockwise = false);
 };
 
 [NoInterfaceObject]
 interface CanvasHitRegions {
   // hit regions
-  [Pref="canvas.hitregions.enabled", Throws] void addHitRegion(optional HitRegionOptions options);
+  [Pref="canvas.hitregions.enabled", Throws] void addHitRegion(optional HitRegionOptions options = {});
   [Pref="canvas.hitregions.enabled"] void removeHitRegion(DOMString id);
   [Pref="canvas.hitregions.enabled"] void clearHitRegions();
 };
 
 interface CanvasGradient {
   // opaque object
   [Throws]
   // addColorStop should take a double
--- a/dom/webidl/CaretStateChangedEvent.webidl
+++ b/dom/webidl/CaretStateChangedEvent.webidl
@@ -20,17 +20,17 @@ dictionary CaretStateChangedEventInit : 
   CaretChangedReason reason = "visibilitychange";
   boolean caretVisible = false;
   boolean caretVisuallyVisible = false;
   boolean selectionVisible = false;
   boolean selectionEditable = false;
   DOMString selectedTextContent = "";
 };
 
-[Constructor(DOMString type, optional CaretStateChangedEventInit eventInit),
+[Constructor(DOMString type, optional CaretStateChangedEventInit eventInit = {}),
  ChromeOnly]
 interface CaretStateChangedEvent : Event {
   readonly attribute boolean collapsed;
   /* The bounding client rect is relative to the visual viewport. */
   readonly attribute DOMRectReadOnly? boundingClientRect;
   readonly attribute CaretChangedReason reason;
   readonly attribute boolean caretVisible;
   readonly attribute boolean caretVisuallyVisible;
--- a/dom/webidl/ChannelMergerNode.webidl
+++ b/dom/webidl/ChannelMergerNode.webidl
@@ -10,11 +10,11 @@
  * liability, trademark and document use rules apply.
  */
 
 dictionary ChannelMergerOptions : AudioNodeOptions {
              unsigned long numberOfInputs = 6;
 };
 
 [Pref="dom.webaudio.enabled",
- Constructor(BaseAudioContext context, optional ChannelMergerOptions options)]
+ Constructor(BaseAudioContext context, optional ChannelMergerOptions options = {})]
 interface ChannelMergerNode : AudioNode {
 };
--- a/dom/webidl/ChannelSplitterNode.webidl
+++ b/dom/webidl/ChannelSplitterNode.webidl
@@ -10,13 +10,13 @@
  * liability, trademark and document use rules apply.
  */
 
 dictionary ChannelSplitterOptions : AudioNodeOptions {
              unsigned long numberOfOutputs = 6;
 };
 
 [Pref="dom.webaudio.enabled",
- Constructor(BaseAudioContext context, optional ChannelSplitterOptions options)]
+ Constructor(BaseAudioContext context, optional ChannelSplitterOptions options = {})]
 interface ChannelSplitterNode : AudioNode {
 
 };
 
--- a/dom/webidl/Client.webidl
+++ b/dom/webidl/Client.webidl
@@ -20,17 +20,17 @@ interface Client {
   readonly attribute DOMString id;
 
   // Implement reserved in bug 1264177
   // readonly attribute boolean reserved;
 
   [Throws]
   void postMessage(any message, sequence<object> transfer);
   [Throws]
-  void postMessage(any message, optional PostMessageOptions aOptions);
+  void postMessage(any message, optional PostMessageOptions aOptions = {});
 };
 
 [Exposed=ServiceWorker]
 interface WindowClient : Client {
   [BinaryName="GetVisibilityState"]
   readonly attribute VisibilityState visibilityState;
   readonly attribute boolean focused;
 
--- a/dom/webidl/Clients.webidl
+++ b/dom/webidl/Clients.webidl
@@ -9,17 +9,17 @@
  */
 
 [Exposed=ServiceWorker]
 interface Clients {
   // The objects returned will be new instances every time
   [NewObject]
   Promise<any> get(DOMString id);
   [NewObject]
-  Promise<sequence<Client>> matchAll(optional ClientQueryOptions options);
+  Promise<sequence<Client>> matchAll(optional ClientQueryOptions options = {});
   [NewObject]
   Promise<WindowClient?> openWindow(USVString url);
   [NewObject]
   Promise<void> claim();
 };
 
 dictionary ClientQueryOptions {
   boolean includeUncontrolled = false;
--- a/dom/webidl/ClipboardEvent.webidl
+++ b/dom/webidl/ClipboardEvent.webidl
@@ -5,17 +5,17 @@
  *
  * For more information on this interface please see
  * http://dev.w3.org/2006/webapi/clipops/#x5-clipboard-event-interfaces
  *
  * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
  * liability, trademark and document use rules apply.
  */
 
-[Constructor(DOMString type, optional ClipboardEventInit eventInitDict)]
+[Constructor(DOMString type, optional ClipboardEventInit eventInitDict = {})]
 interface ClipboardEvent : Event
 {
   readonly attribute DataTransfer? clipboardData;
 };
 
 dictionary ClipboardEventInit : EventInit
 {
   DOMString data = "";
--- a/dom/webidl/CloseEvent.webidl
+++ b/dom/webidl/CloseEvent.webidl
@@ -5,17 +5,17 @@
  *
  * The nsIDOMCloseEvent interface is the interface to the event
  * close on a WebSocket object.
  *
  * For more information on this interface, please see
  * http://www.whatwg.org/specs/web-apps/current-work/multipage/network.html#closeevent
  */
 
-[Constructor(DOMString type, optional CloseEventInit eventInitDict),LegacyEventInit,
+[Constructor(DOMString type, optional CloseEventInit eventInitDict = {}),LegacyEventInit,
  Exposed=(Window,Worker)]
 interface CloseEvent : Event
 {
   readonly attribute boolean wasClean;
   readonly attribute unsigned short code;
   readonly attribute DOMString reason;
 };
 
--- a/dom/webidl/CompositionEvent.webidl
+++ b/dom/webidl/CompositionEvent.webidl
@@ -4,17 +4,17 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/.
  *
  * https://w3c.github.io/uievents/#interface-compositionevent
  *
  * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
  * liability, trademark and document use rules apply.
  */
 
-[Constructor(DOMString type, optional CompositionEventInit eventInitDict)]
+[Constructor(DOMString type, optional CompositionEventInit eventInitDict = {})]
 interface CompositionEvent : UIEvent
 {
   readonly attribute DOMString? data;
   // locale is currently non-standard
   readonly attribute DOMString  locale;
 
  /**
   * ranges is trying to expose TextRangeArray in Gecko so a
--- a/dom/webidl/Console.webidl
+++ b/dom/webidl/Console.webidl
@@ -71,17 +71,17 @@ namespace console {
   void profile(any... data);
   [UseCounter]
   void profileEnd(any... data);
 
   [ChromeOnly]
   const boolean IS_NATIVE_CONSOLE = true;
 
   [ChromeOnly, NewObject]
-  ConsoleInstance createInstance(optional ConsoleInstanceOptions options);
+  ConsoleInstance createInstance(optional ConsoleInstanceOptions options = {});
 };
 
 // This is used to propagate console events to the observers.
 dictionary ConsoleEvent {
   (unsigned long long or DOMString) ID;
   (unsigned long long or DOMString) innerID;
   DOMString consoleID = "";
   DOMString addonId = "";
--- a/dom/webidl/ConstantSourceNode.webidl
+++ b/dom/webidl/ConstantSourceNode.webidl
@@ -10,12 +10,12 @@
  * liability, trademark and document use rules apply.
  */
 
 dictionary ConstantSourceOptions {
     float offset = 1;
 };
 
 [Pref="dom.webaudio.enabled",
- Constructor(BaseAudioContext context, optional ConstantSourceOptions options)]
+ Constructor(BaseAudioContext context, optional ConstantSourceOptions options = {})]
 interface ConstantSourceNode :  AudioScheduledSourceNode {
     readonly        attribute AudioParam   offset;
 };
--- a/dom/webidl/ConvolverNode.webidl
+++ b/dom/webidl/ConvolverNode.webidl
@@ -11,17 +11,17 @@
  */
 
 dictionary ConvolverOptions : AudioNodeOptions {
              AudioBuffer? buffer;
              boolean      disableNormalization = false;
 };
 
 [Pref="dom.webaudio.enabled",
- Constructor(BaseAudioContext context, optional ConvolverOptions options)]
+ Constructor(BaseAudioContext context, optional ConvolverOptions options = {})]
 interface ConvolverNode : AudioNode {
 
       [SetterThrows]
       attribute AudioBuffer? buffer;
       attribute boolean normalize;
 
 };
 
--- a/dom/webidl/CredentialManagement.webidl
+++ b/dom/webidl/CredentialManagement.webidl
@@ -11,28 +11,28 @@
 interface Credential {
   readonly attribute USVString id;
   readonly attribute DOMString type;
 };
 
 [Exposed=Window, SecureContext, Pref="security.webauth.webauthn"]
 interface CredentialsContainer {
   [Throws]
-  Promise<Credential?> get(optional CredentialRequestOptions options);
+  Promise<Credential?> get(optional CredentialRequestOptions options = {});
   [Throws]
-  Promise<Credential?> create(optional CredentialCreationOptions options);
+  Promise<Credential?> create(optional CredentialCreationOptions options = {});
   [Throws]
   Promise<Credential> store(Credential credential);
   [Throws]
   Promise<void> preventSilentAccess();
 };
 
 dictionary CredentialRequestOptions {
-  // FIXME: bug 1493860: should this "= null" be here?
-  PublicKeyCredentialRequestOptions publicKey = null;
+  // FIXME: bug 1493860: should this "= {}" be here?
+  PublicKeyCredentialRequestOptions publicKey = {};
   AbortSignal signal;
 };
 
 dictionary CredentialCreationOptions {
-  // FIXME: bug 1493860: should this "= null" be here?
-  PublicKeyCredentialCreationOptions publicKey = null;
+  // FIXME: bug 1493860: should this "= {}" be here?
+  PublicKeyCredentialCreationOptions publicKey = {};
   AbortSignal signal;
 };
--- a/dom/webidl/CustomElementRegistry.webidl
+++ b/dom/webidl/CustomElementRegistry.webidl
@@ -1,17 +1,17 @@
 /* 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/. */
 
 // https://html.spec.whatwg.org/#dom-window-customelements
 interface CustomElementRegistry {
   [CEReactions, Throws, UseCounter]
   void define(DOMString name, CustomElementConstructor functionConstructor,
-              optional ElementDefinitionOptions options);
+              optional ElementDefinitionOptions options = {});
   [ChromeOnly, Throws]
   void setElementCreationCallback(DOMString name, CustomElementCreationCallback callback);
   any get(DOMString name);
   [Throws]
   Promise<void> whenDefined(DOMString name);
   [CEReactions] void upgrade(Node root);
 };
 
--- a/dom/webidl/CustomEvent.webidl
+++ b/dom/webidl/CustomEvent.webidl
@@ -5,17 +5,17 @@
  *
  * The origin of this IDL file is
  * http://www.w3.org/TR/2012/WD-dom-20120105/
  *
  * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
  * liability, trademark and document use rules apply.
  */
 
-[Constructor(DOMString type, optional CustomEventInit eventInitDict),
+[Constructor(DOMString type, optional CustomEventInit eventInitDict = {}),
  Exposed=(Window, Worker)]
 interface CustomEvent : Event
 {
   readonly attribute any detail;
 
   // initCustomEvent is a Gecko specific deprecated method.
   void initCustomEvent(DOMString type,
                        optional boolean canBubble = false,
--- a/dom/webidl/DOMMatrix.webidl
+++ b/dom/webidl/DOMMatrix.webidl
@@ -10,17 +10,17 @@
  * liability, trademark and document use rules apply.
  */
 
 [Pref="layout.css.DOMMatrix.enabled",
  Constructor(optional (DOMString or sequence<unrestricted double>) init),
  Exposed=(Window,Worker),
  Serializable]
 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);
 
 
     // These attributes are simple aliases for certain elements of the 4x4 matrix
     readonly attribute unrestricted double a;
     readonly attribute unrestricted double b;
     readonly attribute unrestricted double c;
@@ -67,25 +67,25 @@ interface DOMMatrixReadOnly {
     [NewObject] DOMMatrix rotateFromVector(optional unrestricted double x = 0,
                                            optional unrestricted double y = 0);
     [NewObject] DOMMatrix rotateAxisAngle(optional unrestricted double x = 0,
                                           optional unrestricted double y = 0,
                                           optional unrestricted double z = 0,
                                           optional unrestricted double angle = 0);
     DOMMatrix skewX(optional unrestricted double sx = 0);
     DOMMatrix skewY(optional unrestricted double sy = 0);
-    [NewObject, Throws] DOMMatrix multiply(optional DOMMatrixInit other);
+    [NewObject, Throws] DOMMatrix multiply(optional DOMMatrixInit other = {});
     DOMMatrix flipX();
     DOMMatrix flipY();
     DOMMatrix inverse();
 
     // Helper methods
     readonly attribute boolean is2D;
     readonly attribute boolean isIdentity;
-    DOMPoint                   transformPoint(optional DOMPointInit point);
+    DOMPoint                   transformPoint(optional DOMPointInit point = {});
     [Throws] Float32Array      toFloat32Array();
     [Throws] Float64Array      toFloat64Array();
     [Exposed=Window]           stringifier;
     [Default] object           toJSON();
 };
 
 [Pref="layout.css.DOMMatrix.enabled",
  Constructor,
@@ -93,17 +93,17 @@ interface DOMMatrixReadOnly {
  Constructor(DOMMatrixReadOnly other),
  Constructor(Float32Array array32),
  Constructor(Float64Array array64),
  Constructor(sequence<unrestricted double> numberSequence),
  Exposed=(Window,Worker),
  Serializable,
  LegacyWindowAlias=WebKitCSSMatrix]
 interface DOMMatrix : DOMMatrixReadOnly {
-    [NewObject, Throws] static DOMMatrix fromMatrix(optional DOMMatrixInit other);
+    [NewObject, Throws] static DOMMatrix fromMatrix(optional DOMMatrixInit other = {});
     [NewObject, Throws] static DOMMatrixReadOnly fromFloat32Array(Float32Array array32);
     [NewObject, Throws] static DOMMatrixReadOnly fromFloat64Array(Float64Array array64);
 
 
     // These attributes are simple aliases for certain elements of the 4x4 matrix
     inherit attribute unrestricted double a;
     inherit attribute unrestricted double b;
     inherit attribute unrestricted double c;
@@ -124,18 +124,18 @@ interface DOMMatrix : DOMMatrixReadOnly 
     inherit attribute unrestricted double m33;
     inherit attribute unrestricted double m34;
     inherit attribute unrestricted double m41;
     inherit attribute unrestricted double m42;
     inherit attribute unrestricted double m43;
     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);
     DOMMatrix scaleSelf(optional unrestricted double scaleX = 1,
                         optional unrestricted double scaleY,
                         optional unrestricted double scaleZ = 1,
                         optional unrestricted double originX = 0,
                         optional unrestricted double originY = 0,
--- a/dom/webidl/DOMPoint.webidl
+++ b/dom/webidl/DOMPoint.webidl
@@ -11,33 +11,33 @@
  */
 
 [Pref="layout.css.DOMPoint.enabled",
  Constructor(optional unrestricted double x = 0, optional unrestricted double y = 0,
              optional unrestricted double z = 0, optional unrestricted double w = 1),
  Exposed=(Window,Worker),
  Serializable]
 interface DOMPointReadOnly {
-    [NewObject] static DOMPointReadOnly fromPoint(optional DOMPointInit other);
+    [NewObject] static DOMPointReadOnly fromPoint(optional DOMPointInit other = {});
 
     readonly attribute unrestricted double x;
     readonly attribute unrestricted double y;
     readonly attribute unrestricted double z;
     readonly attribute unrestricted double w; 
 
     [Default] object toJSON();
 };
 
 [Pref="layout.css.DOMPoint.enabled",
  Constructor(optional unrestricted double x = 0, optional unrestricted double y = 0,
              optional unrestricted double z = 0, optional unrestricted double w = 1),
  Exposed=(Window,Worker),
  Serializable]
 interface DOMPoint : DOMPointReadOnly {
-    [NewObject] static DOMPoint fromPoint(optional DOMPointInit other);
+    [NewObject] static DOMPoint fromPoint(optional DOMPointInit other = {});
 
     inherit attribute unrestricted double x;
     inherit attribute unrestricted double y;
     inherit attribute unrestricted double z;
     inherit attribute unrestricted double w;
 };
 
 dictionary DOMPointInit {
--- a/dom/webidl/DOMQuad.webidl
+++ b/dom/webidl/DOMQuad.webidl
@@ -6,32 +6,32 @@
  * The origin of this IDL file is
  * https://drafts.fxtf.org/geometry/
  *
  * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
  * liability, trademark and document use rules apply.
  */
 
 [Pref="layout.css.DOMQuad.enabled",
- 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 = {}),
  Constructor(DOMRectReadOnly rect),
  Exposed=(Window,Worker),
  Serializable]
 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;
     [SameObject] readonly attribute DOMPoint p3;
     [SameObject] readonly attribute DOMPoint p4;
     [NewObject] DOMRectReadOnly getBounds();
 
     [Default] object toJSON();
 };
 
 dictionary DOMQuadInit {
-    DOMPointInit p1 = null;
-    DOMPointInit p2 = null;
-    DOMPointInit p3 = null;
-    DOMPointInit p4 = null;
+    DOMPointInit p1 = {};
+    DOMPointInit p2 = {};
+    DOMPointInit p3 = {};
+    DOMPointInit p4 = {};
 };
--- a/dom/webidl/DOMRect.webidl
+++ b/dom/webidl/DOMRect.webidl
@@ -10,31 +10,31 @@
  * liability, trademark and document use rules apply.
  */
 
 [Constructor(optional unrestricted double x = 0, optional unrestricted double y = 0,
              optional unrestricted double width = 0, optional unrestricted double height = 0),
  Exposed=(Window,Worker),
  Serializable]
 interface DOMRect : DOMRectReadOnly {
-    [NewObject] static DOMRect fromRect(optional DOMRectInit other);
+    [NewObject] static DOMRect fromRect(optional DOMRectInit other = {});
 
     inherit attribute unrestricted double x;
     inherit attribute unrestricted double y;
     inherit attribute unrestricted double width;
     inherit attribute unrestricted double height;
 };
 
 [ProbablyShortLivingWrapper,
  Constructor(optional unrestricted double x = 0, optional unrestricted double y = 0,
              optional unrestricted double width = 0, optional unrestricted double height = 0),
  Exposed=(Window,Worker),
  Serializable]
 interface DOMRectReadOnly {
-    [NewObject] static DOMRectReadOnly fromRect(optional DOMRectInit other);
+    [NewObject] static DOMRectReadOnly fromRect(optional DOMRectInit other = {});
 
     readonly attribute unrestricted double x;
     readonly attribute unrestricted double y;
     readonly attribute unrestricted double width;
     readonly attribute unrestricted double height;
     readonly attribute unrestricted double top;
     readonly attribute unrestricted double right;
     readonly attribute unrestricted double bottom;
--- a/dom/webidl/DedicatedWorkerGlobalScope.webidl
+++ b/dom/webidl/DedicatedWorkerGlobalScope.webidl
@@ -16,15 +16,15 @@
  Exposed=DedicatedWorker]
 interface DedicatedWorkerGlobalScope : WorkerGlobalScope {
   [Replaceable]
   readonly attribute DOMString name;
 
   [Throws]
   void postMessage(any message, sequence<object> transfer);
   [Throws]
-  void postMessage(any message, optional PostMessageOptions options);
+  void postMessage(any message, optional PostMessageOptions options = {});
 
   void close();
 
   attribute EventHandler onmessage;
   attribute EventHandler onmessageerror;
 };
--- a/dom/webidl/DelayNode.webidl
+++ b/dom/webidl/DelayNode.webidl
@@ -11,17 +11,17 @@
  */
 
 dictionary DelayOptions : AudioNodeOptions {
              double maxDelayTime = 1;
              double delayTime = 0;
 };
 
 [Pref="dom.webaudio.enabled",
- Constructor(BaseAudioContext context, optional DelayOptions options)]
+ Constructor(BaseAudioContext context, optional DelayOptions options = {})]
 interface DelayNode : AudioNode {
 
     readonly attribute AudioParam delayTime;
 
 };
 
 // Mozilla extension
 DelayNode implements AudioNodePassThrough;
--- a/dom/webidl/DeviceLightEvent.webidl
+++ b/dom/webidl/DeviceLightEvent.webidl
@@ -1,15 +1,15 @@
 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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/.
  */
 
-[Pref="device.sensors.ambientLight.enabled", Func="nsGlobalWindowInner::DeviceSensorsEnabled", Constructor(DOMString type, optional DeviceLightEventInit eventInitDict)]
+[Pref="device.sensors.ambientLight.enabled", Func="nsGlobalWindowInner::DeviceSensorsEnabled", Constructor(DOMString type, optional DeviceLightEventInit eventInitDict = {})]
 interface DeviceLightEvent : Event
 {
   readonly attribute unrestricted double value;
 };
 
 dictionary DeviceLightEventInit : EventInit
 {
   unrestricted double value = Infinity;
--- a/dom/webidl/DeviceMotionEvent.webidl
+++ b/dom/webidl/DeviceMotionEvent.webidl
@@ -15,17 +15,17 @@ interface DeviceAcceleration {
 
 [NoInterfaceObject]
 interface DeviceRotationRate {
   readonly attribute double? alpha;
   readonly attribute double? beta;
   readonly attribute double? gamma;
 };
 
-[Pref="device.sensors.motion.enabled", Func="nsGlobalWindowInner::DeviceSensorsEnabled", Constructor(DOMString type, optional DeviceMotionEventInit eventInitDict)]
+[Pref="device.sensors.motion.enabled", Func="nsGlobalWindowInner::DeviceSensorsEnabled", Constructor(DOMString type, optional DeviceMotionEventInit eventInitDict = {})]
 interface DeviceMotionEvent : Event {
   readonly attribute DeviceAcceleration? acceleration;
   readonly attribute DeviceAcceleration? accelerationIncludingGravity;
   readonly attribute DeviceRotationRate? rotationRate;
   readonly attribute double? interval;
 };
 
 dictionary DeviceAccelerationInit {
@@ -36,27 +36,27 @@ dictionary DeviceAccelerationInit {
 
 dictionary DeviceRotationRateInit {
   double? alpha = null;
   double? beta = null;
   double? gamma = null;
 };
 
 dictionary DeviceMotionEventInit : EventInit {
-  // FIXME: bug 1493860: should this "= null" be here?
-  DeviceAccelerationInit acceleration = null;
-  // FIXME: bug 1493860: should this "= null" be here?
-  DeviceAccelerationInit accelerationIncludingGravity = null;
-  // FIXME: bug 1493860: should this "= null" be here?
-  DeviceRotationRateInit rotationRate = null;
+  // FIXME: bug 1493860: should this "= {}" be here?
+  DeviceAccelerationInit acceleration = {};
+  // FIXME: bug 1493860: should this "= {}" be here?
+  DeviceAccelerationInit accelerationIncludingGravity = {};
+  // FIXME: bug 1493860: should this "= {}" be here?
+  DeviceRotationRateInit rotationRate = {};
   double? interval = null;
 };
 
 // Mozilla extensions.
 partial interface DeviceMotionEvent {
   void initDeviceMotionEvent(DOMString type,
                              optional boolean canBubble = false,
                              optional boolean cancelable = false,
-                             optional DeviceAccelerationInit acceleration,
-                             optional DeviceAccelerationInit accelerationIncludingGravity,
-                             optional DeviceRotationRateInit rotationRate,
+                             optional DeviceAccelerationInit acceleration = {},
+                             optional DeviceAccelerationInit accelerationIncludingGravity = {},
+                             optional DeviceRotationRateInit rotationRate = {},
                              optional double? interval = null);
 };
--- a/dom/webidl/DeviceOrientationEvent.webidl
+++ b/dom/webidl/DeviceOrientationEvent.webidl
@@ -1,15 +1,15 @@
 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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/.
  */
 
-[Pref="device.sensors.orientation.enabled", Func="nsGlobalWindowInner::DeviceSensorsEnabled", Constructor(DOMString type, optional DeviceOrientationEventInit eventInitDict), LegacyEventInit]
+[Pref="device.sensors.orientation.enabled", Func="nsGlobalWindowInner::DeviceSensorsEnabled", Constructor(DOMString type, optional DeviceOrientationEventInit eventInitDict = {}), LegacyEventInit]
 interface DeviceOrientationEvent : Event
 {
   readonly attribute double? alpha;
   readonly attribute double? beta;
   readonly attribute double? gamma;
   readonly attribute boolean absolute;
 
   // initDeviceOrientationEvent is a Gecko specific deprecated method.
--- a/dom/webidl/DeviceProximityEvent.webidl
+++ b/dom/webidl/DeviceProximityEvent.webidl
@@ -1,15 +1,15 @@
 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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/.
  */
 
-[Pref="device.sensors.proximity.enabled", Func="nsGlobalWindowInner::DeviceSensorsEnabled", Constructor(DOMString type, optional DeviceProximityEventInit eventInitDict)]
+[Pref="device.sensors.proximity.enabled", Func="nsGlobalWindowInner::DeviceSensorsEnabled", Constructor(DOMString type, optional DeviceProximityEventInit eventInitDict = {})]
 interface DeviceProximityEvent : Event
 {
   readonly attribute double value;
   readonly attribute double min;
   readonly attribute double max;
 };
 
 dictionary DeviceProximityEventInit : EventInit
--- a/dom/webidl/Document.webidl
+++ b/dom/webidl/Document.webidl
@@ -66,19 +66,19 @@ interface Document : Node {
   HTMLCollection getElementsByClassName(DOMString classNames);
   [Pure]
   Element? getElementById(DOMString elementId);
 
   // These DOM methods cannot be accessed by UA Widget scripts
   // because the DOM element reflectors will be in the content scope,
   // instead of the desired UA Widget scope.
   [CEReactions, NewObject, Throws, Func="IsNotUAWidget"]
-  Element createElement(DOMString localName, optional (ElementCreationOptions or DOMString) options);
+  Element createElement(DOMString localName, optional (ElementCreationOptions or DOMString) options = {});
   [CEReactions, NewObject, Throws, Func="IsNotUAWidget"]
-  Element createElementNS(DOMString? namespace, DOMString qualifiedName, optional (ElementCreationOptions or DOMString) options);
+  Element createElementNS(DOMString? namespace, DOMString qualifiedName, optional (ElementCreationOptions or DOMString) options = {});
   [NewObject]
   DocumentFragment createDocumentFragment();
   [NewObject, Func="IsNotUAWidget"]
   Text createTextNode(DOMString data);
   [NewObject, Func="IsNotUAWidget"]
   Comment createComment(DOMString data);
   [NewObject, Throws]
   ProcessingInstruction createProcessingInstruction(DOMString target, DOMString data);
@@ -375,17 +375,17 @@ partial interface Document {
   Element? getAnonymousElementByAttribute(Element elt, DOMString attrName,
                                           DOMString attrValue);
   [Func="IsChromeOrXBL"]
   Element? getBindingParent(Node node);
   [Throws, Func="IsChromeOrXBL", NeedsSubjectPrincipal]
   void loadBindingDocument(DOMString documentURL);
   // Creates a new XUL element regardless of the document's default type.
   [CEReactions, NewObject, Throws, Func="IsChromeOrXBL"]
-  Element createXULElement(DOMString localName, optional (ElementCreationOptions or DOMString) options);
+  Element createXULElement(DOMString localName, optional (ElementCreationOptions or DOMString) options = {});
   // Wether the document was loaded using a nsXULPrototypeDocument.
   [ChromeOnly]
   readonly attribute boolean loadedFromPrototype;
 
   // The principal to use for the storage area of this document
   [ChromeOnly]
   readonly attribute Principal effectiveStoragePrincipal;
 
@@ -425,17 +425,17 @@ partial interface Document {
 
   [ChromeOnly] readonly attribute DOMString contentLanguage;
 
   [ChromeOnly] readonly attribute nsILoadGroup? documentLoadGroup;
 
   // Blocks the initial document parser until the given promise is settled.
   [ChromeOnly, Throws]
   Promise<any> blockParsing(Promise<any> promise,
-                            optional BlockParsingOptions options);
+                            optional BlockParsingOptions options = {});
 
   // like documentURI, except that for error pages, it returns the URI we were
   // trying to load when we hit an error, rather than the error page's own URI.
   [ChromeOnly] readonly attribute URI? mozDocumentURIIfNotForErrorPages;
 
   // A promise that is resolved, with this document itself, when we have both
   // fired DOMContentLoaded and are ready to start layout.  This is used for the
   // "document_idle" webextension script injection point.
--- a/dom/webidl/DocumentTimeline.webidl
+++ b/dom/webidl/DocumentTimeline.webidl
@@ -10,11 +10,11 @@
  * liability, trademark and document use rules apply.
  */
 
 dictionary DocumentTimelineOptions {
   DOMHighResTimeStamp originTime = 0;
 };
 
 [Func="Document::AreWebAnimationsTimelinesEnabled",
- Constructor(optional DocumentTimelineOptions options)]
+ Constructor(optional DocumentTimelineOptions options = {})]
 interface DocumentTimeline : AnimationTimeline {
 };
--- a/dom/webidl/DragEvent.webidl
+++ b/dom/webidl/DragEvent.webidl
@@ -1,15 +1,15 @@
 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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/.
  */
 
-[Constructor(DOMString type, optional DragEventInit eventInitDict)]
+[Constructor(DOMString type, optional DragEventInit eventInitDict = {})]
 interface DragEvent : MouseEvent
 {
   readonly attribute DataTransfer? dataTransfer;
 
   void initDragEvent(DOMString type,
                      optional boolean canBubble = false,
                      optional boolean cancelable = false,
                      optional Window? aView = null,
--- a/dom/webidl/DynamicsCompressorNode.webidl
+++ b/dom/webidl/DynamicsCompressorNode.webidl
@@ -14,17 +14,17 @@ dictionary DynamicsCompressorOptions : A
              float attack = 0.003;
              float knee = 30;
              float ratio = 12;
              float release = 0.25;
              float threshold = -24;
 };
 
 [Pref="dom.webaudio.enabled",
- Constructor(BaseAudioContext context, optional DynamicsCompressorOptions options)]
+ Constructor(BaseAudioContext context, optional DynamicsCompressorOptions options = {})]
 interface DynamicsCompressorNode : AudioNode {
 
     readonly attribute AudioParam threshold; // in Decibels
     readonly attribute AudioParam knee; // in Decibels
     readonly attribute AudioParam ratio; // unit-less
     readonly attribute float reduction; // in Decibels
     readonly attribute AudioParam attack; // in Seconds
     readonly attribute AudioParam release; // in Seconds
--- a/dom/webidl/Element.webidl
+++ b/dom/webidl/Element.webidl
@@ -159,45 +159,45 @@ interface Element : Node {
 dictionary FocusOptions {
   boolean preventScroll = false;
 };
 
 // TODO(mbrodesser): once https://bugzilla.mozilla.org/show_bug.cgi?id=1414372
 // is fixed, mixin should be used.
 [NoInterfaceObject] interface HTMLOrSVGOrXULElementMixin {
   [Throws]
-  void focus(optional FocusOptions options);
+  void focus(optional FocusOptions options = {});
 };
 
 // http://dev.w3.org/csswg/cssom-view/
 enum ScrollLogicalPosition { "start", "center", "end", "nearest" };
 dictionary ScrollIntoViewOptions : ScrollOptions {
   ScrollLogicalPosition block = "start";
   ScrollLogicalPosition inline = "nearest";
 };
 
 // http://dev.w3.org/csswg/cssom-view/#extensions-to-the-element-interface
 partial interface Element {
   DOMRectList getClientRects();
   DOMRect getBoundingClientRect();
 
   // scrolling
-  void scrollIntoView(optional (boolean or ScrollIntoViewOptions) arg);
+  void scrollIntoView(optional (boolean or ScrollIntoViewOptions) arg = {});
   // None of the CSSOM attributes are [Pure], because they flush
            attribute long scrollTop;   // scroll on setting
            attribute long scrollLeft;  // scroll on setting
   readonly attribute long scrollWidth;
   readonly attribute long scrollHeight;
 
   void scroll(unrestricted double x, unrestricted double y);
-  void scroll(optional ScrollToOptions options);
+  void scroll(optional ScrollToOptions options = {});
   void scrollTo(unrestricted double x, unrestricted double y);
-  void scrollTo(optional ScrollToOptions options);
+  void scrollTo(optional ScrollToOptions options = {});
   void scrollBy(unrestricted double x, unrestricted double y);
-  void scrollBy(optional ScrollToOptions options);
+  void scrollBy(optional ScrollToOptions options = {});
   // mozScrollSnap is used by chrome to perform scroll snapping after the
   // user performs actions that may affect scroll position
   // mozScrollSnap is deprecated, to be replaced by a web accessible API, such
   // as an extension to the ScrollOptions dictionary.  See bug 1137937.
   [ChromeOnly] void mozScrollSnap();
 
   readonly attribute long clientTop;
   readonly attribute long clientLeft;
--- a/dom/webidl/ErrorEvent.webidl
+++ b/dom/webidl/ErrorEvent.webidl
@@ -1,14 +1,14 @@
 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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/. */
 
-[Constructor(DOMString type, optional ErrorEventInit eventInitDict),
+[Constructor(DOMString type, optional ErrorEventInit eventInitDict = {}),
  Exposed=(Window,Worker)]
 interface ErrorEvent : Event
 {
   readonly attribute DOMString message;
   readonly attribute DOMString filename;
   readonly attribute unsigned long lineno;
   readonly attribute unsigned long colno;
   readonly attribute any error;
--- a/dom/webidl/Event.webidl
+++ b/dom/webidl/Event.webidl
@@ -5,17 +5,17 @@
  *
  * The origin of this IDL file is
  * http://www.w3.org/TR/2012/WD-dom-20120105/
  *
  * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
  * liability, trademark and document use rules apply.
  */
 
-[Constructor(DOMString type, optional EventInit eventInitDict),
+[Constructor(DOMString type, optional EventInit eventInitDict = {}),
  Exposed=(Window,Worker), ProbablyShortLivingWrapper]
 interface Event {
   [Pure]
   readonly attribute DOMString type;
   [Pure, BindingAlias="srcElement"]
   readonly attribute EventTarget? target;
   [Pure]
   readonly attribute EventTarget? currentTarget;
--- a/dom/webidl/EventSource.webidl
+++ b/dom/webidl/EventSource.webidl
@@ -7,17 +7,17 @@
  * https://html.spec.whatwg.org/multipage/comms.html#the-eventsource-interface
  *
  * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
  * Opera Software ASA. You are granted a license to use, reproduce
  * and create derivative works of this document.
  */
 
 [Exposed=(Window,DedicatedWorker,SharedWorker),
- Constructor(USVString url, optional EventSourceInit eventSourceInitDict)]
+ Constructor(USVString url, optional EventSourceInit eventSourceInitDict = {})]
 interface EventSource : EventTarget {
   [Constant]
   readonly attribute DOMString url;
   [Constant]
   readonly attribute boolean withCredentials;
 
   // ready state
   const unsigned short CONNECTING = 0;
--- a/dom/webidl/EventTarget.webidl
+++ b/dom/webidl/EventTarget.webidl
@@ -30,22 +30,22 @@ dictionary AddEventListenerOptions : Eve
 interface EventTarget {
   /* Passing null for wantsUntrusted means "default behavior", which
      differs in content and chrome.  In content that default boolean
      value is true, while in chrome the default boolean value is
      false. */
   [Throws]
   void addEventListener(DOMString type,
                         EventListener? listener,
-                        optional (AddEventListenerOptions or boolean) options,
+                        optional (AddEventListenerOptions or boolean) options = {},
                         optional boolean? wantsUntrusted = null);
   [Throws]
   void removeEventListener(DOMString type,
                            EventListener? listener,
-                           optional (EventListenerOptions or boolean) options);
+                           optional (EventListenerOptions or boolean) options = {});
   [Throws, NeedsCallerType]
   boolean dispatchEvent(Event event);
 };
 
 // Mozilla extensions for use by JS-implemented event targets to
 // implement on* properties.
 partial interface EventTarget {
   // The use of [TreatNonCallableAsNull] here is a bit of a hack: it just makes
--- a/dom/webidl/ExtendableEvent.webidl
+++ b/dom/webidl/ExtendableEvent.webidl
@@ -2,17 +2,17 @@
 /* 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/.
  *
  * For more information on this interface, please see
  * http://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html
  */
 
-[Constructor(DOMString type, optional ExtendableEventInit eventInitDict),
+[Constructor(DOMString type, optional ExtendableEventInit eventInitDict = {}),
  Exposed=ServiceWorker]
 interface ExtendableEvent : Event {
   // https://github.com/slightlyoff/ServiceWorker/issues/261
   [Throws]
   void waitUntil(Promise<any> p);
 };
 
 dictionary ExtendableEventInit : EventInit {
--- a/dom/webidl/ExtendableMessageEvent.webidl
+++ b/dom/webidl/ExtendableMessageEvent.webidl
@@ -2,17 +2,17 @@
 /* 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/.
  *
  * For more information on this interface, please see
  * https://w3c.github.io/ServiceWorker/#extendablemessage-event-section
  */
 
-[Constructor(DOMString type, optional ExtendableMessageEventInit eventInitDict),
+[Constructor(DOMString type, optional ExtendableMessageEventInit eventInitDict = {}),
  Exposed=(ServiceWorker)]
 interface ExtendableMessageEvent : ExtendableEvent {
   /**
    * Custom data associated with this event.
    */
   [GetterThrows]
   readonly attribute any data;
 
--- a/dom/webidl/File.webidl
+++ b/dom/webidl/File.webidl
@@ -6,17 +6,17 @@
  * The origin of this IDL file is
  * https://w3c.github.io/FileAPI/#file
  * https://wicg.github.io/entries-api
  */
 
 interface nsIFile;
 
 [Constructor(sequence<BlobPart> fileBits,
-             USVString fileName, optional FilePropertyBag options),
+             USVString fileName, optional FilePropertyBag options = {}),
  Exposed=(Window,Worker)]
 interface File : Blob {
   readonly attribute DOMString name;
 
   [GetterThrows]
   readonly attribute long long lastModified;
 };
 
@@ -45,14 +45,14 @@ partial interface File {
 // These 2 methods can be used only in these conditions:
 // - the main-thread
 // - parent process OR file process OR, only for testing, with pref
 //   `dom.file.createInChild' set to true.
 [Exposed=(Window)]
 partial interface File {
   [ChromeOnly, Throws, NeedsCallerType]
   static Promise<File> createFromNsIFile(nsIFile file,
-                                         optional ChromeFilePropertyBag options);
+                                         optional ChromeFilePropertyBag options = {});
 
   [ChromeOnly, Throws, NeedsCallerType]
   static Promise<File> createFromFileName(USVString fileName,
-                                          optional ChromeFilePropertyBag options);
+                                          optional ChromeFilePropertyBag options = {});
 };
--- a/dom/webidl/FileSystemDirectoryEntry.webidl
+++ b/dom/webidl/FileSystemDirectoryEntry.webidl
@@ -5,17 +5,17 @@
  *
  * https://wicg.github.io/entries-api/#idl-index
  */
 
 interface FileSystemDirectoryEntry : FileSystemEntry {
     FileSystemDirectoryReader createReader();
 
     void getFile(optional USVString? path,
-                 optional FileSystemFlags options,
+                 optional FileSystemFlags options = {},
                  optional FileSystemEntryCallback successCallback,
                  optional ErrorCallback errorCallback);
 
     void getDirectory(optional USVString? path,
-                      optional FileSystemFlags options,
+                      optional FileSystemFlags options = {},
                       optional FileSystemEntryCallback successCallback,
                       optional ErrorCallback errorCallback);
 };
--- a/dom/webidl/FocusEvent.webidl
+++ b/dom/webidl/FocusEvent.webidl
@@ -5,17 +5,17 @@
  *
  * For more information on this interface please see
  * http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html
  *
  * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
  * liability, trademark and document use rules apply.
  */
 
-[Constructor(DOMString typeArg, optional FocusEventInit focusEventInitDict)]
+[Constructor(DOMString typeArg, optional FocusEventInit focusEventInitDict = {})]
 interface FocusEvent : UIEvent {
   // Introduced in DOM Level 3:
   readonly attribute EventTarget?   relatedTarget;
 };
 
 dictionary FocusEventInit : UIEventInit {
     EventTarget? relatedTarget = null;
 };
--- a/dom/webidl/FontFace.webidl
+++ b/dom/webidl/FontFace.webidl
@@ -24,17 +24,17 @@ dictionary FontFaceDescriptors {
 };
 
 enum FontFaceLoadStatus { "unloaded", "loading", "loaded", "error" };
 
 // Bug 1072107 is for exposing this in workers.
 // [Exposed=(Window,Worker)]
 [Constructor(DOMString family,
              (DOMString or BinaryData) source,
-             optional FontFaceDescriptors descriptors),
+             optional FontFaceDescriptors descriptors = {}),
  Pref="layout.css.font-loading-api.enabled"]
 interface FontFace {
   [SetterThrows] attribute DOMString family;
   [SetterThrows] attribute DOMString style;
   [SetterThrows] attribute DOMString weight;
   [SetterThrows] attribute DOMString stretch;
   [SetterThrows] attribute DOMString unicodeRange;
   [SetterThrows] attribute DOMString variant;
--- a/dom/webidl/FontFaceSetLoadEvent.webidl
+++ b/dom/webidl/FontFaceSetLoadEvent.webidl
@@ -9,13 +9,13 @@
  * Copyright © 2014 W3C® (MIT, ERCIM, Keio, Beihang), All Rights Reserved. W3C
  * liability, trademark and document use rules apply.
  */
 
 dictionary FontFaceSetLoadEventInit : EventInit {
   sequence<FontFace> fontfaces = [];
 };
 
-[Constructor(DOMString type, optional FontFaceSetLoadEventInit eventInitDict),
+[Constructor(DOMString type, optional FontFaceSetLoadEventInit eventInitDict = {}),
  Pref="layout.css.font-loading-api.enabled"]
 interface FontFaceSetLoadEvent : Event {
   [Cached, Constant, Frozen] readonly attribute sequence<FontFace> fontfaces;
 };
--- a/dom/webidl/FrameCrashedEvent.webidl
+++ b/dom/webidl/FrameCrashedEvent.webidl
@@ -1,15 +1,15 @@
 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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/.
  */
 
-[Constructor(DOMString type, optional FrameCrashedEventInit eventInitDict), ChromeOnly]
+[Constructor(DOMString type, optional FrameCrashedEventInit eventInitDict = {}), ChromeOnly]
 interface FrameCrashedEvent : Event
 {
   /**
    * The browsingContextId of the frame that crashed.
    */
   readonly attribute unsigned long long browsingContextId;
 
   /**
--- a/dom/webidl/FuzzingFunctions.webidl
+++ b/dom/webidl/FuzzingFunctions.webidl
@@ -103,10 +103,10 @@ interface FuzzingFunctions {
    *   synthesizeKeyboardEvents("%", { shiftKey: true });
    *   // Synthesize "*" key of Japanese keyboard layout.
    *   synthesizeKeyboardEvents("*", { code: "Quote",
    *                                   shiftKey: true,
    *                                   keyCode: KeyboardEvent.DOM_VK_COLON });
    */
   [Throws]
   static void synthesizeKeyboardEvents(DOMString aKeyValue,
-                                       optional KeyboardEventInit aDictionary);
+                                       optional KeyboardEventInit aDictionary = {});
 };
--- a/dom/webidl/GainNode.webidl
+++ b/dom/webidl/GainNode.webidl
@@ -10,17 +10,17 @@
  * liability, trademark and document use rules apply.
  */
 
 dictionary GainOptions : AudioNodeOptions {
              float gain = 1.0;
 };
 
 [Pref="dom.webaudio.enabled",
- Constructor(BaseAudioContext context, optional GainOptions options)]
+ Constructor(BaseAudioContext context, optional GainOptions options = {})]
 interface GainNode : AudioNode {
 
     readonly attribute AudioParam gain;
 
 };
 
 // Mozilla extension
 GainNode implements AudioNodePassThrough;
--- a/dom/webidl/GamepadAxisMoveEvent.webidl
+++ b/dom/webidl/GamepadAxisMoveEvent.webidl
@@ -1,16 +1,16 @@
 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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/.
  */
 
 [Pref="dom.gamepad.non_standard_events.enabled",
- Constructor(DOMString type, optional GamepadAxisMoveEventInit eventInitDict)]
+ Constructor(DOMString type, optional GamepadAxisMoveEventInit eventInitDict = {})]
 interface GamepadAxisMoveEvent : GamepadEvent
 {
   readonly attribute unsigned long axis;
   readonly attribute double value;
 };
 
 dictionary GamepadAxisMoveEventInit : GamepadEventInit
 {
--- a/dom/webidl/GamepadButtonEvent.webidl
+++ b/dom/webidl/GamepadButtonEvent.webidl
@@ -1,16 +1,16 @@
 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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/.
  */
 
 [Pref="dom.gamepad.non_standard_events.enabled",
- Constructor(DOMString type, optional GamepadButtonEventInit eventInitDict)]
+ Constructor(DOMString type, optional GamepadButtonEventInit eventInitDict = {})]
 interface GamepadButtonEvent : GamepadEvent
 {
   readonly attribute unsigned long button;
 };
 
 dictionary GamepadButtonEventInit : GamepadEventInit
 {
   unsigned long button = 0;
--- a/dom/webidl/GamepadEvent.webidl
+++ b/dom/webidl/GamepadEvent.webidl
@@ -1,16 +1,16 @@
 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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/.
  */
 
 [Pref="dom.gamepad.enabled",
- Constructor(DOMString type, optional GamepadEventInit eventInitDict)]
+ Constructor(DOMString type, optional GamepadEventInit eventInitDict = {})]
 interface GamepadEvent : Event
 {
   readonly attribute Gamepad? gamepad;
 };
 
 dictionary GamepadEventInit : EventInit
 {
   Gamepad? gamepad = null;
--- a/dom/webidl/Geolocation.webidl
+++ b/dom/webidl/Geolocation.webidl
@@ -16,21 +16,21 @@ dictionary PositionOptions {
   [Clamp] unsigned long maximumAge = 0;
 };
 
 [NoInterfaceObject]
 interface Geolocation {
   [Throws, NeedsCallerType]
   void getCurrentPosition(PositionCallback successCallback,
                           optional PositionErrorCallback? errorCallback = null,
-                          optional PositionOptions options);
+                          optional PositionOptions options = {});
 
   [Throws, NeedsCallerType]
   long watchPosition(PositionCallback successCallback,
                      optional PositionErrorCallback? errorCallback = null,
-                     optional PositionOptions options);
+                     optional PositionOptions options = {});
 
   void clearWatch(long watchId);
 };
 
 callback PositionCallback = void (Position position);
 
 callback PositionErrorCallback = void (PositionError positionError);
--- a/dom/webidl/GeometryUtils.webidl
+++ b/dom/webidl/GeometryUtils.webidl
@@ -19,20 +19,20 @@ dictionary BoxQuadOptions {
 dictionary ConvertCoordinateOptions {
   CSSBoxType fromBox = "border";
   CSSBoxType toBox = "border";
 };
 
 [NoInterfaceObject]
 interface GeometryUtils {
   [Throws, Func="nsINode::HasBoxQuadsSupport", NeedsCallerType]
-  sequence<DOMQuad> getBoxQuads(optional BoxQuadOptions options);
+  sequence<DOMQuad> getBoxQuads(optional BoxQuadOptions options = {});
   [Throws, Pref="layout.css.convertFromNode.enabled", NeedsCallerType]
-  DOMQuad convertQuadFromNode(DOMQuad quad, GeometryNode from, optional ConvertCoordinateOptions options);
+  DOMQuad convertQuadFromNode(DOMQuad quad, GeometryNode from, optional ConvertCoordinateOptions options = {});
   [Throws, Pref="layout.css.convertFromNode.enabled", NeedsCallerType]
-  DOMQuad convertRectFromNode(DOMRectReadOnly rect, GeometryNode from, optional ConvertCoordinateOptions options);
+  DOMQuad convertRectFromNode(DOMRectReadOnly rect, GeometryNode from, optional ConvertCoordinateOptions options = {});
   [Throws, Pref="layout.css.convertFromNode.enabled", NeedsCallerType]
-  DOMPoint convertPointFromNode(DOMPointInit point, GeometryNode from, optional ConvertCoordinateOptions options);
+  DOMPoint convertPointFromNode(DOMPointInit point, GeometryNode from, optional ConvertCoordinateOptions options = {});
 };
 
 // PseudoElement implements GeometryUtils;
 
 typedef (Text or Element /* or PseudoElement */ or Document) GeometryNode;
--- a/dom/webidl/HTMLInputElement.webidl
+++ b/dom/webidl/HTMLInputElement.webidl
@@ -261,20 +261,20 @@ partial interface HTMLInputElement {
    BinaryName="getMinimumAsDouble"]
   double getMinimum();
 
   [Pref="dom.forms.datetime", ChromeOnly,
    BinaryName="getMaximumAsDouble"]
   double getMaximum();
 
   [Pref="dom.forms.datetime", Func="IsChromeOrXBLOrUAWidget"]
-  void openDateTimePicker(optional DateTimeValue initialValue);
+  void openDateTimePicker(optional DateTimeValue initialValue = {});
 
   [Pref="dom.forms.datetime", Func="IsChromeOrXBLOrUAWidget"]
-  void updateDateTimePicker(optional DateTimeValue value);
+  void updateDateTimePicker(optional DateTimeValue value = {});
 
   [Pref="dom.forms.datetime", Func="IsChromeOrXBLOrUAWidget"]
   void closeDateTimePicker();
 
   [Pref="dom.forms.datetime", Func="IsChromeOrXBLOrUAWidget"]
   void setFocusState(boolean aIsFocused);
 
   [Pref="dom.forms.datetime", Func="IsChromeOrXBLOrUAWidget"]
--- a/dom/webidl/HTMLSlotElement.webidl
+++ b/dom/webidl/HTMLSlotElement.webidl
@@ -9,15 +9,15 @@
  * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
  * Opera Software ASA. You are granted a license to use, reproduce
  * and create derivative works of this document.
  */
 
 [Exposed=Window, HTMLConstructor]
 interface HTMLSlotElement : HTMLElement {
   [CEReactions, SetterThrows] attribute DOMString name;
-  sequence<Node> assignedNodes(optional AssignedNodesOptions options);
-  sequence<Element> assignedElements(optional AssignedNodesOptions options);
+  sequence<Node> assignedNodes(optional AssignedNodesOptions options = {});
+  sequence<Element> assignedElements(optional AssignedNodesOptions options = {});
 };
 
 dictionary AssignedNodesOptions {
   boolean flatten = false;
 };
--- a/dom/webidl/HashChangeEvent.webidl
+++ b/dom/webidl/HashChangeEvent.webidl
@@ -1,15 +1,15 @@
 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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/.
  */
 
-[Constructor(DOMString type, optional HashChangeEventInit eventInitDict), LegacyEventInit]
+[Constructor(DOMString type, optional HashChangeEventInit eventInitDict = {}), LegacyEventInit]
 interface HashChangeEvent : Event
 {
   readonly attribute DOMString oldURL;
   readonly attribute DOMString newURL;
 
   void initHashChangeEvent(DOMString typeArg,
                            optional boolean canBubbleArg = false,
                            optional boolean cancelableArg = false,
--- a/dom/webidl/HiddenPluginEvent.webidl
+++ b/dom/webidl/HiddenPluginEvent.webidl
@@ -1,11 +1,11 @@
 interface PluginTag;
 
-[Constructor(DOMString type, optional HiddenPluginEventInit eventInit), ChromeOnly]
+[Constructor(DOMString type, optional HiddenPluginEventInit eventInit = {}), ChromeOnly]
 interface HiddenPluginEvent : Event
 {
   readonly attribute PluginTag? tag;
 };
 
 dictionary HiddenPluginEventInit : EventInit
 {
   PluginTag? tag = null;
--- a/dom/webidl/IDBDatabase.webidl
+++ b/dom/webidl/IDBDatabase.webidl
@@ -13,17 +13,17 @@
 [Exposed=(Window,Worker)]
 interface IDBDatabase : EventTarget {
     readonly    attribute DOMString          name;
     readonly    attribute unsigned long long version;
 
     readonly    attribute DOMStringList      objectStoreNames;
 
     [Throws]
-    IDBObjectStore createObjectStore (DOMString name, optional IDBObjectStoreParameters optionalParameters);
+    IDBObjectStore createObjectStore (DOMString name, optional IDBObjectStoreParameters optionalParameters = {});
 
     [Throws]
     void           deleteObjectStore (DOMString name);
 
     [Throws]
     IDBTransaction transaction ((DOMString or sequence<DOMString>) storeNames,
                                 optional IDBTransactionMode mode = "readonly");
 
--- a/dom/webidl/IDBFactory.webidl
+++ b/dom/webidl/IDBFactory.webidl
@@ -28,38 +28,38 @@ interface IDBFactory {
   [Throws, NeedsCallerType]
   IDBOpenDBRequest
   open(DOMString name,
        [EnforceRange] unsigned long long version);
 
   [Throws, NeedsCallerType]
   IDBOpenDBRequest
   open(DOMString name,
-       optional IDBOpenDBOptions options);
+       optional IDBOpenDBOptions options = {});
 
   [Throws, NeedsCallerType]
   IDBOpenDBRequest
   deleteDatabase(DOMString name,
-                 optional IDBOpenDBOptions options);
+                 optional IDBOpenDBOptions options = {});
 
   [Throws]
   short
   cmp(any first,
       any second);
 
   [Throws, ChromeOnly, NeedsCallerType]
   IDBOpenDBRequest
   openForPrincipal(Principal principal,
                    DOMString name,
                    [EnforceRange] unsigned long long version);
 
   [Throws, ChromeOnly, NeedsCallerType]
   IDBOpenDBRequest
   openForPrincipal(Principal principal,
                    DOMString name,
-                   optional IDBOpenDBOptions options);
+                   optional IDBOpenDBOptions options = {});
 
   [Throws, ChromeOnly, NeedsCallerType]
   IDBOpenDBRequest
   deleteForPrincipal(Principal principal,
                      DOMString name,
-                     optional IDBOpenDBOptions options);
+                     optional IDBOpenDBOptions options = {});
 };
--- a/dom/webidl/IDBFileHandle.webidl
+++ b/dom/webidl/IDBFileHandle.webidl
@@ -14,17 +14,17 @@ interface IDBFileHandle : EventTarget
   readonly attribute IDBMutableFile? mutableFile;
   // this is deprecated due to renaming in the spec
   readonly attribute IDBMutableFile? fileHandle; // now mutableFile
   readonly attribute FileMode mode;
   readonly attribute boolean active;
   attribute unsigned long long? location;
 
   [Throws]
-  IDBFileRequest? getMetadata(optional IDBFileMetadataParameters parameters);
+  IDBFileRequest? getMetadata(optional IDBFileMetadataParameters parameters = {});
   [Throws]
   IDBFileRequest? readAsArrayBuffer(unsigned long long size);
   [Throws]
   IDBFileRequest? readAsText(unsigned long long size,
                              optional DOMString? encoding = null);
 
   [Throws]
   IDBFileRequest? write((DOMString or ArrayBuffer or ArrayBufferView or Blob) value);
--- a/dom/webidl/IDBObjectStore.webidl
+++ b/dom/webidl/IDBObjectStore.webidl
@@ -41,17 +41,17 @@ interface IDBObjectStore {
 
     [Throws]
     IDBRequest clear ();
 
     [Throws]
     IDBRequest openCursor (optional any range, optional IDBCursorDirection direction = "next");
 
     [Throws]
-    IDBIndex   createIndex (DOMString name, (DOMString or sequence<DOMString>) keyPath, optional IDBIndexParameters optionalParameters);
+    IDBIndex   createIndex (DOMString name, (DOMString or sequence<DOMString>) keyPath, optional IDBIndexParameters optionalParameters = {});
 
     [Throws]
     IDBIndex   index (DOMString name);
 
     [Throws]
     void       deleteIndex (DOMString indexName);
 
     [Throws]
--- a/dom/webidl/IDBVersionChangeEvent.webidl
+++ b/dom/webidl/IDBVersionChangeEvent.webidl
@@ -10,15 +10,15 @@
  * liability, trademark and document use rules apply.
  */
 
 dictionary IDBVersionChangeEventInit : EventInit {
     unsigned long long  oldVersion = 0;
     unsigned long long? newVersion = null;
 };
 
-[Constructor(DOMString type, optional IDBVersionChangeEventInit eventInitDict),
+[Constructor(DOMString type, optional IDBVersionChangeEventInit eventInitDict = {}),
  Exposed=(Window,Worker)]
 interface IDBVersionChangeEvent : Event {
     readonly    attribute unsigned long long  oldVersion;
     readonly    attribute unsigned long long? newVersion;
 };
 
--- a/dom/webidl/ImageCaptureErrorEvent.webidl
+++ b/dom/webidl/ImageCaptureErrorEvent.webidl
@@ -6,17 +6,17 @@
  * The origin of this IDL file is
  * https://dvcs.w3.org/hg/dap/raw-file/default/media-stream-capture/ImageCapture.html
  *
  * Copyright © 2012-2014 W3C® (MIT, ERCIM, Keio, Beihang), All Rights Reserved.
  * W3C liability, trademark and document use rules apply.
  */
 
 [Pref="dom.imagecapture.enabled",
-Constructor(DOMString type, optional ImageCaptureErrorEventInit imageCaptureErrorInitDict)]
+Constructor(DOMString type, optional ImageCaptureErrorEventInit imageCaptureErrorInitDict = {})]
 interface ImageCaptureErrorEvent : Event {
   readonly attribute ImageCaptureError? imageCaptureError;
 };
 
 dictionary ImageCaptureErrorEventInit : EventInit {
   ImageCaptureError? imageCaptureError = null;
 };
 
--- a/dom/webidl/InputEvent.webidl
+++ b/dom/webidl/InputEvent.webidl
@@ -1,15 +1,15 @@
 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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/.
  */
 
-[Constructor(DOMString type, optional InputEventInit eventInitDict)]
+[Constructor(DOMString type, optional InputEventInit eventInitDict = {})]
 interface InputEvent : UIEvent
 {
   readonly attribute boolean       isComposing;
 
   [Pref="dom.inputevent.inputtype.enabled"]
   readonly attribute DOMString inputType;
 
   [NeedsCallerType, Pref="dom.inputevent.data.enabled"]
--- a/dom/webidl/IntersectionObserver.webidl
+++ b/dom/webidl/IntersectionObserver.webidl
@@ -21,17 +21,17 @@ interface IntersectionObserverEntry {
   readonly attribute boolean isIntersecting;
   [Constant]
   readonly attribute double intersectionRatio;
   [Constant]
   readonly attribute Element target;
 };
 
 [Constructor(IntersectionCallback intersectionCallback,
-             optional IntersectionObserverInit options),
+             optional IntersectionObserverInit options = {}),
  Pref="dom.IntersectionObserver.enabled"]
 interface IntersectionObserver {
   [Constant]
   readonly attribute Element? root;
   [Constant]
   readonly attribute DOMString rootMargin;
   [Constant,Cached]
   readonly attribute sequence<double> thresholds;
--- a/dom/webidl/IntlUtils.webidl
+++ b/dom/webidl/IntlUtils.webidl
@@ -46,17 +46,17 @@ interface IntlUtils {
    *
    *   values:
    *     a key-value pair list of requested keys and corresponding translated
    *     values
    *
    */
   [Throws]
   DisplayNameResult getDisplayNames(sequence<DOMString> locales,
-                                    optional DisplayNameOptions options);
+                                    optional DisplayNameOptions options = {});
 
   /**
    * Helper function to retrieve useful information about a locale.
    *
    * The function takes one argument - locales which is a list of locale
    * strings.
    *
    * It returns an object with properties:
--- a/dom/webidl/KeyboardEvent.webidl
+++ b/dom/webidl/KeyboardEvent.webidl
@@ -1,15 +1,15 @@
 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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/.
  */
 
-[Constructor(DOMString typeArg, optional KeyboardEventInit keyboardEventInitDict)]
+[Constructor(DOMString typeArg, optional KeyboardEventInit keyboardEventInitDict= {})]
 interface KeyboardEvent : UIEvent
 {
   [NeedsCallerType]
   readonly attribute unsigned long    charCode;
   [NeedsCallerType]
   readonly attribute unsigned long    keyCode;
 
   [NeedsCallerType]
--- a/dom/webidl/KeyframeEffect.webidl
+++ b/dom/webidl/KeyframeEffect.webidl
@@ -21,17 +21,17 @@ dictionary KeyframeEffectOptions : Effec
 };
 
 // KeyframeEffect should run in the caller's compartment to do custom
 // processing on the `keyframes` object.
 [Func="Document::IsWebAnimationsEnabled",
  RunConstructorInCallerCompartment,
  Constructor((Element or CSSPseudoElement)? target,
              object? keyframes,
-             optional (unrestricted double or KeyframeEffectOptions) options),
+             optional (unrestricted double or KeyframeEffectOptions) options = {}),
  Constructor(KeyframeEffect source)]
 interface KeyframeEffect : AnimationEffect {
   attribute (Element or CSSPseudoElement)?  target;
   [Pref="dom.animations-api.compositing.enabled"]
   attribute IterationCompositeOperation     iterationComposite;
   [Pref="dom.animations-api.compositing.enabled"]
   attribute CompositeOperation              composite;
   [Throws] sequence<object> getKeyframes();
--- a/dom/webidl/MIDIConnectionEvent.webidl
+++ b/dom/webidl/MIDIConnectionEvent.webidl
@@ -2,17 +2,17 @@
 /* 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://webaudio.github.io/web-midi-api/
  */
 
-[Constructor(DOMString type, optional MIDIConnectionEventInit eventInitDict),
+[Constructor(DOMString type, optional MIDIConnectionEventInit eventInitDict = {}),
  SecureContext,
  Pref="dom.webmidi.enabled"]
 interface MIDIConnectionEvent : Event
 {
   readonly attribute MIDIPort? port;
 };
 
 dictionary MIDIConnectionEventInit : EventInit
--- a/dom/webidl/MIDIMessageEvent.webidl
+++ b/dom/webidl/MIDIMessageEvent.webidl
@@ -2,17 +2,17 @@
 /* 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://webaudio.github.io/web-midi-api/
  */
 
-[Constructor(DOMString type, optional MIDIMessageEventInit eventInitDict),
+[Constructor(DOMString type, optional MIDIMessageEventInit eventInitDict = {}),
  SecureContext,
  Pref="dom.webmidi.enabled"]
 interface MIDIMessageEvent : Event
 {
   [Throws]
   readonly attribute Uint8Array  data;
 };
 
--- a/dom/webidl/MediaDevices.webidl
+++ b/dom/webidl/MediaDevices.webidl
@@ -15,13 +15,13 @@ interface MediaDevices : EventTarget {
   [Pref="media.ondevicechange.enabled"]
   attribute EventHandler ondevicechange;
   MediaTrackSupportedConstraints getSupportedConstraints();
 
   [Throws, NeedsCallerType, UseCounter]
   Promise<sequence<MediaDeviceInfo>> enumerateDevices();
 
   [Throws, NeedsCallerType, UseCounter]
-  Promise<MediaStream> getUserMedia(optional MediaStreamConstraints constraints);
+  Promise<MediaStream> getUserMedia(optional MediaStreamConstraints constraints = {});
 
   [SecureContext, Throws, NeedsCallerType, UseCounter]
-  Promise<MediaStream> getDisplayMedia(optional DisplayMediaStreamConstraints constraints);
+  Promise<MediaStream> getDisplayMedia(optional DisplayMediaStreamConstraints constraints = {});
 };
--- a/dom/webidl/MediaEncryptedEvent.webidl
+++ b/dom/webidl/MediaEncryptedEvent.webidl
@@ -5,17 +5,17 @@
  *
  * The origin of this IDL file is
  * https://dvcs.w3.org/hg/html-media/raw-file/default/encrypted-media/encrypted-media.html
  *
  * Copyright © 2014 W3C® (MIT, ERCIM, Keio, Beihang), All Rights Reserved.
  * W3C liability, trademark and document use rules apply.
  */
 
-[Constructor(DOMString type, optional MediaKeyNeededEventInit eventInitDict)]
+[Constructor(DOMString type, optional MediaKeyNeededEventInit eventInitDict = {})]
 interface MediaEncryptedEvent : Event {
   readonly attribute DOMString initDataType;
   [Throws]
   readonly attribute ArrayBuffer? initData;
 };
 
 dictionary MediaKeyNeededEventInit : EventInit {
   DOMString initDataType = "";
--- a/dom/webidl/MediaKeys.webidl
+++ b/dom/webidl/MediaKeys.webidl
@@ -28,10 +28,10 @@ interface MediaKeys {
 
   [NewObject, Throws]
   MediaKeySession createSession(optional MediaKeySessionType sessionType = "temporary");
 
   [NewObject]
   Promise<void> setServerCertificate(BufferSource serverCertificate);
 
   [Pref="media.eme.hdcp-policy-check.enabled", NewObject]
-  Promise<MediaKeyStatus> getStatusForPolicy(optional MediaKeysPolicy policy);
+  Promise<MediaKeyStatus> getStatusForPolicy(optional MediaKeysPolicy policy = {});
 };
--- a/dom/webidl/MediaQueryListEvent.webidl
+++ b/dom/webidl/MediaQueryListEvent.webidl
@@ -1,17 +1,17 @@
 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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/.
  *
  * https://drafts.csswg.org/cssom-view/#mediaquerylistevent
  */
 
-[Constructor(DOMString type, optional MediaQueryListEventInit eventInitDict)]
+[Constructor(DOMString type, optional MediaQueryListEventInit eventInitDict = {})]
 interface MediaQueryListEvent : Event {
   readonly attribute DOMString media;
   readonly attribute boolean matches;
 };
 
 dictionary MediaQueryListEventInit : EventInit {
   DOMString media = "";
   boolean matches = false;
--- a/dom/webidl/MediaRecorder.webidl
+++ b/dom/webidl/MediaRecorder.webidl
@@ -7,19 +7,19 @@
  * https://dvcs.w3.org/hg/dap/raw-file/default/media-stream-capture/MediaRecorder.html
  *
  * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
  * liability, trademark and document use rules apply.
  */
 
 enum RecordingState { "inactive", "recording", "paused" };
 
-[Constructor(MediaStream stream, optional MediaRecorderOptions options),
+[Constructor(MediaStream stream, optional MediaRecorderOptions options = {}),
  Constructor(AudioNode node, optional unsigned long output = 0,
-             optional MediaRecorderOptions options)]
+             optional MediaRecorderOptions options = {})]
 interface MediaRecorder : EventTarget {
 
   readonly attribute MediaStream stream;
 
   readonly attribute DOMString mimeType;
 
   readonly attribute RecordingState state;
 
--- a/dom/webidl/MediaStreamAudioDestinationNode.webidl
+++ b/dom/webidl/MediaStreamAudioDestinationNode.webidl
@@ -6,12 +6,12 @@
  * The origin of this IDL file is
  * https://webaudio.github.io/web-audio-api/
  *
  * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
  * liability, trademark and document use rules apply.
  */
 
 [Pref="dom.webaudio.enabled",
- Constructor(AudioContext context, optional AudioNodeOptions options)]
+ Constructor(AudioContext context, optional AudioNodeOptions options = {})]
 interface MediaStreamAudioDestinationNode : AudioNode {
     readonly attribute MediaStream stream;
 };
--- a/dom/webidl/MediaStreamEvent.webidl
+++ b/dom/webidl/MediaStreamEvent.webidl
@@ -7,12 +7,12 @@
  * http://dev.w3.org/2011/webrtc/editor/webrtc.html#mediastreamevent
  */
 
 dictionary MediaStreamEventInit : EventInit {
     MediaStream? stream = null;
 };
 
 [Pref="media.peerconnection.enabled",
- Constructor(DOMString type, optional MediaStreamEventInit eventInitDict)]
+ Constructor(DOMString type, optional MediaStreamEventInit eventInitDict = {})]
 interface MediaStreamEvent : Event {
   readonly attribute MediaStream? stream;
 };
--- a/dom/webidl/MediaStreamTrack.webidl
+++ b/dom/webidl/MediaStreamTrack.webidl
@@ -84,14 +84,14 @@ interface MediaStreamTrack : EventTarget
     MediaStreamTrack       clone ();
     void                   stop ();
 //  MediaTrackCapabilities getCapabilities ();
     MediaTrackConstraints  getConstraints ();
     [NeedsCallerType]
     MediaTrackSettings     getSettings ();
 
     [Throws, NeedsCallerType]
-    Promise<void>          applyConstraints (optional MediaTrackConstraints constraints);
+    Promise<void>          applyConstraints (optional MediaTrackConstraints constraints = {});
 //              attribute EventHandler          onoverconstrained;
 
     [ChromeOnly]
     void mutedChanged(boolean muted);
 };
--- a/dom/webidl/MerchantValidationEvent.webidl
+++ b/dom/webidl/MerchantValidationEvent.webidl
@@ -6,17 +6,17 @@
  * The origin of this WebIDL file is
  *   https://w3c.github.io/payment-request/#merchantvalidationevent-interface
  *   https://w3c.github.io/payment-request/#merchantvalidationeventinit-dictionary
  *
  * Copyright © 2018 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
  * liability, trademark and document use rules apply.
  */
 
-[Constructor(DOMString type, optional MerchantValidationEventInit eventInitDict),
+[Constructor(DOMString type, optional MerchantValidationEventInit eventInitDict = {}),
 SecureContext,
 Exposed=Window,
 Func="mozilla::dom::PaymentRequest::PrefEnabled"]
 interface MerchantValidationEvent : Event {
   readonly attribute DOMString methodName;
   readonly attribute USVString validationURL;
   [Throws]
   void complete(Promise<any> merchantSessionPromise);
--- a/dom/webidl/MessageEvent.webidl
+++ b/dom/webidl/MessageEvent.webidl
@@ -2,17 +2,17 @@
 /* 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/.
  *
  * For more information on this interface, please see
  * https://html.spec.whatwg.org/#messageevent
  */
 
-[Constructor(DOMString type, optional MessageEventInit eventInitDict),
+[Constructor(DOMString type, optional MessageEventInit eventInitDict = {}),
  Exposed=(Window,Worker)]
 interface MessageEvent : Event {
   /**
    * Custom data associated with this event.
    */
   [GetterThrows]
   readonly attribute any data;
 
--- a/dom/webidl/MessagePort.webidl
+++ b/dom/webidl/MessagePort.webidl
@@ -7,17 +7,17 @@
  * http://www.whatwg.org/specs/web-apps/current-work/#channel-messaging
  */
 
 [Exposed=(Window,Worker,AudioWorklet)]
 interface MessagePort : EventTarget {
   [Throws]
   void postMessage(any message, sequence<object> transferable);
   [Throws]
-  void postMessage(any message, optional PostMessageOptions options);
+  void postMessage(any message, optional PostMessageOptions options = {});
 
   void start();
   void close();
 
   // event handlers
   attribute EventHandler onmessage;
   attribute EventHandler onmessageerror;
 };
--- a/dom/webidl/MouseEvent.webidl
+++ b/dom/webidl/MouseEvent.webidl
@@ -5,17 +5,17 @@
  *
  * For more information on this interface please see
  * http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html
  *
  * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
  * liability, trademark and document use rules apply.
  */
 
-[Constructor(DOMString typeArg, optional MouseEventInit mouseEventInitDict)]
+[Constructor(DOMString typeArg, optional MouseEventInit mouseEventInitDict = {})]
 interface MouseEvent : UIEvent {
   [NeedsCallerType]
   readonly attribute long           screenX;
   [NeedsCallerType]
   readonly attribute long           screenY;
   readonly attribute long           clientX;
   readonly attribute long           clientY;
   [BinaryName="clientX"]
--- a/dom/webidl/MozApplicationEvent.webidl
+++ b/dom/webidl/MozApplicationEvent.webidl
@@ -1,15 +1,15 @@
 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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/.
  */
 
-[Constructor(DOMString type, optional MozApplicationEventInit eventInitDict), ChromeOnly]
+[Constructor(DOMString type, optional MozApplicationEventInit eventInitDict = {}), ChromeOnly]
 interface MozApplicationEvent : Event
 {
   readonly attribute DOMApplication? application;
 };
 
 dictionary MozApplicationEventInit : EventInit
 {
   DOMApplication? application = null;
--- a/dom/webidl/MozFrameLoaderOwner.webidl
+++ b/dom/webidl/MozFrameLoaderOwner.webidl
@@ -39,10 +39,10 @@ interface MozFrameLoaderOwner {
 
   [ChromeOnly, Throws]
   void swapFrameLoaders(XULFrameElement aOtherLoaderOwner);
 
   [ChromeOnly, Throws]
   void swapFrameLoaders(HTMLIFrameElement aOtherLoaderOwner);
 
   [ChromeOnly, Throws]
-  void changeRemoteness(optional RemotenessOptions aOptions);
+  void changeRemoteness(optional RemotenessOptions aOptions = {});
 };
--- a/dom/webidl/MutationObserver.webidl
+++ b/dom/webidl/MutationObserver.webidl
@@ -35,17 +35,17 @@ interface MutationRecord {
   readonly attribute sequence<Animation> changedAnimations;
   [Constant,Cached,ChromeOnly]
   readonly attribute sequence<Animation> removedAnimations;
 };
 
 [Constructor(MutationCallback mutationCallback)]
 interface MutationObserver {
   [Throws]
-  void observe(Node target, optional MutationObserverInit options);
+  void observe(Node target, optional MutationObserverInit options = {});
   void disconnect();
   sequence<MutationRecord> takeRecords();
 
   [ChromeOnly, Throws]
   sequence<MutationObservingInfo?> getObservingInfo();
   [ChromeOnly]
   readonly attribute MutationCallback mutationCallback;
   [ChromeOnly]
--- a/dom/webidl/Navigator.webidl
+++ b/dom/webidl/Navigator.webidl
@@ -226,17 +226,17 @@ partial interface Navigator {
 partial interface Navigator {
   [Pref="dom.vr.puppet.enabled"]
   VRServiceTest requestVRServiceTest();
 };
 
 // http://webaudio.github.io/web-midi-api/#requestmidiaccess
 partial interface Navigator {
   [Throws, Pref="dom.webmidi.enabled"]
-  Promise<MIDIAccess> requestMIDIAccess(optional MIDIOptions options);
+  Promise<MIDIAccess> requestMIDIAccess(optional MIDIOptions options = {});
 };
 
 callback NavigatorUserMediaSuccessCallback = void (MediaStream stream);
 callback NavigatorUserMediaErrorCallback = void (MediaStreamError error);
 
 partial interface Navigator {
   [Throws, Func="Navigator::HasUserMediaSupport"]
   readonly attribute MediaDevices mediaDevices;
--- a/dom/webidl/Node.webidl
+++ b/dom/webidl/Node.webidl
@@ -34,17 +34,17 @@ interface Node : EventTarget {
   [Pure, Throws, NeedsCallerType, BinaryName="baseURIFromJS"]
   readonly attribute DOMString? baseURI;
 
   [Pure, BinaryName=isInComposedDoc]
   readonly attribute boolean isConnected;
   [Pure]
   readonly attribute Document? ownerDocument;
   [Pure]
-  Node getRootNode(optional GetRootNodeOptions options);
+  Node getRootNode(optional GetRootNodeOptions options = {});
   [Pure]
   readonly attribute Node? parentNode;
   [Pure]
   readonly attribute Element? parentElement;
   [Pure]
   boolean hasChildNodes();
   [SameObject]
   readonly attribute NodeList childNodes;
--- a/dom/webidl/Notification.webidl
+++ b/dom/webidl/Notification.webidl
@@ -6,28 +6,28 @@
  * The origin of this IDL file is
  * https://notifications.spec.whatwg.org/
  *
  * Copyright:
  * To the extent possible under law, the editors have waived all copyright and
  * related or neighboring rights to this work.
  */
 
-[Constructor(DOMString title, optional NotificationOptions options),
+[Constructor(DOMString title, optional NotificationOptions options = {}),
  Exposed=(Window,Worker),
  Func="mozilla::dom::Notification::PrefEnabled"]
 interface Notification : EventTarget {
   [GetterThrows]
   static readonly attribute NotificationPermission permission;
 
   [Throws, Func="mozilla::dom::Notification::RequestPermissionEnabledForScope"]
   static Promise<NotificationPermission> requestPermission(optional NotificationPermissionCallback permissionCallback);
 
   [Throws, Func="mozilla::dom::Notification::IsGetEnabled"]
-  static Promise<sequence<Notification>> get(optional GetNotificationOptions filter);
+  static Promise<sequence<Notification>> get(optional GetNotificationOptions filter = {});
 
   attribute EventHandler onclick;
 
   attribute EventHandler onshow;
 
   attribute EventHandler onerror;
 
   attribute EventHandler onclose;
@@ -62,17 +62,17 @@ interface Notification : EventTarget {
 dictionary NotificationOptions {
   NotificationDirection dir = "auto";
   DOMString lang = "";
   DOMString body = "";
   DOMString tag = "";
   DOMString icon = "";
   boolean requireInteraction = false;
   any data = null;
-  NotificationBehavior mozbehavior = null;
+  NotificationBehavior mozbehavior = {};
 };
 
 dictionary GetNotificationOptions {
   DOMString tag = "";
 };
 
 dictionary NotificationBehavior {
   boolean noscreen = false;
--- a/dom/webidl/OscillatorNode.webidl
+++ b/dom/webidl/OscillatorNode.webidl
@@ -21,17 +21,17 @@ enum OscillatorType {
 dictionary OscillatorOptions : AudioNodeOptions {
              OscillatorType type = "sine";
              float          frequency = 440;
              float          detune = 0;
              PeriodicWave   periodicWave;
 };
 
 [Pref="dom.webaudio.enabled",
- Constructor(BaseAudioContext context, optional OscillatorOptions options)]
+ Constructor(BaseAudioContext context, optional OscillatorOptions options = {})]
 interface OscillatorNode : AudioScheduledSourceNode {
 
     [SetterThrows]
     attribute OscillatorType type;
 
     readonly attribute AudioParam frequency; // in Hertz
     readonly attribute AudioParam detune; // in Cents
 
--- a/dom/webidl/PageTransitionEvent.webidl
+++ b/dom/webidl/PageTransitionEvent.webidl
@@ -5,17 +5,17 @@
  */
 
 /**
  * The PageTransitionEvent interface is used for the pageshow and
  * pagehide events, which are generic events that apply to both page
  * load/unload and saving/restoring a document from session history.
  */
 
-[Constructor(DOMString type, optional PageTransitionEventInit eventInitDict)]
+[Constructor(DOMString type, optional PageTransitionEventInit eventInitDict = {})]
 interface PageTransitionEvent : Event
 {
   /**
    * Set to true if the document has been or will be persisted across
    * firing of the event.  For example, if a document is being cached in
    * session history, |persisted| is true for the PageHide event.
    */
   readonly attribute boolean persisted;
--- a/dom/webidl/PannerNode.webidl
+++ b/dom/webidl/PannerNode.webidl
@@ -34,17 +34,17 @@ dictionary PannerOptions : AudioNodeOpti
              double            maxDistance = 10000;
              double            rolloffFactor = 1;
              double            coneInnerAngle = 360;
              double            coneOuterAngle = 360;
              double            coneOuterGain = 0;
 };
 
 [Pref="dom.webaudio.enabled",
- Constructor(BaseAudioContext context, optional PannerOptions options)]
+ Constructor(BaseAudioContext context, optional PannerOptions options = {})]
 interface PannerNode : AudioNode {
 
     // Default for stereo is equalpower
     attribute PanningModelType panningModel;
 
     // Uses a 3D cartesian coordinate system
     void setPosition(double x, double y, double z);
     void setOrientation(double x, double y, double z);
--- a/dom/webidl/PaymentMethodChangeEvent.webidl
+++ b/dom/webidl/PaymentMethodChangeEvent.webidl
@@ -5,17 +5,17 @@
  *
  * The origin of this WebIDL file is
  *   https://w3c.github.io/payment-request/#paymentmethodchangeevent-interface
  *
  * Copyright © 2018 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
  * liability, trademark and document use rules apply.
  */
 
-[Constructor(DOMString type, optional PaymentMethodChangeEventInit eventInitDict),
+[Constructor(DOMString type, optional PaymentMethodChangeEventInit eventInitDict = {}),
  SecureContext,
  Exposed=Window,
  Func="mozilla::dom::PaymentRequest::PrefEnabled"]
 interface PaymentMethodChangeEvent : PaymentRequestUpdateEvent {
     readonly attribute DOMString methodName;
     readonly attribute object?   methodDetails;
 };
 
--- a/dom/webidl/PaymentRequest.webidl
+++ b/dom/webidl/PaymentRequest.webidl
@@ -98,17 +98,17 @@ dictionary PaymentOptions {
   boolean             requestPayerEmail = false;
   boolean             requestPayerPhone = false;
   boolean             requestShipping = false;
   boolean             requestBillingAddress = false;
   PaymentShippingType shippingType = "shipping";
 };
 
 [Constructor(sequence<PaymentMethodData> methodData, PaymentDetailsInit details,
-             optional PaymentOptions options),
+             optional PaymentOptions options = {}),
  SecureContext,
  Func="mozilla::dom::PaymentRequest::PrefEnabled"]
 interface PaymentRequest : EventTarget {
   [NewObject]
   Promise<PaymentResponse> show(optional Promise<PaymentDetailsUpdate> detailsPromise);
   [NewObject]
   Promise<void>            abort();
   [NewObject]
--- a/dom/webidl/PaymentRequestUpdateEvent.webidl
+++ b/dom/webidl/PaymentRequestUpdateEvent.webidl
@@ -6,17 +6,17 @@
  * The origin of this WebIDL file is
  *   https://w3c.github.io/payment-request/#paymentrequestupdateevent-interface
  *
  * Copyright © 2018 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
  * liability, trademark and document use rules apply.
  */
 
 [Constructor(DOMString type,
-             optional PaymentRequestUpdateEventInit eventInitDict),
+             optional PaymentRequestUpdateEventInit eventInitDict = {}),
  SecureContext,
  Func="mozilla::dom::PaymentRequest::PrefEnabled"]
 interface PaymentRequestUpdateEvent : Event {
   [Throws]
   void updateWith(Promise<PaymentDetailsUpdate> detailsPromise);
 };
 
 dictionary PaymentRequestUpdateEventInit : EventInit {
--- a/dom/webidl/PaymentResponse.webidl
+++ b/dom/webidl/PaymentResponse.webidl
@@ -30,12 +30,12 @@ interface PaymentResponse : EventTarget 
   readonly attribute DOMString?      payerEmail;
   readonly attribute DOMString?      payerPhone;
 
   [NewObject]
   Promise<void> complete(optional PaymentComplete result = "unknown");
 
   // If the dictionary argument has no required members, it must be optional.
   [NewObject]
-  Promise<void> retry(optional PaymentValidationErrors errorFields);
+  Promise<void> retry(optional PaymentValidationErrors errorFields = {});
 
   attribute EventHandler onpayerdetailchange;
 };
--- a/dom/webidl/PeerConnectionImpl.webidl
+++ b/dom/webidl/PeerConnectionImpl.webidl
@@ -21,17 +21,17 @@ interface PeerConnectionImpl  {
   /* Must be called first. Observer events dispatched on the thread provided */
   [Throws]
   void initialize(PeerConnectionObserver observer, Window window,
                   RTCConfiguration iceServers,
                   nsISupports thread);
 
   /* JSEP calls */
   [Throws]
-  void createOffer(optional RTCOfferOptions options);
+  void createOffer(optional RTCOfferOptions options = {});
   [Throws]
   void createAnswer();
   [Throws]
   void setLocalDescription(long action, DOMString sdp);
   [Throws]
   void setRemoteDescription(long action, DOMString sdp);
 
   /* Stats call, calls either |onGetStatsSuccess| or |onGetStatsError| on our
--- a/dom/webidl/PeerConnectionObserver.webidl
+++ b/dom/webidl/PeerConnectionObserver.webidl
@@ -27,17 +27,17 @@ interface PeerConnectionObserver
   void onSetRemoteDescriptionSuccess();
   void onSetLocalDescriptionError(PCErrorData error);
   void onSetRemoteDescriptionError(PCErrorData error);
   void onAddIceCandidateSuccess();
   void onAddIceCandidateError(PCErrorData error);
   void onIceCandidate(unsigned short level, DOMString mid, DOMString candidate, DOMString ufrag);
 
   /* Stats callbacks */
-  void onGetStatsSuccess(optional RTCStatsReportInternal report);
+  void onGetStatsSuccess(optional RTCStatsReportInternal report = {});
   void onGetStatsError(DOMString message);
 
   /* Data channel callbacks */
   void notifyDataChannel(RTCDataChannel channel);
 
   /* Notification of one of several types of state changed */
   void onStateChange(PCObserverStateType state);
 
--- a/dom/webidl/PerformanceEntryEvent.webidl
+++ b/dom/webidl/PerformanceEntryEvent.webidl
@@ -9,17 +9,17 @@ dictionary PerformanceEntryEventInit : E
   DOMString name = "";
   DOMString entryType = "";
   DOMHighResTimeStamp startTime = 0;
   DOMHighResTimeStamp duration = 0;
   double epoch = 0;
   DOMString origin = "";
 };
 
-[Constructor(DOMString type, optional PerformanceEntryEventInit eventInitDict),
+[Constructor(DOMString type, optional PerformanceEntryEventInit eventInitDict = {}),
  ChromeOnly]
 interface PerformanceEntryEvent : Event
 {
   readonly attribute DOMString name;
   readonly attribute DOMString entryType;
   readonly attribute DOMHighResTimeStamp startTime;
   readonly attribute DOMHighResTimeStamp duration;
   readonly attribute double epoch;
--- a/dom/webidl/PerformanceObserver.webidl
+++ b/dom/webidl/PerformanceObserver.webidl
@@ -15,13 +15,13 @@ dictionary PerformanceObserverInit {
 
 callback PerformanceObserverCallback = void (PerformanceObserverEntryList entries,
                                              PerformanceObserver observer);
 
 [Pref="dom.enable_performance_observer",
  Constructor(PerformanceObserverCallback callback),
  Exposed=(Window,Worker)]
 interface PerformanceObserver {
-    [Throws] void observe(optional PerformanceObserverInit options);
+    [Throws] void observe(optional PerformanceObserverInit options = {});
     void disconnect();
     PerformanceEntryList takeRecords();
     static readonly attribute object supportedEntryTypes;
 };
--- a/dom/webidl/PerformanceObserverEntryList.webidl
+++ b/dom/webidl/PerformanceObserverEntryList.webidl
@@ -12,14 +12,14 @@ dictionary PerformanceEntryFilterOptions
   DOMString name;
   DOMString entryType;
   DOMString initiatorType;
 };
 
 [Pref="dom.enable_performance_observer",
  Exposed=(Window,Worker)]
 interface PerformanceObserverEntryList {
-  PerformanceEntryList getEntries(optional PerformanceEntryFilterOptions filter);
+  PerformanceEntryList getEntries(optional PerformanceEntryFilterOptions filter = {});
   PerformanceEntryList getEntriesByType(DOMString entryType);
   PerformanceEntryList getEntriesByName(DOMString name,
                                         optional DOMString entryType);
 };
 
--- a/dom/webidl/PeriodicWave.webidl
+++ b/dom/webidl/PeriodicWave.webidl
@@ -15,11 +15,11 @@ dictionary PeriodicWaveConstraints {
 };
 
 dictionary PeriodicWaveOptions : PeriodicWaveConstraints {
              sequence<float> real;
              sequence<float> imag;
 };
 
 [Pref="dom.webaudio.enabled",
- Constructor(BaseAudioContext context, optional PeriodicWaveOptions options)]
+ Constructor(BaseAudioContext context, optional PeriodicWaveOptions options = {})]
 interface PeriodicWave {
 };
--- a/dom/webidl/PluginCrashedEvent.webidl
+++ b/dom/webidl/PluginCrashedEvent.webidl
@@ -1,15 +1,15 @@
 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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/.
  */
 
-[Constructor(DOMString type, optional PluginCrashedEventInit eventInitDict), ChromeOnly]
+[Constructor(DOMString type, optional PluginCrashedEventInit eventInitDict = {}), ChromeOnly]
 interface PluginCrashedEvent : Event
 {
   readonly attribute unsigned long pluginID;
   readonly attribute DOMString pluginDumpID;
   readonly attribute DOMString pluginName;
   readonly attribute DOMString? browserDumpID;
   readonly attribute DOMString? pluginFilename;
   readonly attribute boolean submittedCrashReport;
--- a/dom/webidl/PointerEvent.webidl
+++ b/dom/webidl/PointerEvent.webidl
@@ -5,17 +5,17 @@
  *
  * For more information see nsIPointerEvent.idl.
  *
  * Portions Copyright 2013 Microsoft Open Technologies, Inc. */
 
 interface WindowProxy;
 
 [Pref="dom.w3c_pointer_events.enabled",
- Constructor(DOMString type, optional PointerEventInit eventInitDict)]
+ Constructor(DOMString type, optional PointerEventInit eventInitDict = {})]
 interface PointerEvent : MouseEvent
 {
   [NeedsCallerType]
   readonly attribute long pointerId;
 
   [NeedsCallerType]
   readonly attribute long width;
   [NeedsCallerType]
--- a/dom/webidl/PopStateEvent.webidl
+++ b/dom/webidl/PopStateEvent.webidl
@@ -1,15 +1,15 @@
 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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/.
  */
 
-[Constructor(DOMString type, optional PopStateEventInit eventInitDict)]
+[Constructor(DOMString type, optional PopStateEventInit eventInitDict = {})]
 interface PopStateEvent : Event
 {
   readonly attribute any state;
 };
 
 dictionary PopStateEventInit : EventInit
 {
   any state = null;
--- a/dom/webidl/PopupBlockedEvent.webidl
+++ b/dom/webidl/PopupBlockedEvent.webidl
@@ -1,16 +1,16 @@
 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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/.
  */
 interface URI;
 
-[Constructor(DOMString type, optional PopupBlockedEventInit eventInitDict)]
+[Constructor(DOMString type, optional PopupBlockedEventInit eventInitDict = {})]
 interface PopupBlockedEvent : Event
 {
   readonly attribute Window? requestingWindow;
   readonly attribute URI? popupWindowURI;
   readonly attribute DOMString? popupWindowName;
   readonly attribute DOMString? popupWindowFeatures;
 };
 
--- a/dom/webidl/ProgressEvent.webidl
+++ b/dom/webidl/ProgressEvent.webidl
@@ -1,15 +1,15 @@
 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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/.
  */
 
-[Constructor(DOMString type, optional ProgressEventInit eventInitDict),
+[Constructor(DOMString type, optional ProgressEventInit eventInitDict = {}),
  Exposed=(Window,Worker)]
 interface ProgressEvent : Event
 {
   readonly attribute boolean lengthComputable;
   readonly attribute unsigned long long loaded;
   readonly attribute unsigned long long total;
 };
 
--- a/dom/webidl/PushEvent.webidl
+++ b/dom/webidl/PushEvent.webidl
@@ -2,17 +2,17 @@
 /* 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://w3c.github.io/push-api/
  */
 
-[Constructor(DOMString type, optional PushEventInit eventInitDict),
+[Constructor(DOMString type, optional PushEventInit eventInitDict = {}),
  Pref="dom.push.enabled",
  Exposed=ServiceWorker]
 interface PushEvent : ExtendableEvent {
   readonly attribute PushMessageData? data;
 };
 
 typedef (BufferSource or USVString) PushMessageDataInit;
 
--- a/dom/webidl/PushManager.webidl
+++ b/dom/webidl/PushManager.webidl
@@ -12,30 +12,30 @@ dictionary PushSubscriptionOptionsInit {
   (BufferSource or DOMString)? applicationServerKey = null;
 };
 
 // The main thread JS implementation. Please see comments in
 // dom/push/PushManager.h for the split between PushManagerImpl and PushManager.
 [JSImplementation="@mozilla.org/push/PushManager;1",
  ChromeOnly, Constructor(DOMString scope)]
 interface PushManagerImpl {
-  Promise<PushSubscription>    subscribe(optional PushSubscriptionOptionsInit options);
+  Promise<PushSubscription>    subscribe(optional PushSubscriptionOptionsInit options = {});
   Promise<PushSubscription?>   getSubscription();
-  Promise<PushPermissionState> permissionState(optional PushSubscriptionOptionsInit options);
+  Promise<PushPermissionState> permissionState(optional PushSubscriptionOptionsInit options = {});
 };
 
 [Exposed=(Window,Worker), Pref="dom.push.enabled",
  ChromeConstructor(DOMString scope)]
 interface PushManager {
   [Throws, UseCounter]
-  Promise<PushSubscription>    subscribe(optional PushSubscriptionOptionsInit options);
+  Promise<PushSubscription>    subscribe(optional PushSubscriptionOptionsInit options = {});
   [Throws]
   Promise<PushSubscription?>   getSubscription();
   [Throws]
-  Promise<PushPermissionState> permissionState(optional PushSubscriptionOptionsInit options);
+  Promise<PushPermissionState> permissionState(optional PushSubscriptionOptionsInit options = {});
 };
 
 enum PushPermissionState
 {
     "granted",
     "denied",
     "prompt"
 };
--- a/dom/webidl/PushSubscription.webidl
+++ b/dom/webidl/PushSubscription.webidl
@@ -19,20 +19,20 @@ dictionary PushSubscriptionKeys
 {
   ByteString p256dh;
   ByteString auth;
 };
 
 dictionary PushSubscriptionJSON
 {
   USVString endpoint;
-  // FIXME: bug 1493860: should this "= null" be here?  For that matter, this
+  // FIXME: bug 1493860: should this "= {}" be here?  For that matter, this
   // PushSubscriptionKeys thing is not even in the spec; "keys" is a record
   // there.
-  PushSubscriptionKeys keys = null;
+  PushSubscriptionKeys keys = {};
 };
 
 dictionary PushSubscriptionInit
 {
   required USVString endpoint;
   required USVString scope;
   ArrayBuffer? p256dhKey;
   ArrayBuffer? authSecret;
--- a/dom/webidl/RTCDTMFToneChangeEvent.webidl
+++ b/dom/webidl/RTCDTMFToneChangeEvent.webidl
@@ -2,16 +2,16 @@
 /* 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://www.w3.org/TR/webrtc/#rtcdtmftonechangeevent
  */
 
-[Constructor(DOMString type, optional RTCDTMFToneChangeEventInit eventInitDict)]
+[Constructor(DOMString type, optional RTCDTMFToneChangeEventInit eventInitDict = {})]
 interface RTCDTMFToneChangeEvent : Event {
     readonly attribute DOMString tone;
 };
 
 dictionary RTCDTMFToneChangeEventInit : EventInit {
     DOMString tone = "";
 };
--- a/dom/webidl/RTCIceCandidate.webidl
+++ b/dom/webidl/RTCIceCandidate.webidl
@@ -11,16 +11,16 @@ dictionary RTCIceCandidateInit {
   DOMString candidate = "";
   DOMString? sdpMid = null;
   unsigned short? sdpMLineIndex = null;
   DOMString? usernameFragment = null;
 };
 
 [Pref="media.peerconnection.enabled",
  JSImplementation="@mozilla.org/dom/rtcicecandidate;1",
- Constructor(optional RTCIceCandidateInit candidateInitDict)]
+ Constructor(optional RTCIceCandidateInit candidateInitDict = {})]
 interface RTCIceCandidate {
   attribute DOMString       candidate;
   attribute DOMString?      sdpMid;
   attribute unsigned short? sdpMLineIndex;
   attribute DOMString? usernameFragment;
   [Default] object toJSON();
 };
--- a/dom/webidl/RTCIdentityProvider.webidl
+++ b/dom/webidl/RTCIdentityProvider.webidl
@@ -18,17 +18,17 @@ interface RTCIdentityProviderRegistrar {
    * JS-implemented WebIDL can't see these functions on `idp` above, chrome JS
    * gets an Xray onto the content code that suppresses functions, see
    * https://developer.mozilla.org/en-US/docs/Xray_vision#Xrays_for_JavaScript_objects
    */
   /* Forward to idp.generateAssertion() */
   [ChromeOnly, Throws]
   Promise<RTCIdentityAssertionResult>
   generateAssertion(DOMString contents, DOMString origin,
-                    optional RTCIdentityProviderOptions options);
+                    optional RTCIdentityProviderOptions options = {});
   /* Forward to idp.validateAssertion() */
   [ChromeOnly, Throws]
   Promise<RTCIdentityValidationResult>
   validateAssertion(DOMString assertion, DOMString origin);
 };
 
 dictionary RTCIdentityProvider {
   required GenerateAssertionCallback generateAssertion;
--- a/dom/webidl/RTCPeerConnection.webidl
+++ b/dom/webidl/RTCPeerConnection.webidl
@@ -73,39 +73,39 @@ dictionary RTCAnswerOptions : RTCOfferAn
 dictionary RTCOfferOptions : RTCOfferAnswerOptions {
   boolean offerToReceiveVideo;
   boolean offerToReceiveAudio;
   boolean iceRestart = false;
 };
 
 [Pref="media.peerconnection.enabled",
  JSImplementation="@mozilla.org/dom/peerconnection;1",
- Constructor (optional RTCConfiguration configuration,
+ Constructor (optional RTCConfiguration configuration = {},
               optional object? constraints)]
 interface RTCPeerConnection : EventTarget  {
   [Throws, StaticClassOverride="mozilla::dom::RTCCertificate"]
   static Promise<RTCCertificate> generateCertificate (AlgorithmIdentifier keygenAlgorithm);
 
   [Pref="media.peerconnection.identity.enabled"]
   void setIdentityProvider (DOMString provider,
-                            optional RTCIdentityProviderOptions options);
+                            optional RTCIdentityProviderOptions options = {});
   [Pref="media.peerconnection.identity.enabled"]
   Promise<DOMString> getIdentityAssertion();
-  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);
   Promise<void> setRemoteDescription (RTCSessionDescriptionInit description);
   readonly attribute RTCSessionDescription? localDescription;
   readonly attribute RTCSessionDescription? currentLocalDescription;
   readonly attribute RTCSessionDescription? pendingLocalDescription;
   readonly attribute RTCSessionDescription? remoteDescription;
   readonly attribute RTCSessionDescription? currentRemoteDescription;
   readonly attribute RTCSessionDescription? pendingRemoteDescription;
   readonly attribute RTCSignalingState signalingState;
-  Promise<void> addIceCandidate (optional (RTCIceCandidateInit or RTCIceCandidate) candidate);
+  Promise<void> addIceCandidate (optional (RTCIceCandidateInit or RTCIceCandidate) candidate = {});
   readonly attribute boolean? canTrickleIceCandidates;
   readonly attribute RTCIceGatheringState iceGatheringState;
   readonly attribute RTCIceConnectionState iceConnectionState;
   [Pref="media.peerconnection.identity.enabled"]
   readonly attribute Promise<RTCIdentityAssertion> peerIdentity;
   [Pref="media.peerconnection.identity.enabled"]
   readonly attribute DOMString? idpLoginUrl;
 
@@ -123,17 +123,17 @@ interface RTCPeerConnection : EventTarge
   // because a track can be part of multiple streams, stream parameters
   // indicate which particular streams should be referenced in signaling
 
   RTCRtpSender addTrack(MediaStreamTrack track,
                         MediaStream... streams);
   void removeTrack(RTCRtpSender sender);
 
   RTCRtpTransceiver addTransceiver((MediaStreamTrack or DOMString) trackOrKind,
-                                   optional RTCRtpTransceiverInit init);
+                                   optional RTCRtpTransceiverInit init = {});
 
   sequence<RTCRtpSender> getSenders();
   sequence<RTCRtpReceiver> getReceivers();
   sequence<RTCRtpTransceiver> getTransceivers();
 
   // test-only: for testing getContributingSources
   [ChromeOnly]
   DOMHighResTimeStamp mozGetNowInRtpSourceReferenceTime();
@@ -168,30 +168,30 @@ interface RTCPeerConnection : EventTarge
   attribute EventHandler ontrack;     // replaces onaddtrack and onaddstream.
   attribute EventHandler oniceconnectionstatechange;
   attribute EventHandler onicegatheringstatechange;
 
   Promise<RTCStatsReport> getStats (optional MediaStreamTrack? selector = null);
 
   // Data channel.
   RTCDataChannel createDataChannel (DOMString label,
-                                    optional RTCDataChannelInit dataChannelDict);
+                                    optional RTCDataChannelInit dataChannelDict = {});
   attribute EventHandler ondatachannel;
 };
 
 // Legacy callback API
 
 partial interface RTCPeerConnection {
 
   // Dummy Promise<void> return values avoid "WebIDL.WebIDLError: error:
   // We have overloads with both Promise and non-Promise return types"
 
   Promise<void> createOffer (RTCSessionDescriptionCallback successCallback,
                              RTCPeerConnectionErrorCallback failureCallback,
-                             optional RTCOfferOptions options);
+                             optional RTCOfferOptions options = {});
   Promise<void> createAnswer (RTCSessionDescriptionCallback successCallback,
                               RTCPeerConnectionErrorCallback failureCallback);
   Promise<void> setLocalDescription (RTCSessionDescriptionInit description,
                                      VoidFunction successCallback,
                                      RTCPeerConnectionErrorCallback failureCallback);
   Promise<void> setRemoteDescription (RTCSessionDescriptionInit description,
                                       VoidFunction successCallback,
                                       RTCPeerConnectionErrorCallback failureCallback);
--- a/dom/webidl/RTCPeerConnectionIceEvent.webidl
+++ b/dom/webidl/RTCPeerConnectionIceEvent.webidl
@@ -8,12 +8,12 @@
  */
 
 dictionary RTCPeerConnectionIceEventInit : EventInit {
   RTCIceCandidate? candidate = null;
 };
 
 [Pref="media.peerconnection.enabled",
  Constructor(DOMString type,
-             optional RTCPeerConnectionIceEventInit eventInitDict)]
+             optional RTCPeerConnectionIceEventInit eventInitDict = {})]
 interface RTCPeerConnectionIceEvent : Event {
   readonly attribute RTCIceCandidate? candidate;
 };
--- a/dom/webidl/RTCRtpSender.webidl
+++ b/dom/webidl/RTCRtpSender.webidl
@@ -65,17 +65,17 @@ dictionary RTCRtpParameters {
   RTCRtcpParameters                         rtcp;
   sequence<RTCRtpCodecParameters>           codecs;
 };
 
 [Pref="media.peerconnection.enabled",
  JSImplementation="@mozilla.org/dom/rtpsender;1"]
 interface RTCRtpSender {
   readonly attribute MediaStreamTrack? track;
-  Promise<void> setParameters (optional RTCRtpParameters parameters);
+  Promise<void> setParameters (optional RTCRtpParameters parameters = {});
   RTCRtpParameters getParameters();
   Promise<void> replaceTrack(MediaStreamTrack? withTrack);
   Promise<RTCStatsReport> getStats();
   [Pref="media.peerconnection.dtmf.enabled"]
   readonly attribute RTCDTMFSender? dtmf;
   // Ugh, can't use a ChromeOnly attibute sequence<MediaStream>...
   [ChromeOnly]
   sequence<MediaStream> getStreams();
--- a/dom/webidl/RTCSessionDescription.webidl
+++ b/dom/webidl/RTCSessionDescription.webidl
@@ -16,16 +16,16 @@ enum RTCSdpType {
 
 dictionary RTCSessionDescriptionInit {
   required RTCSdpType type;
   DOMString sdp = "";
 };
 
 [Pref="media.peerconnection.enabled",
  JSImplementation="@mozilla.org/dom/rtcsessiondescription;1",
- Constructor(optional RTCSessionDescriptionInit descriptionInitDict)]
+ Constructor(optional RTCSessionDescriptionInit descriptionInitDict = {})]
 interface RTCSessionDescription {
   // These should be readonly, but writing causes deprecation warnings for a bit
   attribute RTCSdpType type;
   attribute DOMString sdp;
 
   [Default] object toJSON();
 };
--- a/dom/webidl/Reporting.webidl
+++ b/dom/webidl/Reporting.webidl
@@ -13,17 +13,17 @@ interface ReportBody {
 
 [Pref="dom.reporting.enabled"]
 interface Report {
   readonly attribute DOMString type;
   readonly attribute DOMString url;
   readonly attribute ReportBody? body;
 };
 
-[Constructor(ReportingObserverCallback callback, optional ReportingObserverOptions options),
+[Constructor(ReportingObserverCallback callback, optional ReportingObserverOptions options = {}),
  Pref="dom.reporting.enabled"]
 interface ReportingObserver {
   void observe();
   void disconnect();
   ReportList takeRecords();
 };
 
 callback ReportingObserverCallback = void (sequence<Report> reports, ReportingObserver observer);
--- a/dom/webidl/Request.webidl
+++ b/dom/webidl/Request.webidl
@@ -5,17 +5,17 @@
  *
  * The origin of this IDL file is
  * https://fetch.spec.whatwg.org/#request-class
  */
 
 typedef (Request or USVString) RequestInfo;
 typedef unsigned long nsContentPolicyType;
 
-[Constructor(RequestInfo input, optional RequestInit init),
+[Constructor(RequestInfo input, optional RequestInit init = {}),
  Exposed=(Window,Worker)]
 interface Request {
   readonly attribute ByteString method;
   readonly attribute USVString url;
   [SameObject] readonly attribute Headers headers;
 
   readonly attribute RequestDestination destination;
   readonly attribute USVString referrer;
--- a/dom/webidl/ResizeObserver.webidl
+++ b/dom/webidl/ResizeObserver.webidl
@@ -16,17 +16,17 @@ dictionary ResizeObserverOptions {
     ResizeObserverBoxOptions box = "content-box";
 };
 
 [Constructor(ResizeObserverCallback callback),
  Exposed=Window,
  Pref="layout.css.resizeobserver.enabled"]
 interface ResizeObserver {
     [Throws]
-    void observe(Element target, optional ResizeObserverOptions options);
+    void observe(Element target, optional ResizeObserverOptions options = {});
     [Throws]
     void unobserve(Element target);
     void disconnect();
 };
 
 callback ResizeObserverCallback = void (sequence<ResizeObserverEntry> entries, ResizeObserver observer);
 
 [Pref="layout.css.resizeobserver.enabled"]
--- a/dom/webidl/Response.webidl
+++ b/dom/webidl/Response.webidl
@@ -4,17 +4,17 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/.
  *
  * The origin of this IDL file is
  * https://fetch.spec.whatwg.org/#response-class
  */
 
 // This should be Constructor(optional BodyInit... but BodyInit doesn't include
 // ReadableStream yet because we don't want to expose Streams API to Request.
-[Constructor(optional (Blob or BufferSource or FormData or URLSearchParams or ReadableStream or USVString)? body, optional ResponseInit init),
+[Constructor(optional (Blob or BufferSource or FormData or URLSearchParams or ReadableStream or USVString)? body, optional ResponseInit init = {}),
  Exposed=(Window,Worker)]
 interface Response {
   [NewObject] static Response error();
   [Throws,
    NewObject] static Response redirect(USVString url, optional unsigned short status = 302);
 
   readonly attribute ResponseType type;
 
--- a/dom/webidl/SVGGeometryElement.webidl
+++ b/dom/webidl/SVGGeometryElement.webidl
@@ -9,15 +9,15 @@
  * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
  * liability, trademark and document use rules apply.
  */
 
 interface SVGGeometryElement : SVGGraphicsElement {
   [SameObject]
   readonly attribute SVGAnimatedNumber pathLength;
 
-  boolean isPointInFill(optional DOMPointInit point);
-  boolean isPointInStroke(optional DOMPointInit point);
+  boolean isPointInFill(optional DOMPointInit point = {});
+  boolean isPointInStroke(optional DOMPointInit point = {});
 
   float getTotalLength();
   [NewObject, Throws]
   SVGPoint getPointAtLength(float distance);
 };
--- a/dom/webidl/SVGGraphicsElement.webidl
+++ b/dom/webidl/SVGGraphicsElement.webidl
@@ -19,17 +19,17 @@ dictionary SVGBoundingBoxOptions {
 
 interface SVGGraphicsElement : SVGElement {
   readonly attribute SVGAnimatedTransformList transform;
 
   readonly attribute SVGElement? nearestViewportElement;
   readonly attribute SVGElement? farthestViewportElement;
 
   [NewObject, Throws]
-  SVGRect getBBox(optional SVGBoundingBoxOptions aOptions);
+  SVGRect getBBox(optional SVGBoundingBoxOptions aOptions = {});
   // Not implemented
   // SVGRect getStrokeBBox();
   SVGMatrix? getCTM();
   SVGMatrix? getScreenCTM();
   [Throws]
   SVGMatrix getTransformToElement(SVGGraphicsElement element);
 };
 
--- a/dom/webidl/SVGTextContentElement.webidl
+++ b/dom/webidl/SVGTextContentElement.webidl
@@ -29,14 +29,14 @@ interface SVGTextContentElement : SVGGra
   [Throws]
   SVGPoint getStartPositionOfChar(unsigned long charnum);
   [Throws]
   SVGPoint getEndPositionOfChar(unsigned long charnum);
   [NewObject, Throws]
   SVGRect getExtentOfChar(unsigned long charnum);
   [Throws]
   float getRotationOfChar(unsigned long charnum);
-  long getCharNumAtPosition(optional DOMPointInit point);
+  long getCharNumAtPosition(optional DOMPointInit point = {});
   [Throws]
   void selectSubString(unsigned long charnum, unsigned long nchars);
 };
 
 
--- a/dom/webidl/ScrollViewChangeEvent.webidl
+++ b/dom/webidl/ScrollViewChangeEvent.webidl
@@ -5,13 +5,13 @@
  */
 
 enum ScrollState {"started", "stopped"};
 
 dictionary ScrollViewChangeEventInit : EventInit {
   ScrollState state = "started";
 };
 
-[Constructor(DOMString type, optional ScrollViewChangeEventInit eventInit),
+[Constructor(DOMString type, optional ScrollViewChangeEventInit eventInit = {}),
  ChromeOnly]
 interface ScrollViewChangeEvent : Event {
   readonly attribute ScrollState state;
 };
--- a/dom/webidl/SecurityPolicyViolationEvent.webidl
+++ b/dom/webidl/SecurityPolicyViolationEvent.webidl
@@ -2,17 +2,17 @@
  * 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/. */
 
 enum SecurityPolicyViolationEventDisposition
 {
   "enforce", "report"
 };
 
-[Constructor(DOMString type, optional SecurityPolicyViolationEventInit eventInitDict)]
+[Constructor(DOMString type, optional SecurityPolicyViolationEventInit eventInitDict = {})]
 interface SecurityPolicyViolationEvent : Event
 {
     readonly attribute DOMString      documentURI;
     readonly attribute DOMString      referrer;
     readonly attribute DOMString      blockedURI;
     readonly attribute DOMString      violatedDirective;
     readonly attribute DOMString      effectiveDirective;
     readonly attribute DOMString      originalPolicy;
--- a/dom/webidl/ServiceWorker.webidl
+++ b/dom/webidl/ServiceWorker.webidl
@@ -17,17 +17,17 @@ interface ServiceWorker : EventTarget {
   readonly attribute USVString scriptURL;
   readonly attribute ServiceWorkerState state;
 
   attribute EventHandler onstatechange;
 
   [Throws]
   void postMessage(any message, sequence<object> transferable);
   [Throws]
-  void postMessage(any message, optional PostMessageOptions options);
+  void postMessage(any message, optional PostMessageOptions options = {});
 };
 
 ServiceWorker implements AbstractWorker;
 
 enum ServiceWorkerState {
   // https://github.com/w3c/ServiceWorker/issues/1162
   "parsed",
 
--- a/dom/webidl/ServiceWorkerContainer.webidl
+++ b/dom/webidl/ServiceWorkerContainer.webidl
@@ -16,17 +16,17 @@ interface ServiceWorkerContainer : Event
   // and discussion at https://etherpad.mozilla.org/serviceworker07apr
   [Unforgeable] readonly attribute ServiceWorker? controller;
 
   [Throws]
   readonly attribute Promise<ServiceWorkerRegistration> ready;
 
   [NewObject]
   Promise<ServiceWorkerRegistration> register(USVString scriptURL,
-                                              optional RegistrationOptions options);
+                                              optional RegistrationOptions options = {});
 
   [NewObject]
   Promise<any> getRegistration(optional USVString documentURL = "");
 
   [NewObject]
   Promise<sequence<ServiceWorkerRegistration>> getRegistrations();
 
   void startMessages();
--- a/dom/webidl/ServiceWorkerRegistration.webidl
+++ b/dom/webidl/ServiceWorkerRegistration.webidl
@@ -40,12 +40,12 @@ enum ServiceWorkerUpdateViaCache {
 partial interface ServiceWorkerRegistration {
   [Throws, Exposed=(Window,Worker), Pref="dom.push.enabled"]
   readonly attribute PushManager pushManager;
 };
 
 // https://notifications.spec.whatwg.org/
 partial interface ServiceWorkerRegistration {
   [Throws, Pref="dom.webnotifications.serviceworker.enabled"]
-  Promise<void> showNotification(DOMString title, optional NotificationOptions options);
+  Promise<void> showNotification(DOMString title, optional NotificationOptions options = {});
   [Throws, Pref="dom.webnotifications.serviceworker.enabled"]
-  Promise<sequence<Notification>> getNotifications(optional GetNotificationOptions filter);
+  Promise<sequence<Notification>> getNotifications(optional GetNotificationOptions filter = {});
 };
--- a/dom/webidl/SharedWorker.webidl
+++ b/dom/webidl/SharedWorker.webidl
@@ -1,12 +1,12 @@
 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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/.
  */
 
-[Constructor(USVString scriptURL, optional (DOMString or WorkerOptions) options)]
+[Constructor(USVString scriptURL, optional (DOMString or WorkerOptions) options = {})]
 interface SharedWorker : EventTarget {
     readonly attribute MessagePort port;
 };
 
 SharedWorker implements AbstractWorker;
--- a/dom/webidl/SpeechRecognitionError.webidl
+++ b/dom/webidl/SpeechRecognitionError.webidl
@@ -12,17 +12,17 @@ enum SpeechRecognitionErrorCode {
   "not-allowed",
   "service-not-allowed",
   "bad-grammar",
   "language-not-supported"
 };
 
 [Pref="media.webspeech.recognition.enable",
  Func="SpeechRecognition::IsAuthorized",
- Constructor(DOMString type, optional SpeechRecognitionErrorInit eventInitDict)]
+ Constructor(DOMString type, optional SpeechRecognitionErrorInit eventInitDict = {})]
 interface SpeechRecognitionError : Event
 {
   readonly attribute SpeechRecognitionErrorCode error;
   readonly attribute DOMString? message;
 };
 
 dictionary SpeechRecognitionErrorInit : EventInit
 {
--- a/dom/webidl/SpeechRecognitionEvent.webidl
+++ b/dom/webidl/SpeechRecognitionEvent.webidl
@@ -2,17 +2,17 @@
 /* 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/.
  */
 interface nsISupports;
 
 [Pref="media.webspeech.recognition.enable",
  Func="SpeechRecognition::IsAuthorized",
- Constructor(DOMString type, optional SpeechRecognitionEventInit eventInitDict)]
+ Constructor(DOMString type, optional SpeechRecognitionEventInit eventInitDict = {})]
 interface SpeechRecognitionEvent : Event
 {
   readonly attribute unsigned long resultIndex;
   readonly attribute SpeechRecognitionResultList? results;
   readonly attribute any interpretation;
   readonly attribute Document? emma;
 };
 
--- a/dom/webidl/StereoPannerNode.webidl
+++ b/dom/webidl/StereoPannerNode.webidl
@@ -10,16 +10,16 @@
  * liability, trademark and document use rules apply.
  */
 
 dictionary StereoPannerOptions : AudioNodeOptions {
              float pan = 0;
 };
 
 [Pref="dom.webaudio.enabled",
- Constructor(BaseAudioContext context, optional StereoPannerOptions options)]
+ Constructor(BaseAudioContext context, optional StereoPannerOptions options = {})]
 interface StereoPannerNode : AudioNode {
   readonly attribute AudioParam pan;
 };
 
 // Mozilla extension
 StereoPannerNode implements AudioNodePassThrough;
 
--- a/dom/webidl/StorageEvent.webidl
+++ b/dom/webidl/StorageEvent.webidl
@@ -5,17 +5,17 @@
  *
  * Interface for a client side storage. See
  * http://dev.w3.org/html5/webstorage/#the-storage-event
  * for more information.
  *
  * Event sent to a window when a storage area changes.
  */
 
-[Constructor(DOMString type, optional StorageEventInit eventInitDict)]
+[Constructor(DOMString type, optional StorageEventInit eventInitDict = {})]
 interface StorageEvent : Event
 {
   readonly attribute DOMString? key;
   readonly attribute DOMString? oldValue;
   readonly attribute DOMString? newValue;
   readonly attribute DOMString? url;
   readonly attribute Storage? storageArea;
 
--- a/dom/webidl/StreamFilterDataEvent.webidl
+++ b/dom/webidl/StreamFilterDataEvent.webidl
@@ -6,17 +6,17 @@
 /**
  * This is a Mozilla-specific WebExtension API, which is not available to web
  * content. It allows monitoring and filtering of HTTP response stream data.
  *
  * This API should currently be considered experimental, and is not defined by
  * any standard.
  */
 
-[Constructor(DOMString type, optional StreamFilterDataEventInit eventInitDict),
+[Constructor(DOMString type, optional StreamFilterDataEventInit eventInitDict = {}),
  Func="mozilla::extensions::StreamFilter::IsAllowedInContext",
  Exposed=Window]
 interface StreamFilterDataEvent : Event {
   /**
    * Contains a chunk of data read from the input stream.
    */
   [Pure]
   readonly attribute ArrayBuffer data;
--- a/dom/webidl/StyleRuleChangeEvent.webidl
+++ b/dom/webidl/StyleRuleChangeEvent.webidl
@@ -1,14 +1,14 @@
 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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/.
  */
-[ChromeOnly, Constructor(DOMString type, optional StyleRuleChangeEventInit eventInitDict)]
+[ChromeOnly, Constructor(DOMString type, optional StyleRuleChangeEventInit eventInitDict = {})]
 interface StyleRuleChangeEvent : Event
 {
   readonly attribute CSSStyleSheet? stylesheet;
   readonly attribute CSSRule? rule;
 };
 
 dictionary StyleRuleChangeEventInit : EventInit
 {
--- a/dom/webidl/StyleSheetApplicableStateChangeEvent.webidl
+++ b/dom/webidl/StyleSheetApplicableStateChangeEvent.webidl
@@ -1,15 +1,15 @@
 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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/.
  */
 
-[ChromeOnly, Constructor(DOMString type, optional StyleSheetApplicableStateChangeEventInit eventInitDict)]
+[ChromeOnly, Constructor(DOMString type, optional StyleSheetApplicableStateChangeEventInit eventInitDict = {})]
 interface StyleSheetApplicableStateChangeEvent : Event
 {
   readonly attribute CSSStyleSheet? stylesheet;
   readonly attribute boolean applicable;
 };
 
 dictionary StyleSheetApplicableStateChangeEventInit : EventInit
 {
--- a/dom/webidl/StyleSheetChangeEvent.webidl
+++ b/dom/webidl/StyleSheetChangeEvent.webidl
@@ -1,15 +1,15 @@
 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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/.
  */
 
-[ChromeOnly, Constructor(DOMString type, optional StyleSheetChangeEventInit eventInitDict)]
+[ChromeOnly, Constructor(DOMString type, optional StyleSheetChangeEventInit eventInitDict = {})]
 interface StyleSheetChangeEvent : Event
 {
   readonly attribute CSSStyleSheet? stylesheet;
   readonly attribute boolean documentSheet;
 };
 
 dictionary StyleSheetChangeEventInit : EventInit
 {
--- a/dom/webidl/TCPServerSocket.webidl
+++ b/dom/webidl/TCPServerSocket.webidl
@@ -8,17 +8,17 @@
  *
  * An interface to a server socket that can accept incoming connections for gaia apps.
  */
 
 dictionary ServerSocketOptions {
   TCPSocketBinaryType binaryType = "string";
 };
 
-[Constructor(unsigned short port, optional ServerSocketOptions options, optional unsigned short backlog = 0),
+[Constructor(unsigned short port, optional ServerSocketOptions options = {}, optional unsigned short backlog = 0),
  Func="mozilla::dom::TCPSocket::ShouldTCPSocketExist",
  Exposed=Window]
 interface TCPServerSocket : EventTarget {
   /**
    * The port of this server socket object.
    */
   readonly attribute unsigned short localPort;
 
--- a/dom/webidl/TCPServerSocketEvent.webidl
+++ b/dom/webidl/TCPServerSocketEvent.webidl
@@ -1,14 +1,14 @@
 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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/. */
 
-[Constructor(DOMString type, optional TCPServerSocketEventInit eventInitDict),
+[Constructor(DOMString type, optional TCPServerSocketEventInit eventInitDict = {}),
  Func="mozilla::dom::TCPSocket::ShouldTCPSocketExist",
  Exposed=Window]
 interface TCPServerSocketEvent : Event {
   readonly attribute TCPSocket socket;
 };
 
 dictionary TCPServerSocketEventInit : EventInit {
   TCPSocket? socket = null;
--- a/dom/webidl/TCPSocket.webidl
+++ b/dom/webidl/TCPSocket.webidl
@@ -28,23 +28,23 @@ enum TCPReadyState {
 };
 
 [NoInterfaceObject]
 interface LegacyMozTCPSocket {
   /**
    * Legacy constructor for API compatibility.
    */
   [Throws]
-  TCPSocket open(DOMString host, unsigned short port, optional SocketOptions options);
+  TCPSocket open(DOMString host, unsigned short port, optional SocketOptions options = {});
 
   [Throws]
-  TCPServerSocket listen(unsigned short port, optional ServerSocketOptions options, optional unsigned short backlog = 0);
+  TCPServerSocket listen(unsigned short port, optional ServerSocketOptions options = {}, optional unsigned short backlog = 0);
 };
 
-[Constructor(DOMString host, unsigned short port, optional SocketOptions options),
+[Constructor(DOMString host, unsigned short port, optional SocketOptions options = {}),
  Func="mozilla::dom::TCPSocket::ShouldTCPSocketExist",
  Exposed=Window]
 interface TCPSocket : EventTarget {
   /**
    * Upgrade an insecure connection to use TLS. Throws if the ready state is not OPEN.
    */
   [Throws] void upgradeToSecure();
 
--- a/dom/webidl/TCPSocketErrorEvent.webidl
+++ b/dom/webidl/TCPSocketErrorEvent.webidl
@@ -4,17 +4,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /* Dispatched as part of the "error" event in the following situations:
 * - if there's an error detected when the TCPSocket closes
 * - if there's an internal error while sending data
 * - if there's an error connecting to the host
 */
 
-[Constructor(DOMString type, optional TCPSocketErrorEventInit eventInitDict),
+[Constructor(DOMString type, optional TCPSocketErrorEventInit eventInitDict = {}),
  Func="mozilla::dom::TCPSocket::ShouldTCPSocketExist",
  Exposed=Window]
 interface TCPSocketErrorEvent : Event {
   readonly attribute DOMString name;
   readonly attribute DOMString message;
 };
 
 dictionary TCPSocketErrorEventInit : EventInit
--- a/dom/webidl/TCPSocketEvent.webidl
+++ b/dom/webidl/TCPSocketEvent.webidl
@@ -4,17 +4,17 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /**
  * TCPSocketEvent is the event dispatched for all of the events described by TCPSocket,
  * except the "error" event. It contains the socket that was associated with the event,
  * the type of event, and the data associated with the event if the event is a "data" event.
  */
 
-[Constructor(DOMString type, optional TCPSocketEventInit eventInitDict),
+[Constructor(DOMString type, optional TCPSocketEventInit eventInitDict = {}),
  Func="mozilla::dom::TCPSocket::ShouldTCPSocketExist",
  Exposed=Window]
 interface TCPSocketEvent : Event {
   /**
    * If the event is a "data" event, data will be the bytes read from the network;
    * if the binaryType of the socket was "arraybuffer", this value will be of type
    * ArrayBuffer, otherwise, it will be a ByteString.
    *
--- a/dom/webidl/TestInterfaceJS.webidl
+++ b/dom/webidl/TestInterfaceJS.webidl
@@ -6,30 +6,30 @@
 
 dictionary TestInterfaceJSUnionableDictionary {
   object objectMember;
   any anyMember;
 };
 
 [JSImplementation="@mozilla.org/dom/test-interface-js;1",
  Pref="dom.expose_test_interfaces",
- Constructor(optional any anyArg, optional object objectArg, optional TestInterfaceJSDictionary dictionaryArg)]
+ Constructor(optional any anyArg, optional object objectArg, optional TestInterfaceJSDictionary dictionaryArg = {})]
 interface TestInterfaceJS : EventTarget {
   readonly attribute any anyArg;
   readonly attribute object objectArg;
   TestInterfaceJSDictionary getDictionaryArg();
   attribute any anyAttr;
   attribute object objectAttr;
   TestInterfaceJSDictionary getDictionaryAttr();
-  void setDictionaryAttr(optional TestInterfaceJSDictionary dict);
+  void setDictionaryAttr(optional TestInterfaceJSDictionary dict = {});
   any pingPongAny(any arg);
   object pingPongObject(object obj);
   any pingPongObjectOrString((object or DOMString) objOrString);
-  TestInterfaceJSDictionary pingPongDictionary(optional TestInterfaceJSDictionary dict);
-  long pingPongDictionaryOrLong(optional (TestInterfaceJSUnionableDictionary or long) dictOrLong);
+  TestInterfaceJSDictionary pingPongDictionary(optional TestInterfaceJSDictionary dict = {});
+  long pingPongDictionaryOrLong(optional (TestInterfaceJSUnionableDictionary or long) dictOrLong = {});
   DOMString pingPongRecord(record<DOMString, any> rec);
   long objectSequenceLength(sequence<object> seq);
   long anySequenceLength(sequence<any> seq);
 
   // For testing bug 968335.
   DOMString getCallerPrincipal();
 
   DOMString convertSVS(USVString svs);
--- a/dom/webidl/TextDecoder.webidl
+++ b/dom/webidl/TextDecoder.webidl
@@ -5,27 +5,27 @@
  *
  * The origin of this IDL file is
  * http://encoding.spec.whatwg.org/#interface-textdecoder
  *
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
-[Constructor(optional DOMString label = "utf-8", optional TextDecoderOptions options),
+[Constructor(optional DOMString label = "utf-8", optional TextDecoderOptions options = {}),
  Exposed=(Window,Worker)]
 interface TextDecoder {
   [Constant]
   readonly attribute DOMString encoding;
   [Constant]
   readonly attribute boolean fatal;
   [Constant]
   readonly attribute boolean ignoreBOM;
   [Throws]
-  USVString decode(optional BufferSource input, optional TextDecodeOptions options);
+  USVString decode(optional BufferSource input, optional TextDecodeOptions options = {});
 };
 
 dictionary TextDecoderOptions {
   boolean fatal = false;
   boolean ignoreBOM = false;
 };
 
 dictionary TextDecodeOptions {
--- a/dom/webidl/TouchEvent.webidl
+++ b/dom/webidl/TouchEvent.webidl
@@ -5,17 +5,17 @@
  */
 
 dictionary TouchEventInit : EventModifierInit {
   sequence<Touch> touches = [];
   sequence<Touch> targetTouches = [];
   sequence<Touch> changedTouches = [];
 };
 
-[Constructor(DOMString type, optional TouchEventInit eventInitDict),
+[Constructor(DOMString type, optional TouchEventInit eventInitDict = {}),
  Func="mozilla::dom::TouchEvent::PrefEnabled"]
 interface TouchEvent : UIEvent {
   readonly attribute TouchList touches;
   readonly attribute TouchList targetTouches;
   readonly attribute TouchList changedTouches;
 
   readonly attribute boolean altKey;
   readonly attribute boolean metaKey;
--- a/dom/webidl/TrackEvent.webidl
+++ b/dom/webidl/TrackEvent.webidl
@@ -2,17 +2,17 @@
 /* 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
  * http://www.whatwg.org/specs/web-apps/current-work/#trackevent
  */
 
-[Constructor(DOMString type, optional TrackEventInit eventInitDict)]
+[Constructor(DOMString type, optional TrackEventInit eventInitDict = {})]
 interface TrackEvent : Event
 {
   readonly attribute (VideoTrack or AudioTrack or TextTrack)? track;
 };
 
 dictionary TrackEventInit : EventInit
 {
   (VideoTrack or AudioTrack or TextTrack)? track = null;
--- a/dom/webidl/TransitionEvent.webidl
+++ b/dom/webidl/TransitionEvent.webidl
@@ -6,17 +6,17 @@
  * Transition events are defined in:
  * http://www.w3.org/TR/css3-transitions/#transition-events-
  * http://dev.w3.org/csswg/css3-transitions/#transition-events-
  *
  * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
  * liability, trademark and document use rules apply.
  */
 
-[Constructor(DOMString type, optional TransitionEventInit eventInitDict)]
+[Constructor(DOMString type, optional TransitionEventInit eventInitDict = {})]
 interface TransitionEvent : Event {
   readonly attribute DOMString propertyName;
   readonly attribute float     elapsedTime;
   readonly attribute DOMString pseudoElement;
 };
 
 dictionary TransitionEventInit : EventInit {
   DOMString propertyName = "";
--- a/dom/webidl/UDPMessageEvent.webidl
+++ b/dom/webidl/UDPMessageEvent.webidl
@@ -3,17 +3,17 @@
  * 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
  * http://www.w3.org/TR/raw-sockets/#interface-udpmessageevent
  */
 
 //Bug 1056444: This interface should be removed after UDPSocket.input/UDPSocket.output are ready.
-[Constructor(DOMString type, optional UDPMessageEventInit eventInitDict),
+[Constructor(DOMString type, optional UDPMessageEventInit eventInitDict = {}),
  Pref="dom.udpsocket.enabled",
  ChromeOnly]
 interface UDPMessageEvent : Event {
     readonly    attribute DOMString      remoteAddress;
     readonly    attribute unsigned short remotePort;
     readonly    attribute any            data;
 };
 
--- a/dom/webidl/UDPSocket.webidl
+++ b/dom/webidl/UDPSocket.webidl
@@ -12,17 +12,17 @@ dictionary UDPOptions {
     DOMString      localAddress;
     unsigned short localPort;
     DOMString      remoteAddress;
     unsigned short remotePort;
     boolean        addressReuse = true;
     boolean        loopback = false;
 };
 
-[Constructor (optional UDPOptions options),
+[Constructor (optional UDPOptions options = {}),
  Pref="dom.udpsocket.enabled",
  ChromeOnly]
 interface UDPSocket : EventTarget {
     readonly    attribute DOMString?       localAddress;
     readonly    attribute unsigned short?  localPort;
     readonly    attribute DOMString?       remoteAddress;
     readonly    attribute unsigned short?  remotePort;
     readonly    attribute boolean          addressReuse;
--- a/dom/webidl/UIEvent.webidl
+++ b/dom/webidl/UIEvent.webidl
@@ -5,17 +5,17 @@
  *
  * For more information on this interface please see
  * http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html
  *
  * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
  * liability, trademark and document use rules apply.
  */
 
-[Constructor(DOMString type, optional UIEventInit eventInitDict)]
+[Constructor(DOMString type, optional UIEventInit eventInitDict = {})]
 interface UIEvent : Event
 {
   readonly attribute WindowProxy? view;
   readonly attribute long         detail;
   void initUIEvent(DOMString aType,
                    optional boolean aCanBubble = false,
                    optional boolean aCancelable = false,
                    optional Window? aView = null,
--- a/dom/webidl/UserProximityEvent.webidl
+++ b/dom/webidl/UserProximityEvent.webidl
@@ -1,15 +1,15 @@
 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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/.
  */
 
-[Pref="device.sensors.proximity.enabled", Func="nsGlobalWindowInner::DeviceSensorsEnabled", Constructor(DOMString type, optional UserProximityEventInit eventInitDict)]
+[Pref="device.sensors.proximity.enabled", Func="nsGlobalWindowInner::DeviceSensorsEnabled", Constructor(DOMString type, optional UserProximityEventInit eventInitDict = {})]
 interface UserProximityEvent : Event
 {
   readonly attribute boolean near;
 };
 
 dictionary UserProximityEventInit : EventInit
 {
   boolean near = false;
--- a/dom/webidl/WaveShaperNode.webidl
+++ b/dom/webidl/WaveShaperNode.webidl
@@ -17,17 +17,17 @@ enum OverSampleType {
 };
 
 dictionary WaveShaperOptions : AudioNodeOptions {
              sequence<float> curve;
              OverSampleType  oversample = "none";
 };
 
 [Pref="dom.webaudio.enabled",
- Constructor(BaseAudioContext context, optional WaveShaperOptions options)]
+ Constructor(BaseAudioContext context, optional WaveShaperOptions options = {})]
 interface WaveShaperNode : AudioNode {
 
       [Cached, Pure, SetterThrows]
       attribute Float32Array? curve;
       attribute OverSampleType oversample;
 
 };
 
--- a/dom/webidl/WebAuthentication.webidl
+++ b/dom/webidl/WebAuthentication.webidl
@@ -49,21 +49,21 @@ dictionary PublicKeyCredentialCreationOp
     required PublicKeyCredentialRpEntity   rp;
     required PublicKeyCredentialUserEntity user;
 
     required BufferSource                            challenge;
     required sequence<PublicKeyCredentialParameters> pubKeyCredParams;
 
     unsigned long                                timeout;
     sequence<PublicKeyCredentialDescriptor>      excludeCredentials = [];
-    // FIXME: bug 1493860: should this "= null" be here?
-    AuthenticatorSelectionCriteria               authenticatorSelection = null;
+    // FIXME: bug 1493860: should this "= {}" be here?
+    AuthenticatorSelectionCriteria               authenticatorSelection = {};
     AttestationConveyancePreference              attestation = "none";
-    // FIXME: bug 1493860: should this "= null" be here?
-    AuthenticationExtensionsClientInputs         extensions = null;
+    // FIXME: bug 1493860: should this "= {}" be here?
+    AuthenticationExtensionsClientInputs         extensions = {};
 };
 
 dictionary PublicKeyCredentialEntity {
     required DOMString    name;
     USVString             icon;
 };
 
 dictionary PublicKeyCredentialRpEntity : PublicKeyCredentialEntity {
@@ -99,18 +99,18 @@ enum UserVerificationRequirement {
 };
 
 dictionary PublicKeyCredentialRequestOptions {
     required BufferSource                challenge;
     unsigned long                        timeout;
     USVString                            rpId;
     sequence<PublicKeyCredentialDescriptor> allowCredentials = [];
     UserVerificationRequirement          userVerification = "preferred";
-    // FIXME: bug 1493860: should this "= null" be here?
-    AuthenticationExtensionsClientInputs extensions = null;
+    // FIXME: bug 1493860: should this "= {}" be here?
+    AuthenticationExtensionsClientInputs extensions = {};
 };
 
 // TODO - Use partial dictionaries when bug 1436329 is fixed.
 dictionary AuthenticationExtensionsClientInputs {
     // FIDO AppID Extension (appid)
     // <https://w3c.github.io/webauthn/#sctn-appid-extension>
     USVString appid;
 
@@ -132,18 +132,18 @@ dictionary AuthenticationExtensionsClien
 typedef record<DOMString, DOMString> AuthenticationExtensionsAuthenticatorInputs;
 
 dictionary CollectedClientData {
     required DOMString           type;
     required DOMString           challenge;
     required DOMString           origin;
     required DOMString           hashAlgorithm;
     DOMString                    tokenBindingId;
-    // FIXME: bug 1493860: should this "= null" be here?
-    AuthenticationExtensionsClientInputs clientExtensions = null;
+    // FIXME: bug 1493860: should this "= {}" be here?
+    AuthenticationExtensionsClientInputs clientExtensions = {};
     AuthenticationExtensionsAuthenticatorInputs authenticatorExtensions;
 };
 
 enum PublicKeyCredentialType {
     "public-key"
 };
 
 dictionary PublicKeyCredentialDescriptor {
--- a/dom/webidl/WebGLContextEvent.webidl
+++ b/dom/webidl/WebGLContextEvent.webidl
@@ -2,17 +2,17 @@
 /* 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://www.khronos.org/registry/webgl/specs/latest/1.0/#fire-a-webgl-context-event
  */
 
-[Constructor(DOMString type, optional WebGLContextEventInit eventInit),
+[Constructor(DOMString type, optional WebGLContextEventInit eventInit = {}),
  Exposed=(Window,Worker),
  Func="mozilla::dom::OffscreenCanvas::PrefEnabledOnWorkerThread"]
 interface WebGLContextEvent : Event {
   readonly attribute DOMString statusMessage;
 };
 
 // EventInit is defined in the DOM4 specification.
 dictionary WebGLContextEventInit : EventInit {
--- a/dom/webidl/WebGPU.webidl
+++ b/dom/webidl/WebGPU.webidl
@@ -115,17 +115,17 @@ dictionary WebGPUTextureDescriptor {
     u32 arraySize;
     WebGPUTextureDimensionEnum dimension;
     WebGPUTextureFormatEnum format;
     WebGPUTextureUsageFlags usage;
 };
 
 [Pref="dom.webgpu.enable"]
 interface WebGPUTexture {
-    WebGPUTextureView createTextureView(optional WebGPUTextureViewDescriptor desc);
+    WebGPUTextureView createTextureView(optional WebGPUTextureViewDescriptor desc = {});
 };
 
 // Sampler
 typedef u32 WebGPUFilterModeEnum;
 [Pref="dom.webgpu.enable"]
 interface WebGPUFilterMode {
     const u32 NEAREST = 0;
     const u32 LINEAR = 1;
@@ -508,17 +508,17 @@ interface WebGPUCommandEncoder {
 
     // Compute pass commands
     void beginComputePass();
     void endComputePass();
 
     void dispatch(u32 x, u32 y, u32 z);
 
     // Render pass commands
-    void beginRenderPass(optional WebGPURenderPassDescriptor descriptor);
+    void beginRenderPass(optional WebGPURenderPassDescriptor descriptor = {});
     void endRenderPass();
 
     void setBlendColor(float r, float g, float b, float a);
     void setIndexBuffer(WebGPUBuffer buffer, u32 offset);
     void setVertexBuffers(u32 startSlot, sequence<WebGPUBuffer> buffers, sequence<u32> offsets);
 
     void draw(u32 vertexCount, u32 instanceCount, u32 firstVertex, u32 firstInstance);
     void drawIndexed(u32 indexCount, u32 instanceCount, u32 firstIndex, u32 firstInstance, u32 firstVertex);
@@ -549,17 +549,17 @@ dictionary WebGPUSwapChainDescriptor {
     WebGPUTextureUsageFlags usage;
     WebGPUTextureFormatEnum format;
     u32 width;
     u32 height;
 };
 
 [Pref="dom.webgpu.enable"]
 interface WebGPUSwapChain {
-    void configure(optional WebGPUSwapChainDescriptor descriptor);
+    void configure(optional WebGPUSwapChainDescriptor descriptor = {});
     WebGPUTexture getNextTexture();
     void present();
 };
 
 //[Pref="dom.webgpu.enable"]
 //interface WebGPURenderingContext : WebGPUSwapChain {
 //};
 
@@ -575,33 +575,33 @@ dictionary WebGPULimits {
 
 // Device
 [Pref="dom.webgpu.enable"]
 interface WebGPUDevice {
     readonly attribute WebGPUAdapter adapter;
     WebGPUExtensions extensions();
     WebGPULimits limits();
 
-    WebGPUBuffer createBuffer(optional WebGPUBufferDescriptor descriptor);
-    WebGPUTexture createTexture(optional WebGPUTextureDescriptor descriptor);
-    WebGPUSampler createSampler(optional WebGPUSamplerDescriptor descriptor);
+    WebGPUBuffer createBuffer(optional WebGPUBufferDescriptor descriptor = {});
+    WebGPUTexture createTexture(optional WebGPUTextureDescriptor descriptor = {});
+    WebGPUSampler createSampler(optional WebGPUSamplerDescriptor descriptor = {});
 
-    WebGPUBindGroupLayout createBindGroupLayout(optional WebGPUBindGroupLayoutDescriptor descriptor);
-    WebGPUPipelineLayout createPipelineLayout(optional WebGPUPipelineLayoutDescriptor descriptor);
-    WebGPUBindGroup createBindGroup(optional WebGPUBindGroupDescriptor descriptor);
+    WebGPUBindGroupLayout createBindGroupLayout(optional WebGPUBindGroupLayoutDescriptor descriptor = {});
+    WebGPUPipelineLayout createPipelineLayout(optional WebGPUPipelineLayoutDescriptor descriptor = {});
+    WebGPUBindGroup createBindGroup(optional WebGPUBindGroupDescriptor descriptor = {});
 
-    WebGPUBlendState createBlendState(optional WebGPUBlendStateDescriptor descriptor);
-    WebGPUDepthStencilState createDepthStencilState(optional WebGPUDepthStencilStateDescriptor descriptor);
-    WebGPUInputState createInputState(optional WebGPUInputStateDescriptor descriptor);
+    WebGPUBlendState createBlendState(optional WebGPUBlendStateDescriptor descriptor = {});
+    WebGPUDepthStencilState createDepthStencilState(optional WebGPUDepthStencilStateDescriptor descriptor = {});
+    WebGPUInputState createInputState(optional WebGPUInputStateDescriptor descriptor = {});
     WebGPUShaderModule createShaderModule(WebGPUShaderModuleDescriptor descriptor);
-    WebGPUAttachmentState createAttachmentState(optional WebGPUAttachmentStateDescriptor descriptor);
+    WebGPUAttachmentState createAttachmentState(optional WebGPUAttachmentStateDescriptor descriptor = {});
     WebGPUComputePipeline createComputePipeline(WebGPUComputePipelineDescriptor descriptor);
     WebGPURenderPipeline createRenderPipeline(WebGPURenderPipelineDescriptor descriptor);
 
-    WebGPUCommandEncoder createCommandEncoder(optional WebGPUCommandEncoderDescriptor descriptor);
+    WebGPUCommandEncoder createCommandEncoder(optional WebGPUCommandEncoderDescriptor descriptor = {});
 
     WebGPUQueue getQueue();
 
     attribute WebGPULogCallback onLog;
     Promise<WebGPUObjectStatus> getObjectStatus(WebGPUStatusable obj);
 };
 
 dictionary WebGPUDeviceDescriptor {
@@ -612,28 +612,28 @@ dictionary WebGPUDeviceDescriptor {
 };
 
 [Pref="dom.webgpu.enable"]
 interface WebGPUAdapter {
     readonly attribute DOMString name;
     WebGPUExtensions extensions();
     //WebGPULimits limits(); Don't expose higher limits for now.
 
-    WebGPUDevice createDevice(optional WebGPUDeviceDescriptor descriptor);
+    WebGPUDevice createDevice(optional WebGPUDeviceDescriptor descriptor = {});
 };
 
 enum WebGPUPowerPreference { "default", "low-power", "high-performance" };
 
 dictionary WebGPUAdapterDescriptor {
     WebGPUPowerPreference powerPreference;
 };
 
 [Pref="dom.webgpu.enable"]
 interface WebGPU {
-    WebGPUAdapter getAdapter(optional WebGPUAdapterDescriptor desc);
+    WebGPUAdapter getAdapter(optional WebGPUAdapterDescriptor desc = {});
 };
 
 // Add a "webgpu" member to Window that contains the global instance of a "WebGPU"
 [NoInterfaceObject]
 interface WebGPUProvider {
     [SameObject, Replaceable, Pref="dom.webgpu.enable"] readonly attribute WebGPU webgpu;
 };
 //Window includes WebGPUProvider;
--- a/dom/webidl/WebrtcDeprecated.webidl
+++ b/dom/webidl/WebrtcDeprecated.webidl
@@ -7,23 +7,23 @@
  *
  * The declaration of each should match the declaration of the real, unprefixed
  * interface.  These aliases will be removed at some point (Bug 1155923).
  */
 
 [Deprecated="WebrtcDeprecatedPrefix",
  Pref="media.peerconnection.enabled",
  JSImplementation="@mozilla.org/dom/rtcicecandidate;1",
- Constructor(optional RTCIceCandidateInit candidateInitDict)]
+ Constructor(optional RTCIceCandidateInit candidateInitDict = {})]
 interface mozRTCIceCandidate : RTCIceCandidate {};
 
 [Deprecated="WebrtcDeprecatedPrefix",
  Pref="media.peerconnection.enabled",
  JSImplementation="@mozilla.org/dom/peerconnection;1",
- Constructor (optional RTCConfiguration configuration,
+ Constructor (optional RTCConfiguration configuration = {},
               optional object? constraints)]
 interface mozRTCPeerConnection : RTCPeerConnection {};
 
 [Deprecated="WebrtcDeprecatedPrefix",
  Pref="media.peerconnection.enabled",
  JSImplementation="@mozilla.org/dom/rtcsessiondescription;1",
- Constructor(optional RTCSessionDescriptionInit descriptionInitDict)]
+ Constructor(optional RTCSessionDescriptionInit descriptionInitDict = {})]
 interface mozRTCSessionDescription : RTCSessionDescription {};
--- a/dom/webidl/WheelEvent.webidl
+++ b/dom/webidl/WheelEvent.webidl
@@ -5,17 +5,17 @@
  *
  * For more information on this interface please see
  * http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html
  *
  * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
  * liability, trademark and document use rules apply.
  */
 
-[Constructor(DOMString type, optional WheelEventInit eventInitDict)]
+[Constructor(DOMString type, optional WheelEventInit eventInitDict = {})]
 interface WheelEvent : MouseEvent
 {
   const unsigned long DOM_DELTA_PIXEL = 0x00;
   const unsigned long DOM_DELTA_LINE  = 0x01;
   const unsigned long DOM_DELTA_PAGE  = 0x02;
 
   readonly attribute double        deltaX;
   readonly attribute double        deltaY;
--- a/dom/webidl/Window.webidl
+++ b/dom/webidl/Window.webidl
@@ -79,17 +79,17 @@ typedef OfflineResourceList ApplicationC
   [Throws, NeedsSubjectPrincipal] boolean confirm(optional DOMString message = "");
   [Throws, NeedsSubjectPrincipal] DOMString? prompt(optional DOMString message = "", optional DOMString default = "");
   [Throws, Func="nsGlobalWindowInner::IsWindowPrintEnabled"]
   void print();
 
   [Throws, CrossOriginCallable, NeedsSubjectPrincipal]
   void postMessage(any message, DOMString targetOrigin, optional sequence<object> transfer = []);
   [Throws, CrossOriginCallable, NeedsSubjectPrincipal]
-  void postMessage(any message, optional WindowPostMessageOptions options);
+  void postMessage(any message, optional WindowPostMessageOptions options = {});
 
   // also has obsolete members
 };
 Window implements GlobalEventHandlers;
 Window implements WindowEventHandlers;
 
 // https://www.w3.org/TR/appmanifest/#onappinstalled-attribute
 partial interface Window {
@@ -166,21 +166,21 @@ partial interface Window {
   // like a [Replaceable] attribute would, which needs the original JS value.
   //[Replaceable, Throws] readonly attribute double innerWidth;
   //[Replaceable, Throws] readonly attribute double innerHeight;
   [Throws, NeedsCallerType] attribute any innerWidth;
   [Throws, NeedsCallerType] attribute any innerHeight;
 
   // viewport scrolling
   void scroll(unrestricted double x, unrestricted double y);
-  void scroll(optional ScrollToOptions options);
+  void scroll(optional ScrollToOptions options = {});
   void scrollTo(unrestricted double x, unrestricted double y);
-  void scrollTo(optional ScrollToOptions options);
+  void scrollTo(optional ScrollToOptions options = {});
   void scrollBy(unrestricted double x, unrestricted double y);
-  void scrollBy(optional ScrollToOptions options);
+  void scrollBy(optional ScrollToOptions options = {});
   // mozScrollSnap is used by chrome to perform scroll snapping after the
   // user performs actions that may affect scroll position
   // mozScrollSnap is deprecated, to be replaced by a web accessible API, such
   // as an extension to the ScrollOptions dictionary.  See bug 1137937.
   [ChromeOnly] void mozScrollSnap();
   // The four properties below are double per spec at the moment, but whether
   // that will continue is unclear.
   [Replaceable, Throws] readonly attribute double scrollX;
@@ -238,22 +238,22 @@ Window implements SpeechSynthesisGetter;
 partial interface Window {
   //[NewObject, Throws] CSSStyleDeclaration getDefaultComputedStyle(Element elt, optional DOMString pseudoElt = "");
   [NewObject, Throws] CSSStyleDeclaration? getDefaultComputedStyle(Element elt, optional DOMString pseudoElt = "");
 
   // Mozilla extensions
   /**
    * Method for scrolling this window by a number of lines.
    */
-  void                      scrollByLines(long numLines, optional ScrollOptions options);
+  void                      scrollByLines(long numLines, optional ScrollOptions options = {});
 
   /**
    * Method for scrolling this window by a number of pages.
    */
-  void                      scrollByPages(long numPages, optional ScrollOptions options);
+  void                      scrollByPages(long numPages, optional ScrollOptions options = {});
 
   /**
    * Method for sizing this window to the content in the window.
    */
   [Throws, NeedsCallerType] void sizeToContent();
 
   // XXX Shouldn't this be in nsIDOMChromeWindow?
   [ChromeOnly, Replaceable, Throws] readonly attribute XULControllers controllers;
@@ -542,17 +542,17 @@ partial interface Window {
     readonly attribute Worklet paintWorklet;
 };
 
 Window implements WindowOrWorkerGlobalScope;
 
 partial interface Window {
   [Throws, Func="nsGlobalWindowInner::IsRequestIdleCallbackEnabled"]
   unsigned long requestIdleCallback(IdleRequestCallback callback,
-                                    optional IdleRequestOptions options);
+                                    optional IdleRequestOptions options = {});
   [Func="nsGlobalWindowInner::IsRequestIdleCallbackEnabled"]
   void          cancelIdleCallback(unsigned long handle);
 };
 
 dictionary IdleRequestOptions {
   unsigned long timeout;
 };
 
--- a/dom/webidl/WindowOrWorkerGlobalScope.webidl
+++ b/dom/webidl/WindowOrWorkerGlobalScope.webidl
@@ -43,17 +43,17 @@ interface WindowOrWorkerGlobalScope {
   Promise<ImageBitmap> createImageBitmap(ImageBitmapSource aImage);
   [Throws]
   Promise<ImageBitmap> createImageBitmap(ImageBitmapSource aImage, long aSx, long aSy, long aSw, long aSh);
 };
 
 // https://fetch.spec.whatwg.org/#fetch-method
 partial interface WindowOrWorkerGlobalScope {
   [NewObject, NeedsCallerType]
-  Promise<Response> fetch(RequestInfo input, optional RequestInit init);
+  Promise<Response> fetch(RequestInfo input, optional RequestInit init = {});
 };
 
 // https://w3c.github.io/webappsec-secure-contexts/#monkey-patching-global-object
 partial interface WindowOrWorkerGlobalScope {
   readonly attribute boolean isSecureContext;
 };
 
 // http://w3c.github.io/IndexedDB/#factory-interface
--- a/dom/webidl/Worker.webidl
+++ b/dom/webidl/Worker.webidl
@@ -7,25 +7,25 @@
  * https://html.spec.whatwg.org/multipage/workers.html
  *
  * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and Opera
  * Software ASA.
  * You are granted a license to use, reproduce and create derivative works of
  * this document.
  */
 
-[Constructor(USVString scriptURL, optional WorkerOptions options),
+[Constructor(USVString scriptURL, optional WorkerOptions options = {}),
  Exposed=(Window,DedicatedWorker,SharedWorker)]
 interface Worker : EventTarget {
   void terminate();
 
   [Throws]
   void postMessage(any message, sequence<object> transfer);
   [Throws]
-  void postMessage(any message, optional PostMessageOptions aOptions);
+  void postMessage(any message, optional PostMessageOptions aOptions = {});
 
   attribute EventHandler onmessage;
   attribute EventHandler onmessageerror;
 };
 
 Worker implements AbstractWorker;
 
 dictionary WorkerOptions {
--- a/dom/webidl/Worklet.webidl
+++ b/dom/webidl/Worklet.webidl
@@ -5,14 +5,14 @@
  *
  * The origin of this IDL file is
  * https://drafts.css-houdini.org/worklets/#idl-index
  */
 
 [Pref="dom.worklet.enabled"]
 interface Worklet {
   [NewObject, Throws, NeedsCallerType]
-  Promise<void> addModule(USVString moduleURL, optional WorkletOptions options);
+  Promise<void> addModule(USVString moduleURL, optional WorkletOptions options = {});
 };
 
 dictionary WorkletOptions {
   RequestCredentials credentials = "same-origin";
 };
--- a/dom/webidl/XMLHttpRequest.webidl
+++ b/dom/webidl/XMLHttpRequest.webidl
@@ -37,17 +37,17 @@ dictionary MozXMLHttpRequestParameters
   boolean mozAnon = false;
 
   /**
    * If true, the same origin policy will not be enforced on the request.
    */
   boolean mozSystem = false;
 };
 
-[Constructor(optional MozXMLHttpRequestParameters params),
+[Constructor(optional MozXMLHttpRequestParameters params = {}),
  // There are apparently callers, specifically CoffeeScript, who do
  // things like this:
  //   c = new(window.ActiveXObject || XMLHttpRequest)("Microsoft.XMLHTTP")
  // To handle that, we need a constructor that takes a string.
  Constructor(DOMString ignored),
  Exposed=(Window,DedicatedWorker,SharedWorker)]
 interface XMLHttpRequest : XMLHttpRequestEventTarget {
   // event handler
@@ -121,17 +121,17 @@ interface XMLHttpRequest : XMLHttpReques
 
   [ChromeOnly, Exposed=Window]
   readonly attribute MozChannel? channel;
 
   [Throws, ChromeOnly, Exposed=Window]
   any getInterface(any iid);
 
   [ChromeOnly, Exposed=Window]
-  void setOriginAttributes(optional OriginAttributesDictionary originAttributes);
+  void setOriginAttributes(optional OriginAttributesDictionary originAttributes = {});
 
   [ChromeOnly, Throws]
   void sendInputStream(InputStream body);
 
   // Only works on MainThread.
   // Its permanence is to be evaluated in bug 1368540 for Firefox 60.
   [ChromeOnly]
   readonly attribute unsigned short errorCode;
--- a/dom/webidl/XULPopupElement.webidl
+++ b/dom/webidl/XULPopupElement.webidl
@@ -60,17 +60,17 @@ interface XULPopupElement : XULElement
    * @param options either options to use, or a string position
    * @param x horizontal offset
    * @param y vertical offset
    * @param isContextMenu true for context menus, false for other popups
    * @param attributesOverride true if popup node attributes override position
    * @param triggerEvent the event that triggered this popup (mouse click for example)
    */
   void openPopup(optional Element? anchorElement = null,
-                 optional StringOrOpenPopupOptions options,
+                 optional StringOrOpenPopupOptions options = {},
                  optional long x = 0,
                  optional long y = 0,
                  optional boolean isContextMenu = false,
                  optional boolean attributesOverride = false,
                  optional Event? triggerEvent = null);
 
   /**
    * Open the popup at a specific screen position specified by x and y. This