Bug 1330699 part 9. Rename "MozMap" to "record" in our IDL parser and IDL files. r=qdot
authorBoris Zbarsky <bzbarsky@mit.edu>
Wed, 15 Feb 2017 00:00:17 -0500
changeset 484463 60560ecf6ee31630e7d557b219c961f0340ad6c9
parent 484462 52a24f98f12a23e67463ab60bd7a737b355df255
child 484464 794f653f1de6458ad59fa59fbeb2992fcdaed7e0
push id45482
push userbmo:kmckinley@mozilla.com
push dateWed, 15 Feb 2017 09:52:37 +0000
reviewersqdot
bugs1330699
milestone54.0a1
Bug 1330699 part 9. Rename "MozMap" to "record" in our IDL parser and IDL files. r=qdot The key type is unused so far.
dom/bindings/Codegen.py
dom/bindings/Configuration.py
dom/bindings/parser/WebIDL.py
dom/bindings/parser/tests/test_distinguishability.py
dom/bindings/parser/tests/test_mozmap.py
dom/bindings/parser/tests/test_record.py
dom/bindings/test/TestBindingHeader.h
dom/bindings/test/TestCodeGen.webidl
dom/bindings/test/TestExampleGen.webidl
dom/bindings/test/TestJSImplGen.webidl
dom/fetch/Headers.cpp
dom/fetch/Headers.h
dom/webidl/Headers.webidl
dom/webidl/InstallTrigger.webidl
dom/webidl/TestInterfaceJS.webidl
--- a/dom/bindings/Codegen.py
+++ b/dom/bindings/Codegen.py
@@ -79,17 +79,17 @@ def idlTypeNeedsCycleCollection(type):
         type.isAny() or
         type.isObject() or
         type.isSpiderMonkeyInterface()):
         return False
     elif type.isCallback() or type.isGeckoInterface():
         return True
     elif type.isUnion():
         return any(idlTypeNeedsCycleCollection(t) for t in type.flatMemberTypes)
-    elif type.isMozMap():
+    elif type.isRecord():
         if idlTypeNeedsCycleCollection(type.inner):
             raise TypeError("Cycle collection for type %s is not supported" % type)
         return False
     elif type.isDictionary():
         if any(idlTypeNeedsCycleCollection(m.type) for m in type.inner.members):
             raise TypeError("Cycle collection for type %s is not supported" % type)
         return False
     else:
@@ -1158,17 +1158,17 @@ class CGHeaders(CGWrapper):
                 # Restricted floats are tested for finiteness
                 bindingHeaders.add("mozilla/FloatingPoint.h")
                 bindingHeaders.add("mozilla/dom/PrimitiveConversions.h")
             elif unrolled.isEnum():
                 filename = self.getDeclarationFilename(unrolled.inner)
                 declareIncludes.add(filename)
             elif unrolled.isPrimitive():
                 bindingHeaders.add("mozilla/dom/PrimitiveConversions.h")
-            elif unrolled.isMozMap():
+            elif unrolled.isRecord():
                 if dictionary or jsImplementedDescriptors:
                     declareIncludes.add("mozilla/dom/MozMap.h")
                 else:
                     bindingHeaders.add("mozilla/dom/MozMap.h")
                 # Also add headers for the type the MozMap is
                 # parametrized over, if needed.
                 addHeadersForType((t.inner, dictionary))
 
@@ -1385,17 +1385,17 @@ def UnionTypes(unionTypes, config):
                     headers.add(CGHeaders.getDeclarationFilename(f.inner))
                 elif f.isPrimitive():
                     implheaders.add("mozilla/dom/PrimitiveConversions.h")
                 elif f.isCallback():
                     # Callbacks always use strong refs, so we need to include
                     # the right header to be able to Release() in our inlined
                     # code.
                     headers.add(CGHeaders.getDeclarationFilename(f.callback))
-                elif f.isMozMap():
+                elif f.isRecord():
                     headers.add("mozilla/dom/MozMap.h")
                     # And add headers for the type we're parametrized over
                     addHeadersForType(f.inner)
 
             implheaders.add(CGHeaders.getUnionDeclarationFilename(config, t))
             for f in t.flatMemberTypes:
                 assert not f.nullable()
                 addHeadersForType(f)
@@ -1453,17 +1453,17 @@ def UnionConversions(unionTypes, config)
                 elif f.isDictionary():
                     headers.add(CGHeaders.getDeclarationFilename(f.inner))
                 elif f.isFloat() and not f.isUnrestricted():
                     # Restricted floats are tested for finiteness
                     headers.add("mozilla/FloatingPoint.h")
                     headers.add("mozilla/dom/PrimitiveConversions.h")
                 elif f.isPrimitive():
                     headers.add("mozilla/dom/PrimitiveConversions.h")
-                elif f.isMozMap():
+                elif f.isRecord():
                     headers.add("mozilla/dom/MozMap.h")
                     # And the internal type of the MozMap
                     addHeadersForType(f.inner)
 
             # We plan to include UnionTypes.h no matter what, so it's
             # OK if we throw it into the set here.
             headers.add(CGHeaders.getUnionDeclarationFilename(config, t))
 
@@ -4825,17 +4825,17 @@ def getJSToNativeConversionInfo(type, de
             holderType = None
             holderArgs = None
 
         return JSToNativeConversionInfo(templateBody, declType=typeName,
                                         holderType=holderType,
                                         dealWithOptional=isOptional,
                                         holderArgs=holderArgs)
 
-    if type.isMozMap():
+    if type.isRecord():
         assert not isEnforceRange and not isClamp
         if failureCode is None:
             notMozMap = ('ThrowErrorMessage(cx, MSG_NOT_OBJECT, "%s");\n'
                          "%s" % (firstCap(sourceDescription), exceptionCode))
         else:
             notMozMap = failureCode
 
         nullable = type.nullable()
@@ -5031,17 +5031,17 @@ def getJSToNativeConversionInfo(type, de
             name = getUnionMemberName(dictionaryMemberTypes[0])
             setDictionary = CGGeneric(
                 "done = (failed = !%s.TrySetTo%s(cx, ${val}, tryNext, ${passedToJSImpl})) || !tryNext;\n" %
                 (unionArgumentObj, name))
             names.append(name)
         else:
             setDictionary = None
 
-        mozMapMemberTypes = filter(lambda t: t.isMozMap(), memberTypes)
+        mozMapMemberTypes = filter(lambda t: t.isRecord(), memberTypes)
         if len(mozMapMemberTypes) > 0:
             assert len(mozMapMemberTypes) == 1
             name = getUnionMemberName(mozMapMemberTypes[0])
             mozMapObject = CGGeneric(
                 "done = (failed = !%s.TrySetTo%s(cx, ${val}, tryNext, ${passedToJSImpl})) || !tryNext;\n" %
                 (unionArgumentObj, name))
             names.append(name)
         else:
@@ -6447,17 +6447,17 @@ def getWrapTemplateForType(type, descrip
             """,
             wrapCall=wrapCall,
             failureCode=failureCode,
             successCode=successCode)
 
     if type is None or type.isVoid():
         return (setUndefined(), True)
 
-    if (type.isSequence() or type.isMozMap()) and type.nullable():
+    if (type.isSequence() or type.isRecord()) and type.nullable():
         # These are both wrapped in Nullable<>
         recTemplate, recInfall = getWrapTemplateForType(type.inner, descriptorProvider,
                                                         "%s.Value()" % result, successCode,
                                                         returnsNewObject, exceptionCode,
                                                         typedArraysAreStructs)
         code = fill(
             """
 
@@ -6520,17 +6520,17 @@ def getWrapTemplateForType(type, descrip
             result=result,
             exceptionCode=exceptionCode,
             index=index,
             innerTemplate=innerTemplate,
             set=setObject("*returnArray"))
 
         return (code, False)
 
-    if type.isMozMap():
+    if type.isRecord():
         # Now do non-nullable MozMap.  Our success code is just to break to
         # where we define the property on the object.  Note that we bump the
         # mozMapWrapLevel around this call so that nested MozMap conversions
         # will use different temp value names.
         global mozMapWrapLevel
         valueName = "mozMapValue%d" % mozMapWrapLevel
         mozMapWrapLevel += 1
         innerTemplate = wrapForType(
@@ -6860,17 +6860,17 @@ def typeNeedsScopeObject(type, retVal=Fa
                              lambda t: leafTypeNeedsScopeObject(t, retVal))
 
 
 def typeMatchesLambda(type, func):
     if type is None:
         return False
     if type.nullable():
         return typeMatchesLambda(type.inner, func)
-    if type.isSequence() or type.isMozMap():
+    if type.isSequence() or type.isRecord():
         return typeMatchesLambda(type.inner, func)
     if type.isUnion():
         return any(typeMatchesLambda(t, func) for t in
                    type.unroll().flatMemberTypes)
     if type.isDictionary():
         return dictionaryMatchesLambda(type.inner, func)
     return func(type)
 
@@ -6959,17 +6959,17 @@ def getRetvalDeclarationForType(returnTy
             rooter = CGGeneric("SequenceRooter<%s > resultRooter(cx, &result);\n" %
                                result.define())
         else:
             rooter = None
         result = CGTemplatedType("nsTArray", result)
         if nullable:
             result = CGTemplatedType("Nullable", result)
         return result, "ref", rooter, None, None
-    if returnType.isMozMap():
+    if returnType.isRecord():
         nullable = returnType.nullable()
         if nullable:
             returnType = returnType.inner
         result, _, _, _, _ = getRetvalDeclarationForType(returnType.inner,
                                                          descriptorProvider,
                                                          isMember="MozMap")
         # While we have our inner type, set up our rooter, if needed
         if not isMember and typeNeedsRooting(returnType):
@@ -7077,17 +7077,17 @@ class CGCallGenerator(CGThing):
             arg = CGGeneric(name)
 
             # Now constify the things that need it
             def needsConst(a):
                 if a.type.isDictionary():
                     return True
                 if a.type.isSequence():
                     return True
-                if a.type.isMozMap():
+                if a.type.isRecord():
                     return True
                 # isObject() types are always a JS::Rooted, whether
                 # nullable or not, and it turns out a const JS::Rooted
                 # is not very helpful at all (in particular, it won't
                 # even convert to a JS::Handle).
                 # XXX bz Well, why not???
                 if a.type.nullable() and not a.type.isObject():
                     return True
@@ -7295,17 +7295,17 @@ def wrapTypeIntoCurrentCompartment(type,
         wrapCode = CGWrapper(CGIndenter(wrapElement),
                              pre=("for (uint32_t %s = 0; %s < %s.Length(); ++%s) {\n" %
                                   (index, index, value, index)),
                              post="}\n")
         if origType.nullable():
             wrapCode = CGIfWrapper(wrapCode, "!%s.IsNull()" % origValue)
         return wrapCode
 
-    if type.isMozMap():
+    if type.isRecord():
         origType = type
         if type.nullable():
             type = type.inner
             mozMapRef = "%s.Value()" % value
         else:
             mozMapRef = value
         global mapWrapLevel
         entryRef = "mapEntry%d" % mapWrapLevel
@@ -8157,17 +8157,17 @@ class CGMethodCall(CGThing):
             objectSigs.extend(s for s in possibleSignatures
                               if distinguishingType(s).isSequence())
 
             # Now append all the overloads that take a dictionary or callback
             # interface or MozMap.  There should be only one of these!
             genericObjectSigs = [
                 s for s in possibleSignatures
                 if (distinguishingType(s).isDictionary() or
-                    distinguishingType(s).isMozMap() or
+                    distinguishingType(s).isRecord() or
                     distinguishingType(s).isCallbackInterface())]
             assert len(genericObjectSigs) <= 1
             objectSigs.extend(genericObjectSigs)
 
             # There might be more than one thing in objectSigs; we need to check
             # which ones we unwrap to.
             if len(objectSigs) > 0:
                 # Here it's enough to guard on our argument being an object. The
@@ -9552,17 +9552,17 @@ class CGMemberJITInfo(CGThing):
         if t.nullable():
             # Sometimes it might return null, sometimes not
             return "JSVAL_TYPE_UNKNOWN"
         if t.isVoid():
             # No return, every time
             return "JSVAL_TYPE_UNDEFINED"
         if t.isSequence():
             return "JSVAL_TYPE_OBJECT"
-        if t.isMozMap():
+        if t.isRecord():
             return "JSVAL_TYPE_OBJECT"
         if t.isPromise():
             return "JSVAL_TYPE_OBJECT"
         if t.isGeckoInterface():
             return "JSVAL_TYPE_OBJECT"
         if t.isString():
             return "JSVAL_TYPE_STRING"
         if t.isEnum():
@@ -9831,17 +9831,17 @@ def getUnionAccessorSignatureType(type, 
     """
     # Flat member types have already unwrapped nullables.
     assert not type.nullable()
 
     # Promise types can never appear in unions, because Promise is not
     # distinguishable from anything.
     assert not type.isPromise()
 
-    if type.isSequence() or type.isMozMap():
+    if type.isSequence() or type.isRecord():
         if type.isSequence():
             wrapperType = "Sequence"
         else:
             wrapperType = "MozMap"
         # We don't use the returned template here, so it's OK to just pass no
         # sourceDescription.
         elementInfo = getJSToNativeConversionInfo(type.inner,
                                                   descriptorProvider,
@@ -10196,17 +10196,17 @@ class CGUnionStruct(CGThing):
                         CGCase("e" + vars["name"],
                                CGGeneric("mValue.m%s.Value().TraceDictionary(trc);\n" %
                                          vars["name"])))
                 elif t.isSequence():
                     traceCases.append(
                         CGCase("e" + vars["name"],
                                CGGeneric("DoTraceSequence(trc, mValue.m%s.Value());\n" %
                                          vars["name"])))
-                elif t.isMozMap():
+                elif t.isRecord():
                     traceCases.append(
                         CGCase("e" + vars["name"],
                                CGGeneric("TraceMozMap(trc, mValue.m%s.Value());\n" %
                                          vars["name"])))
                 else:
                     assert t.isSpiderMonkeyInterface()
                     traceCases.append(
                         CGCase("e" + vars["name"],
@@ -13350,17 +13350,17 @@ class CGDictionary(CGThing):
                 trace = CGGeneric('%s.TraceDictionary(trc);\n' % memberData)
             elif type.isUnion():
                 trace = CGGeneric('%s.TraceUnion(trc);\n' % memberData)
             else:
                 assert type.isSpiderMonkeyInterface()
                 trace = CGGeneric('%s.TraceSelf(trc);\n' % memberData)
             if type.nullable():
                 trace = CGIfWrapper(trace, "!%s.IsNull()" % memberNullable)
-        elif type.isMozMap():
+        elif type.isRecord():
             # If you implement this, add a MozMap<object> to
             # TestInterfaceJSDictionary and test it in test_bug1036214.html
             # to make sure we end up with the correct security properties.
             assert False
         else:
             assert False  # unknown type
 
         if member.canHaveMissingValue():
@@ -13763,17 +13763,17 @@ class ForwardDeclarationBuilder:
             self.addInMozillaDom(t.inner.identifier.name, isStruct=True)
         elif t.isCallbackInterface():
             self.addInMozillaDom(t.inner.identifier.name)
         elif t.isUnion():
             # Forward declare both the owning and non-owning version,
             # since we don't know which one we might want
             self.addInMozillaDom(CGUnionStruct.unionTypeName(t, False))
             self.addInMozillaDom(CGUnionStruct.unionTypeName(t, True))
-        elif t.isMozMap():
+        elif t.isRecord():
             self.forwardDeclareForType(t.inner, config)
         # Don't need to do anything for void, primitive, string, any or object.
         # There may be some other cases we are missing.
 
 
 class CGForwardDeclarations(CGWrapper):
     """
     Code generate the forward declarations for a header file.
@@ -14272,17 +14272,17 @@ class CGNativeMember(ClassMethod):
                       aRetVal.SetNull();
                     } else {
                       aRetVal.SetValue().SwapElements(${declName}.Value());
                     }
                     """)
             else:
                 returnCode = "aRetVal.SwapElements(${declName});\n"
             return "void", "", returnCode
-        if type.isMozMap():
+        if type.isRecord():
             # If we want to handle MozMap-of-MozMap return values, we're
             # going to need to fix example codegen to not produce MozMap<void>
             # for the relevant argument...
             assert not isMember
             # In this case we convert directly into our outparam to start with
             return "void", "", ""
         if type.isDate():
             result = CGGeneric("Date")
@@ -14322,17 +14322,17 @@ class CGNativeMember(ClassMethod):
             if nullable:
                 returnType = returnType.inner
             # And now the actual underlying type
             elementDecl = self.getReturnType(returnType.inner, True)
             type = CGTemplatedType("nsTArray", CGGeneric(elementDecl))
             if nullable:
                 type = CGTemplatedType("Nullable", type)
             args.append(Argument("%s&" % type.define(), "aRetVal"))
-        elif returnType.isMozMap():
+        elif returnType.isRecord():
             nullable = returnType.nullable()
             if nullable:
                 returnType = returnType.inner
             # And now the actual underlying type
             elementDecl = self.getReturnType(returnType.inner, True)
             type = CGTemplatedType("MozMap", CGGeneric(elementDecl))
             if nullable:
                 type = CGTemplatedType("Nullable", type)
@@ -14403,17 +14403,17 @@ class CGNativeMember(ClassMethod):
             nullable = type.nullable()
             if nullable:
                 type = type.inner
             elementType = type.inner
             argType = self.getArgType(elementType, False, "Sequence")[0]
             decl = CGTemplatedType("Sequence", argType)
             return decl.define(), True, True
 
-        if type.isMozMap():
+        if type.isRecord():
             nullable = type.nullable()
             if nullable:
                 type = type.inner
             elementType = type.inner
             argType = self.getArgType(elementType, False, "MozMap")[0]
             decl = CGTemplatedType("MozMap", argType)
             return decl.define(), True, True
 
--- a/dom/bindings/Configuration.py
+++ b/dom/bindings/Configuration.py
@@ -138,17 +138,17 @@ class Configuration(DescriptorProvider):
         # in multiple files then it will be added to the list for the
         # None key. Note that the list contains a type for every use
         # of a union type, so there can be multiple entries with union
         # types that have the same name.
         self.unionsPerFilename = defaultdict(list)
 
         for (t, _) in getAllTypes(self.descriptors, self.dictionaries, self.callbacks):
             while True:
-                if t.isMozMap():
+                if t.isRecord():
                     t = t.inner
                 elif t.unroll() != t:
                     t = t.unroll()
                 elif t.isPromise():
                     t = t.promiseInnerType()
                 else:
                     break
             if t.isUnion():
--- a/dom/bindings/parser/WebIDL.py
+++ b/dom/bindings/parser/WebIDL.py
@@ -1881,17 +1881,17 @@ class IDLDictionary(IDLObjectWithScope):
                     the memberType argument, to the dictionary being validated,
                     if the boolean value in the first element is True.
 
                     None, if the boolean value in the first element is False.
             """
 
             if (memberType.nullable() or
                 memberType.isSequence() or
-                memberType.isMozMap()):
+                memberType.isRecord()):
                 return typeContainsDictionary(memberType.inner, dictionary)
 
             if memberType.isDictionary():
                 if memberType.inner == dictionary:
                     return (True, [memberType.location])
 
                 (contains, locations) = dictionaryContainsDictionary(memberType.inner,
                                                                      dictionary)
@@ -2002,17 +2002,17 @@ class IDLType(IDLObject):
         'void',
         # Funny stuff
         'interface',
         'dictionary',
         'enum',
         'callback',
         'union',
         'sequence',
-        'mozmap',
+        'record',
         'promise',
         )
 
     def __init__(self, location, name):
         IDLObject.__init__(self, location)
         self.name = name
         self.builtin = False
 
@@ -2053,17 +2053,17 @@ class IDLType(IDLObject):
         return False
 
     def isVoid(self):
         return self.name == "Void"
 
     def isSequence(self):
         return False
 
-    def isMozMap(self):
+    def isRecord(self):
         return False
 
     def isArrayBuffer(self):
         return False
 
     def isArrayBufferView(self):
         return False
 
@@ -2274,18 +2274,18 @@ class IDLNullableType(IDLParametrizedTyp
         return self.inner.isInteger()
 
     def isVoid(self):
         return False
 
     def isSequence(self):
         return self.inner.isSequence()
 
-    def isMozMap(self):
-        return self.inner.isMozMap()
+    def isRecord(self):
+        return self.inner.isRecord()
 
     def isArrayBuffer(self):
         return self.inner.isArrayBuffer()
 
     def isArrayBufferView(self):
         return self.inner.isArrayBufferView()
 
     def isSharedArrayBuffer(self):
@@ -2412,44 +2412,48 @@ class IDLSequenceType(IDLParametrizedTyp
         if other.isPromise():
             return False
         if other.isUnion():
             # Just forward to the union; it'll deal
             return other.isDistinguishableFrom(self)
         return (other.isPrimitive() or other.isString() or other.isEnum() or
                 other.isDate() or other.isInterface() or
                 other.isDictionary() or
-                other.isCallback() or other.isMozMap())
-
-
-class IDLMozMapType(IDLParametrizedType):
-    def __init__(self, location, parameterType):
-        assert not parameterType.isVoid()
-
-        IDLParametrizedType.__init__(self, location, parameterType.name, parameterType)
+                other.isCallback() or other.isRecord())
+
+
+class IDLRecordType(IDLParametrizedType):
+    def __init__(self, location, keyType, valueType):
+        assert keyType.isString()
+        assert keyType.isComplete()
+        assert not valueType.isVoid()
+
+        IDLParametrizedType.__init__(self, location, valueType.name, valueType)
+        self.keyType = keyType
+
         # Need to set self.name up front if our inner type is already complete,
         # since in that case our .complete() won't be called.
         if self.inner.isComplete():
-            self.name = self.inner.name + "MozMap"
+            self.name = self.keyType.name + self.inner.name + "Record"
 
     def __eq__(self, other):
-        return isinstance(other, IDLMozMapType) and self.inner == other.inner
+        return isinstance(other, IDLRecordType) and self.inner == other.inner
 
     def __str__(self):
-        return self.inner.__str__() + "MozMap"
-
-    def isMozMap(self):
+        return self.keyType.__str__() + self.inner.__str__() + "Record"
+
+    def isRecord(self):
         return True
 
     def tag(self):
-        return IDLType.Tags.mozmap
+        return IDLType.Tags.record
 
     def complete(self, scope):
         self.inner = self.inner.complete(scope)
-        self.name = self.inner.name + "MozMap"
+        self.name = self.keyType.name + self.inner.name + "Record"
         return self
 
     def unroll(self):
         # We do not unroll our inner.  Just stop at ourselves.  That
         # lets us add headers for both ourselves and our inner as
         # needed.
         return self
 
@@ -2629,18 +2633,18 @@ class IDLTypedefType(IDLType):
         return self.inner.isUSVString()
 
     def isVoid(self):
         return self.inner.isVoid()
 
     def isSequence(self):
         return self.inner.isSequence()
 
-    def isMozMap(self):
-        return self.inner.isMozMap()
+    def isRecord(self):
+        return self.inner.isRecord()
 
     def isDictionary(self):
         return self.inner.isDictionary()
 
     def isArrayBuffer(self):
         return self.inner.isArrayBuffer()
 
     def isArrayBufferView(self):
@@ -2801,17 +2805,17 @@ class IDLWrapperType(IDLType):
             return False
         if other.isUnion():
             # Just forward to the union; it'll deal
             return other.isDistinguishableFrom(self)
         assert self.isInterface() or self.isEnum() or self.isDictionary()
         if self.isEnum():
             return (other.isPrimitive() or other.isInterface() or other.isObject() or
                     other.isCallback() or other.isDictionary() or
-                    other.isSequence() or other.isMozMap() or other.isDate())
+                    other.isSequence() or other.isRecord() or other.isDate())
         if self.isDictionary() and other.nullable():
             return False
         if (other.isPrimitive() or other.isString() or other.isEnum() or
             other.isDate() or other.isSequence()):
             return True
         if self.isDictionary():
             return other.isNonCallbackInterface()
 
@@ -2823,17 +2827,17 @@ class IDLWrapperType(IDLType):
             assert self.isGeckoInterface() and other.isGeckoInterface()
             if self.inner.isExternal() or other.unroll().inner.isExternal():
                 return self != other
             return (len(self.inner.interfacesBasedOnSelf &
                         other.unroll().inner.interfacesBasedOnSelf) == 0 and
                     (self.isNonCallbackInterface() or
                      other.isNonCallbackInterface()))
         if (other.isDictionary() or other.isCallback() or
-            other.isMozMap()):
+            other.isRecord()):
             return self.isNonCallbackInterface()
 
         # Not much else |other| can be
         assert other.isObject()
         return False
 
     def isExposedInAllOf(self, exposureSet):
         if not self.isInterface():
@@ -3068,45 +3072,45 @@ class IDLBuiltinType(IDLType):
             return False
         if other.isUnion():
             # Just forward to the union; it'll deal
             return other.isDistinguishableFrom(self)
         if self.isBoolean():
             return (other.isNumeric() or other.isString() or other.isEnum() or
                     other.isInterface() or other.isObject() or
                     other.isCallback() or other.isDictionary() or
-                    other.isSequence() or other.isMozMap() or other.isDate())
+                    other.isSequence() or other.isRecord() or other.isDate())
         if self.isNumeric():
             return (other.isBoolean() or other.isString() or other.isEnum() or
                     other.isInterface() or other.isObject() or
                     other.isCallback() or other.isDictionary() or
-                    other.isSequence() or other.isMozMap() or other.isDate())
+                    other.isSequence() or other.isRecord() or other.isDate())
         if self.isString():
             return (other.isPrimitive() or other.isInterface() or
                     other.isObject() or
                     other.isCallback() or other.isDictionary() or
-                    other.isSequence() or other.isMozMap() or other.isDate())
+                    other.isSequence() or other.isRecord() or other.isDate())
         if self.isAny():
             # Can't tell "any" apart from anything
             return False
         if self.isObject():
             return other.isPrimitive() or other.isString() or other.isEnum()
         if self.isDate():
             return (other.isPrimitive() or other.isString() or other.isEnum() or
                     other.isInterface() or other.isCallback() or
                     other.isDictionary() or other.isSequence() or
-                    other.isMozMap())
+                    other.isRecord())
         if self.isVoid():
             return not other.isVoid()
         # Not much else we could be!
         assert self.isSpiderMonkeyInterface()
         # Like interfaces, but we know we're not a callback
         return (other.isPrimitive() or other.isString() or other.isEnum() or
                 other.isCallback() or other.isDictionary() or
-                other.isSequence() or other.isMozMap() or other.isDate() or
+                other.isSequence() or other.isRecord() or other.isDate() or
                 (other.isInterface() and (
                  # ArrayBuffer is distinguishable from everything
                  # that's not an ArrayBuffer or a callback interface
                  (self.isArrayBuffer() and not other.isArrayBuffer()) or
                  (self.isSharedArrayBuffer() and not other.isSharedArrayBuffer()) or
                  # ArrayBufferView is distinguishable from everything
                  # that's not an ArrayBufferView or typed array.
                  (self.isArrayBufferView() and not other.isArrayBufferView() and
@@ -3881,18 +3885,18 @@ class IDLConst(IDLInterfaceMember):
     def __init__(self, location, identifier, type, value):
         IDLInterfaceMember.__init__(self, location, identifier,
                                     IDLInterfaceMember.Tags.Const)
 
         assert isinstance(type, IDLType)
         if type.isDictionary():
             raise WebIDLError("A constant cannot be of a dictionary type",
                               [self.location])
-        if type.isMozMap():
-            raise WebIDLError("A constant cannot be of a MozMap type",
+        if type.isRecord():
+            raise WebIDLError("A constant cannot be of a record type",
                               [self.location])
         self.type = type
         self.value = value
 
         if identifier.name == "prototype":
             raise WebIDLError("The identifier of a constant must not be 'prototype'",
                               [location])
 
@@ -3995,38 +3999,38 @@ class IDLAttribute(IDLInterfaceMember):
             self.type = t
 
         if self.type.isDictionary() and not self.getExtendedAttribute("Cached"):
             raise WebIDLError("An attribute cannot be of a dictionary type",
                               [self.location])
         if self.type.isSequence() and not self.getExtendedAttribute("Cached"):
             raise WebIDLError("A non-cached attribute cannot be of a sequence "
                               "type", [self.location])
-        if self.type.isMozMap() and not self.getExtendedAttribute("Cached"):
-            raise WebIDLError("A non-cached attribute cannot be of a MozMap "
+        if self.type.isRecord() and not self.getExtendedAttribute("Cached"):
+            raise WebIDLError("A non-cached attribute cannot be of a record "
                               "type", [self.location])
         if self.type.isUnion():
             for f in self.type.unroll().flatMemberTypes:
                 if f.isDictionary():
                     raise WebIDLError("An attribute cannot be of a union "
                                       "type if one of its member types (or "
                                       "one of its member types's member "
                                       "types, and so on) is a dictionary "
                                       "type", [self.location, f.location])
                 if f.isSequence():
                     raise WebIDLError("An attribute cannot be of a union "
                                       "type if one of its member types (or "
                                       "one of its member types's member "
                                       "types, and so on) is a sequence "
                                       "type", [self.location, f.location])
-                if f.isMozMap():
+                if f.isRecord():
                     raise WebIDLError("An attribute cannot be of a union "
                                       "type if one of its member types (or "
                                       "one of its member types's member "
-                                      "types, and so on) is a MozMap "
+                                      "types, and so on) is a record "
                                       "type", [self.location, f.location])
         if not self.type.isInterface() and self.getExtendedAttribute("PutForwards"):
             raise WebIDLError("An attribute with [PutForwards] must have an "
                               "interface type as its type", [self.location])
 
         if (not self.type.isInterface() and
             self.getExtendedAttribute("SameObject")):
             raise WebIDLError("An attribute with [SameObject] must have an "
@@ -4035,17 +4039,17 @@ class IDLAttribute(IDLInterfaceMember):
         if self.type.isPromise() and not self.readonly:
             raise WebIDLError("Promise-returning attributes must be readonly",
                               [self.location])
 
     def validate(self):
         def typeContainsChromeOnlyDictionaryMember(type):
             if (type.nullable() or
                 type.isSequence() or
-                type.isMozMap()):
+                type.isRecord()):
                 return typeContainsChromeOnlyDictionaryMember(type.inner)
 
             if type.isUnion():
                 for memberType in type.flatMemberTypes:
                     (contains, location) = typeContainsChromeOnlyDictionaryMember(memberType)
                     if contains:
                         return (True, location)
 
@@ -4081,20 +4085,20 @@ class IDLAttribute(IDLInterfaceMember):
             (contains, location) = typeContainsChromeOnlyDictionaryMember(self.type)
             if contains:
                 raise WebIDLError("[Cached] and [StoreInSlot] must not be used "
                                   "on an attribute whose type contains a "
                                   "[ChromeOnly] dictionary member",
                                   [self.location, location])
         if self.getExtendedAttribute("Frozen"):
             if (not self.type.isSequence() and not self.type.isDictionary() and
-                not self.type.isMozMap()):
+                not self.type.isRecord()):
                 raise WebIDLError("[Frozen] is only allowed on "
                                   "sequence-valued, dictionary-valued, and "
-                                  "MozMap-valued attributes",
+                                  "record-valued attributes",
                                   [self.location])
         if not self.type.unroll().isExposedInAllOf(self.exposureSet):
             raise WebIDLError("Attribute returns a type that is not exposed "
                               "everywhere where the attribute is exposed",
                               [self.location])
 
     def handleExtendedAttribute(self, attr):
         identifier = attr.identifier()
@@ -5221,17 +5225,17 @@ class Tokenizer(object):
         "double": "DOUBLE",
         "float": "FLOAT",
         "long": "LONG",
         "object": "OBJECT",
         "octet": "OCTET",
         "Promise": "PROMISE",
         "required": "REQUIRED",
         "sequence": "SEQUENCE",
-        "MozMap": "MOZMAP",
+        "record": "RECORD",
         "short": "SHORT",
         "unsigned": "UNSIGNED",
         "void": "VOID",
         ":": "COLON",
         ";": "SEMICOLON",
         "{": "LBRACE",
         "}": "RBRACE",
         "(": "LPAREN",
@@ -6350,17 +6354,17 @@ class Parser(Tokenizer):
                   | INTERFACE
                   | LONG
                   | MODULE
                   | NULL
                   | OBJECT
                   | OCTET
                   | OPTIONAL
                   | SEQUENCE
-                  | MOZMAP
+                  | RECORD
                   | SETTER
                   | SHORT
                   | STATIC
                   | STRINGIFIER
                   | JSONIFIER
                   | TRUE
                   | TYPEDEF
                   | UNSIGNED
@@ -6467,23 +6471,24 @@ class Parser(Tokenizer):
     # Note: Promise<void> is allowed, so we want to parametrize on ReturnType,
     # not Type.  Promise types can't be null, hence no "Null" in there.
     def p_NonAnyTypePromiseType(self, p):
         """
             NonAnyType : PROMISE LT ReturnType GT
         """
         p[0] = IDLPromiseType(self.getLocation(p, 1), p[3])
 
-    def p_NonAnyTypeMozMapType(self, p):
-        """
-            NonAnyType : MOZMAP LT Type GT Null
-        """
-        innerType = p[3]
-        type = IDLMozMapType(self.getLocation(p, 1), innerType)
-        p[0] = self.handleNullable(type, p[5])
+    def p_NonAnyTypeRecordType(self, p):
+        """
+            NonAnyType : RECORD LT StringType COMMA Type GT Null
+        """
+        keyType = p[3]
+        valueType = p[5]
+        type = IDLRecordType(self.getLocation(p, 1), keyType, valueType)
+        p[0] = self.handleNullable(type, p[7])
 
     def p_NonAnyTypeScopedName(self, p):
         """
             NonAnyType : ScopedName Null
         """
         assert isinstance(p[1], IDLUnresolvedIdentifier)
 
         if p[1].name == "Promise":
--- a/dom/bindings/parser/tests/test_distinguishability.py
+++ b/dom/bindings/parser/tests/test_distinguishability.py
@@ -153,17 +153,19 @@ def WebIDLTest(parser, harness):
     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>",
-                 "MozMap<object>", "MozMap<Dict>", "MozMap<long>",
+                 "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)",
     ]
     # When we can parse Date, we need to add it here.
     # XXXbz we can, and should really do that...
@@ -191,17 +193,18 @@ def WebIDLTest(parser, harness):
                   "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)
-    mozMaps = [ "MozMap<object>", "MozMap<Dict>", "MozMap<long>" ]
+    records = [ "record<DOMString, object>", "record<USVString, Dict>",
+                "record<ByteString, long>" ]
 
     # Build a representation of the distinguishability table as a dict
     # of dicts, holding True values where needed, holes elsewhere.
     data = dict();
     for type in argTypes:
         data[type] = dict()
     def setDistinguishable(type, types):
         for other in types:
@@ -231,19 +234,19 @@ def WebIDLTest(parser, harness):
     setDistinguishable("Callback", nonUserObjects)
     setDistinguishable("Callback2", nonUserObjects)
     setDistinguishable("optional Dict", allBut(nonUserObjects, nullables))
     setDistinguishable("optional Dict2", allBut(nonUserObjects, nullables))
     setDistinguishable("sequence<long>",
                        allBut(argTypes, sequences + ["object"]))
     setDistinguishable("sequence<short>",
                        allBut(argTypes, sequences + ["object"]))
-    setDistinguishable("MozMap<object>", nonUserObjects)
-    setDistinguishable("MozMap<Dict>", nonUserObjects)
-    setDistinguishable("MozMap<long>", nonUserObjects)
+    setDistinguishable("record<DOMString, object>", nonUserObjects)
+    setDistinguishable("record<USVString, Dict>", nonUserObjects)
+    setDistinguishable("record<ByteString, long>", nonUserObjects)
     setDistinguishable("Date", allBut(argTypes, dates + ["object"]))
     setDistinguishable("Date?", allBut(argTypes, dates + nullables + ["object"]))
     setDistinguishable("any", [])
     setDistinguishable("Promise<any>", [])
     setDistinguishable("Promise<any>?", [])
     setDistinguishable("ArrayBuffer", allBut(argTypes, ["ArrayBuffer", "object"]))
     setDistinguishable("ArrayBufferView", allBut(argTypes, ["ArrayBufferView", "Uint8Array", "Uint16Array", "object"]))
     setDistinguishable("Uint8Array", allBut(argTypes, ["ArrayBufferView", "Uint8Array", "object"]))
rename from dom/bindings/parser/tests/test_mozmap.py
rename to dom/bindings/parser/tests/test_record.py
--- a/dom/bindings/parser/tests/test_mozmap.py
+++ b/dom/bindings/parser/tests/test_record.py
@@ -1,39 +1,53 @@
 import WebIDL
 
 def WebIDLTest(parser, harness):
     parser.parse("""
         dictionary Dict {};
-        interface MozMapArg {
-          void foo(MozMap<Dict> arg);
+        interface RecordArg {
+          void foo(record<DOMString, Dict> arg);
         };
     """)
 
     results = parser.finish()
 
     harness.check(len(results), 2, "Should know about two things");
     harness.ok(isinstance(results[1], WebIDL.IDLInterface),
                "Should have an interface here");
     members = results[1].members
     harness.check(len(members), 1, "Should have one member")
     harness.ok(members[0].isMethod(), "Should have method")
     signature = members[0].signatures()[0]
     args = signature[1]
     harness.check(len(args), 1, "Should have one arg")
-    harness.ok(args[0].type.isMozMap(), "Should have a MozMap type here")
+    harness.ok(args[0].type.isRecord(), "Should have a record type here")
     harness.ok(args[0].type.inner.isDictionary(),
                "Should have a dictionary inner type")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
-            interface MozMapVoidArg {
-              void foo(MozMap<void> arg);
+            interface RecordVoidArg {
+              void foo(record<DOMString, void> arg);
             };
         """)
 
         results = parser.finish()
     except Exception,x:
         threw = True
+    harness.ok(threw, "Should have thrown because record can't have void as value type.")
+ 
+    parser = parser.reset()
+    threw = False
+    try:
+        parser.parse("""
+            dictionary Dict {
+              record<DOMString, Dict> val;
+            };
+        """)
 
-    harness.ok(threw, "Should have thrown.")
+        results = parser.finish()
+    except Exception,x:
+        threw = True
+    harness.ok(threw,
+               "Should have thrown on dictionary containing itself via record.")
--- a/dom/bindings/test/TestBindingHeader.h
+++ b/dom/bindings/test/TestBindingHeader.h
@@ -165,17 +165,17 @@ public:
                                         const Sequence<Dict>&,
                                         JS::Handle<JS::Value>,
                                         const Optional<JS::Handle<JSObject*> >&,
                                         const Optional<JS::Handle<JSObject*> >&,
                                         ErrorResult&);
 
   static
   already_AddRefed<TestInterface> Test3(const GlobalObject&,
-                                        const LongOrAnyMozMap&,
+                                        const LongOrStringAnyRecord&,
                                         ErrorResult&);
 
   static
   already_AddRefed<TestInterface> Test4(const GlobalObject&,
                                         const MozMap<MozMap<JS::Value>>&,
                                         ErrorResult&);
 
   static
@@ -660,29 +660,29 @@ public:
   void PassUnion13(JSContext*, const ObjectOrLongOrNull& arg);
   void PassUnion14(JSContext*, const ObjectOrLongOrNull& arg);
   void PassUnion15(const LongSequenceOrLong&);
   void PassUnion16(const Optional<LongSequenceOrLong>&);
   void PassUnion17(const LongSequenceOrNullOrLong&);
   void PassUnion18(JSContext*, const ObjectSequenceOrLong&);
   void PassUnion19(JSContext*, const Optional<ObjectSequenceOrLong>&);
   void PassUnion20(JSContext*, const ObjectSequenceOrLong&);
-  void PassUnion21(const LongMozMapOrLong&);
-  void PassUnion22(JSContext*, const ObjectMozMapOrLong&);
+  void PassUnion21(const StringLongRecordOrLong&);
+  void PassUnion22(JSContext*, const StringObjectRecordOrLong&);
   void PassUnion23(const ImageDataSequenceOrLong&);
   void PassUnion24(const ImageDataOrNullSequenceOrLong&);
   void PassUnion25(const ImageDataSequenceSequenceOrLong&);
   void PassUnion26(const ImageDataOrNullSequenceSequenceOrLong&);
   void PassUnion27(const StringSequenceOrEventInit&);
   void PassUnion28(const EventInitOrStringSequence&);
   void PassUnionWithCallback(const EventHandlerNonNullOrNullOrLong& arg);
   void PassUnionWithByteString(const ByteStringOrLong&);
-  void PassUnionWithMozMap(const StringMozMapOrString&);
-  void PassUnionWithMozMapAndSequence(const StringMozMapOrStringSequence&);
-  void PassUnionWithSequenceAndMozMap(const StringSequenceOrStringMozMap&);
+  void PassUnionWithMozMap(const StringStringRecordOrString&);
+  void PassUnionWithMozMapAndSequence(const StringStringRecordOrStringSequence&);
+  void PassUnionWithSequenceAndMozMap(const StringSequenceOrStringStringRecord&);
   void PassUnionWithUSVS(const USVStringOrLong&);
 #endif
   void PassNullableUnion(JSContext*, const Nullable<ObjectOrLong>&);
   void PassOptionalUnion(JSContext*, const Optional<ObjectOrLong>&);
   void PassOptionalNullableUnion(JSContext*, const Optional<Nullable<ObjectOrLong> >&);
   void PassOptionalNullableUnionWithDefaultValue(JSContext*, const Nullable<ObjectOrLong>&);
   //void PassUnionWithInterfaces(const TestInterfaceOrTestExternalInterface& arg);
   //void PassUnionWithInterfacesAndNullable(const TestInterfaceOrNullOrTestExternalInterface& arg);
--- a/dom/bindings/test/TestCodeGen.webidl
+++ b/dom/bindings/test/TestCodeGen.webidl
@@ -17,27 +17,27 @@ interface TestRenamedInterface {
 
 callback interface TestCallbackInterface {
   readonly attribute long foo;
   attribute DOMString bar;
   void doSomething();
   long doSomethingElse(DOMString arg, TestInterface otherArg);
   void doSequenceLongArg(sequence<long> arg);
   void doSequenceStringArg(sequence<DOMString> arg);
-  void doMozMapLongArg(MozMap<long> arg);
+  void doMozMapLongArg(record<DOMString, long> arg);
   sequence<long> getSequenceOfLong();
   sequence<TestInterface> getSequenceOfInterfaces();
   sequence<TestInterface>? getNullableSequenceOfInterfaces();
   sequence<TestInterface?> getSequenceOfNullableInterfaces();
   sequence<TestInterface?>? getNullableSequenceOfNullableInterfaces();
   sequence<TestCallbackInterface> getSequenceOfCallbackInterfaces();
   sequence<TestCallbackInterface>? getNullableSequenceOfCallbackInterfaces();
   sequence<TestCallbackInterface?> getSequenceOfNullableCallbackInterfaces();
   sequence<TestCallbackInterface?>? getNullableSequenceOfNullableCallbackInterfaces();
-  MozMap<long> getMozMapOfLong();
+  record<DOMString, long> getMozMapOfLong();
   Dict? getDictionary();
   void passArrayBuffer(ArrayBuffer arg);
   void passNullableArrayBuffer(ArrayBuffer? arg);
   void passOptionalArrayBuffer(optional ArrayBuffer arg);
   void passOptionalNullableArrayBuffer(optional ArrayBuffer? arg);
   void passOptionalNullableArrayBufferWithDefaultValue(optional ArrayBuffer? arg= null);
   void passArrayBufferView(ArrayBufferView arg);
   void passInt8Array(Int8Array arg);
@@ -135,20 +135,20 @@ interface OnlyForUseInConstructor {
  Constructor(ArrayBuffer arrayBuf),
  Constructor(Uint8Array typedArr),
  // Constructor(long arg1, long arg2, (TestInterface or OnlyForUseInConstructor) arg3),
  NamedConstructor=Test,
  NamedConstructor=Test(DOMString str),
  NamedConstructor=Test2(DictForConstructor dict, any any1, object obj1,
                         object? obj2, sequence<Dict> seq, optional any any2,
                         optional object obj3, optional object? obj4),
- NamedConstructor=Test3((long or MozMap<any>) arg1),
- NamedConstructor=Test4(MozMap<MozMap<any>> arg1),
- NamedConstructor=Test5(MozMap<sequence<MozMap<MozMap<sequence<sequence<any>>>>>> arg1),
- NamedConstructor=Test6(sequence<MozMap<sequence<sequence<MozMap<MozMap<any>>>>>> arg1),
+ NamedConstructor=Test3((long or record<DOMString, any>) arg1),
+ NamedConstructor=Test4(record<DOMString, record<DOMString, any>> arg1),
+ NamedConstructor=Test5(record<DOMString, sequence<record<DOMString, record<DOMString, sequence<sequence<any>>>>>> arg1),
+ NamedConstructor=Test6(sequence<record<ByteString, sequence<sequence<record<ByteString, record<USVString, any>>>>>> arg1),
  ]
 interface TestInterface {
   // Integer types
   // XXXbz add tests for throwing versions of all the integer stuff
   readonly attribute byte readonlyByte;
   attribute byte writableByte;
   void passByte(byte arg);
   byte receiveByte();
@@ -414,40 +414,40 @@ interface TestInterface {
   sequence<object?> receiveNullableObjectSequence();
 
   void passSequenceOfSequences(sequence<sequence<long>> arg);
   void passSequenceOfSequencesOfSequences(sequence<sequence<sequence<long>>> arg);
   sequence<sequence<long>> receiveSequenceOfSequences();
   sequence<sequence<sequence<long>>> receiveSequenceOfSequencesOfSequences();
 
   // MozMap types
-  void passMozMap(MozMap<long> arg);
-  void passNullableMozMap(MozMap<long>? arg);
-  void passMozMapOfNullableInts(MozMap<long?> arg);
-  void passOptionalMozMapOfNullableInts(optional MozMap<long?> arg);
-  void passOptionalNullableMozMapOfNullableInts(optional MozMap<long?>? arg);
-  void passCastableObjectMozMap(MozMap<TestInterface> arg);
-  void passNullableCastableObjectMozMap(MozMap<TestInterface?> arg);
-  void passCastableObjectNullableMozMap(MozMap<TestInterface>? arg);
-  void passNullableCastableObjectNullableMozMap(MozMap<TestInterface?>? arg);
-  void passOptionalMozMap(optional MozMap<long> arg);
-  void passOptionalNullableMozMap(optional MozMap<long>? arg);
-  void passOptionalNullableMozMapWithDefaultValue(optional MozMap<long>? arg = null);
-  void passOptionalObjectMozMap(optional MozMap<TestInterface> arg);
-  void passExternalInterfaceMozMap(MozMap<TestExternalInterface> arg);
-  void passNullableExternalInterfaceMozMap(MozMap<TestExternalInterface?> arg);
-  void passStringMozMap(MozMap<DOMString> arg);
-  void passByteStringMozMap(MozMap<ByteString> arg);
-  void passMozMapOfMozMaps(MozMap<MozMap<long>> arg);
-  MozMap<long> receiveMozMap();
-  MozMap<long>? receiveNullableMozMap();
-  MozMap<long?> receiveMozMapOfNullableInts();
-  MozMap<long?>? receiveNullableMozMapOfNullableInts();
-  MozMap<MozMap<long>> receiveMozMapOfMozMaps();
-  MozMap<any> receiveAnyMozMap();
+  void passMozMap(record<DOMString, long> arg);
+  void passNullableMozMap(record<DOMString, long>? arg);
+  void passMozMapOfNullableInts(record<DOMString, long?> arg);
+  void passOptionalMozMapOfNullableInts(optional record<DOMString, long?> arg);
+  void passOptionalNullableMozMapOfNullableInts(optional record<DOMString, long?>? arg);
+  void passCastableObjectMozMap(record<DOMString, TestInterface> arg);
+  void passNullableCastableObjectMozMap(record<DOMString, TestInterface?> arg);
+  void passCastableObjectNullableMozMap(record<DOMString, TestInterface>? arg);
+  void passNullableCastableObjectNullableMozMap(record<DOMString, TestInterface?>? arg);
+  void passOptionalMozMap(optional record<DOMString, long> arg);
+  void passOptionalNullableMozMap(optional record<DOMString, long>? arg);
+  void passOptionalNullableMozMapWithDefaultValue(optional record<DOMString, long>? arg = null);
+  void passOptionalObjectMozMap(optional record<DOMString, TestInterface> arg);
+  void passExternalInterfaceMozMap(record<DOMString, TestExternalInterface> arg);
+  void passNullableExternalInterfaceMozMap(record<DOMString, TestExternalInterface?> arg);
+  void passStringMozMap(record<DOMString, DOMString> arg);
+  void passByteStringMozMap(record<DOMString, ByteString> arg);
+  void passMozMapOfMozMaps(record<DOMString, record<DOMString, long>> arg);
+  record<DOMString, long> receiveMozMap();
+  record<DOMString, long>? receiveNullableMozMap();
+  record<DOMString, long?> receiveMozMapOfNullableInts();
+  record<DOMString, long?>? receiveNullableMozMapOfNullableInts();
+  record<DOMString, record<DOMString, long>> receiveMozMapOfMozMaps();
+  record<DOMString, any> receiveAnyMozMap();
 
   // Typed array types
   void passArrayBuffer(ArrayBuffer arg);
   void passNullableArrayBuffer(ArrayBuffer? arg);
   void passOptionalArrayBuffer(optional ArrayBuffer arg);
   void passOptionalNullableArrayBuffer(optional ArrayBuffer? arg);
   void passOptionalNullableArrayBufferWithDefaultValue(optional ArrayBuffer? arg= null);
   void passArrayBufferView(ArrayBufferView arg);
@@ -457,18 +457,18 @@ interface TestInterface {
   void passUint8Array(Uint8Array arg);
   void passUint16Array(Uint16Array arg);
   void passUint32Array(Uint32Array arg);
   void passUint8ClampedArray(Uint8ClampedArray arg);
   void passFloat32Array(Float32Array arg);
   void passFloat64Array(Float64Array arg);
   void passSequenceOfArrayBuffers(sequence<ArrayBuffer> arg);
   void passSequenceOfNullableArrayBuffers(sequence<ArrayBuffer?> arg);
-  void passMozMapOfArrayBuffers(MozMap<ArrayBuffer> arg);
-  void passMozMapOfNullableArrayBuffers(MozMap<ArrayBuffer?> arg);
+  void passMozMapOfArrayBuffers(record<DOMString, ArrayBuffer> arg);
+  void passMozMapOfNullableArrayBuffers(record<DOMString, ArrayBuffer?> arg);
   void passVariadicTypedArray(Float32Array... arg);
   void passVariadicNullableTypedArray(Float32Array?... arg);
   Uint8Array receiveUint8Array();
   attribute Uint8Array uint8ArrayAttr;
 
   // DOMString types
   void passString(DOMString arg);
   void passNullableString(DOMString? arg);
@@ -563,43 +563,43 @@ interface TestInterface {
   void passNullableSequenceOfAny(sequence<any>? arg);
   void passOptionalSequenceOfAny(optional sequence<any> arg);
   void passOptionalNullableSequenceOfAny(optional sequence<any>? arg);
   void passOptionalSequenceOfAnyWithDefaultValue(optional sequence<any>? arg = null);
   void passSequenceOfSequenceOfAny(sequence<sequence<any>> arg);
   void passSequenceOfNullableSequenceOfAny(sequence<sequence<any>?> arg);
   void passNullableSequenceOfNullableSequenceOfAny(sequence<sequence<any>?>? arg);
   void passOptionalNullableSequenceOfNullableSequenceOfAny(optional sequence<sequence<any>?>? arg);
-  void passMozMapOfAny(MozMap<any> arg);
-  void passNullableMozMapOfAny(MozMap<any>? arg);
-  void passOptionalMozMapOfAny(optional MozMap<any> arg);
-  void passOptionalNullableMozMapOfAny(optional MozMap<any>? arg);
-  void passOptionalMozMapOfAnyWithDefaultValue(optional MozMap<any>? arg = null);
-  void passMozMapOfMozMapOfAny(MozMap<MozMap<any>> arg);
-  void passMozMapOfNullableMozMapOfAny(MozMap<MozMap<any>?> arg);
-  void passNullableMozMapOfNullableMozMapOfAny(MozMap<MozMap<any>?>? arg);
-  void passOptionalNullableMozMapOfNullableMozMapOfAny(optional MozMap<MozMap<any>?>? arg);
-  void passOptionalNullableMozMapOfNullableSequenceOfAny(optional MozMap<sequence<any>?>? arg);
-  void passOptionalNullableSequenceOfNullableMozMapOfAny(optional sequence<MozMap<any>?>? arg);
+  void passMozMapOfAny(record<DOMString, any> arg);
+  void passNullableMozMapOfAny(record<DOMString, any>? arg);
+  void passOptionalMozMapOfAny(optional record<DOMString, any> arg);
+  void passOptionalNullableMozMapOfAny(optional record<DOMString, any>? arg);
+  void passOptionalMozMapOfAnyWithDefaultValue(optional record<DOMString, any>? arg = null);
+  void passMozMapOfMozMapOfAny(record<DOMString, record<DOMString, any>> arg);
+  void passMozMapOfNullableMozMapOfAny(record<DOMString, record<DOMString, any>?> arg);
+  void passNullableMozMapOfNullableMozMapOfAny(record<DOMString, record<DOMString, any>?>? arg);
+  void passOptionalNullableMozMapOfNullableMozMapOfAny(optional record<DOMString, record<DOMString, any>?>? arg);
+  void passOptionalNullableMozMapOfNullableSequenceOfAny(optional record<DOMString, sequence<any>?>? arg);
+  void passOptionalNullableSequenceOfNullableMozMapOfAny(optional sequence<record<DOMString, any>?>? arg);
   any receiveAny();
 
   // object types
   void passObject(object arg);
   void passVariadicObject(object... arg);
   void passNullableObject(object? arg);
   void passVariadicNullableObject(object... arg);
   void passOptionalObject(optional object arg);
   void passOptionalNullableObject(optional object? arg);
   void passOptionalNullableObjectWithDefaultValue(optional object? arg = null);
   void passSequenceOfObject(sequence<object> arg);
   void passSequenceOfNullableObject(sequence<object?> arg);
   void passNullableSequenceOfObject(sequence<object>? arg);
   void passOptionalNullableSequenceOfNullableSequenceOfObject(optional sequence<sequence<object>?>? arg);
   void passOptionalNullableSequenceOfNullableSequenceOfNullableObject(optional sequence<sequence<object?>?>? arg);
-  void passMozMapOfObject(MozMap<object> arg);
+  void passMozMapOfObject(record<DOMString, object> arg);
   object receiveObject();
   object? receiveNullableObject();
 
   // Union types
   void passUnion((object or long) arg);
   // Some  union tests are debug-only to avoid creating all those
   // unused union types in opt builds.
 #ifdef DEBUG
@@ -617,29 +617,29 @@ interface TestInterface {
   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((MozMap<long> or long) arg);
-  void passUnion22((MozMap<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 passUnionWithCallback((EventHandler or long) arg);
   void passUnionWithByteString((ByteString or long) arg);
-  void passUnionWithMozMap((MozMap<DOMString> or DOMString) arg);
-  void passUnionWithMozMapAndSequence((MozMap<DOMString> or sequence<DOMString>) arg);
-  void passUnionWithSequenceAndMozMap((sequence<DOMString> or MozMap<DOMString>) arg);
+  void passUnionWithMozMap((record<DOMString, DOMString> or DOMString) arg);
+  void passUnionWithMozMapAndSequence((record<DOMString, DOMString> or sequence<DOMString>) arg);
+  void passUnionWithSequenceAndMozMap((sequence<DOMString> or record<DOMString, DOMString>) arg);
   void passUnionWithUSVS((USVString or long) arg);
 #endif
   void passUnionWithNullable((object? or long) arg);
   void passNullableUnion((object or long)? arg);
   void passOptionalUnion(optional (object or long) arg);
   void passOptionalNullableUnion(optional (object or long)? arg);
   void passOptionalNullableUnionWithDefaultValue(optional (object or long)? arg = null);
   //void passUnionWithInterfaces((TestInterface or TestExternalInterface) arg);
@@ -708,19 +708,19 @@ interface TestInterface {
   void passNullableUnionWithDefaultValue24(optional (double or USVString)? arg = null);
 
   void passSequenceOfUnions(sequence<(CanvasPattern or CanvasGradient)> arg);
   void passSequenceOfUnions2(sequence<(object or long)> arg);
   void passVariadicUnion((CanvasPattern or CanvasGradient)... arg);
 
   void passSequenceOfNullableUnions(sequence<(CanvasPattern or CanvasGradient)?> arg);
   void passVariadicNullableUnion((CanvasPattern or CanvasGradient)?... arg);
-  void passMozMapOfUnions(MozMap<(CanvasPattern or CanvasGradient)> arg);
+  void passMozMapOfUnions(record<DOMString, (CanvasPattern or CanvasGradient)> arg);
   // XXXbz no move constructor on some unions
-  // void passMozMapOfUnions2(MozMap<(object or long)> arg);
+  // void passMozMapOfUnions2(record<DOMString, (object or long)> arg);
 
   (CanvasPattern or CanvasGradient) receiveUnion();
   (object or long) receiveUnion2();
   (CanvasPattern? or CanvasGradient) receiveUnionContainingNull();
   (CanvasPattern or CanvasGradient)? receiveNullableUnion();
   (object or long)? receiveNullableUnion2();
 
   attribute (CanvasPattern or CanvasGradient) writableUnion;
@@ -730,17 +730,17 @@ interface TestInterface {
   // Date types
   void passDate(Date arg);
   void passNullableDate(Date? arg);
   void passOptionalDate(optional Date arg);
   void passOptionalNullableDate(optional Date? arg);
   void passOptionalNullableDateWithDefaultValue(optional Date? arg = null);
   void passDateSequence(sequence<Date> arg);
   void passNullableDateSequence(sequence<Date?> arg);
-  void passDateMozMap(MozMap<Date> arg);
+  void passDateMozMap(record<DOMString, Date> arg);
   Date receiveDate();
   Date? receiveNullableDate();
 
   // Promise types
   void passPromise(Promise<any> arg);
   void passOptionalPromise(optional Promise<any> arg);
   void passPromiseSequence(sequence<Promise<any>> arg);
   Promise<any> receivePromise();
@@ -769,17 +769,17 @@ interface TestInterface {
   [Cached, Pure, Frozen]
   readonly attribute Dict? readonlyFrozenNullableDictionary;
   [Cached, Pure, Frozen]
   attribute Dict writableFrozenDictionary;
   Dict receiveDictionary();
   Dict? receiveNullableDictionary();
   void passOtherDictionary(optional GrandparentDict x);
   void passSequenceOfDictionaries(sequence<Dict> x);
-  void passMozMapOfDictionaries(MozMap<GrandparentDict> x);
+  void passMozMapOfDictionaries(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(long x);
 
   void passDictContainingDict(optional DictContainingDict arg);
   void passDictContainingSequence(optional DictContainingSequence arg);
   DictContainingSequence receiveDictContainingSequence();
@@ -858,18 +858,18 @@ interface TestInterface {
   void overload13(boolean arg);
   void overload14(optional long arg);
   void overload14(TestInterface arg);
   void overload15(long arg);
   void overload15(optional TestInterface arg);
   void overload16(long arg);
   void overload16(optional TestInterface? arg);
   void overload17(sequence<long> arg);
-  void overload17(MozMap<long> arg);
-  void overload18(MozMap<DOMString> 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 overload20(sequence<long> arg);
 
   // Variadic handling
   void passVariadicThirdArg(DOMString arg1, long arg2, TestInterface... arg3);
@@ -1115,20 +1115,20 @@ dictionary Dict : ParentDict {
   required object requiredObject;
 
   CustomEventInit customEventInit;
   TestDictionaryTypedef dictionaryTypedef;
 
   Promise<void> promise;
   sequence<Promise<void>> promiseSequence;
 
-  MozMap<long> mozMap;
-  MozMap<long>? nullableMozMap;
-  MozMap<DOMString>? nullableMozMapWithDefault = null;
-  required MozMap<TestInterface> requiredMozMap;
+  record<DOMString, long> recordMember;
+  record<DOMString, long>? nullableRecord;
+  record<DOMString, DOMString>? nullableRecordWithDefault = null;
+  required record<DOMString, TestInterface> requiredRecord;
 };
 
 dictionary ParentDict : GrandparentDict {
   long c = 5;
   TestInterface someInterface;
   TestInterface? someNullableInterface = null;
   TestExternalInterface someExternalInterface;
   any parentAny;
--- a/dom/bindings/test/TestExampleGen.webidl
+++ b/dom/bindings/test/TestExampleGen.webidl
@@ -12,17 +12,17 @@
  Constructor(ArrayBuffer arrayBuf),
  Constructor(Uint8Array typedArr),
  // Constructor(long arg1, long arg2, (TestInterface or OnlyForUseInConstructor) arg3),
  NamedConstructor=Example,
  NamedConstructor=Example(DOMString str),
  NamedConstructor=Example2(DictForConstructor dict, any any1, object obj1,
                            object? obj2, sequence<Dict> seq, optional any any2,
                            optional object obj3, optional object? obj4),
- NamedConstructor=Example2((long or MozMap<any>) arg1)
+ NamedConstructor=Example2((long or record<DOMString, any>) arg1)
  ]
 interface TestExampleInterface {
   // Integer types
   // XXXbz add tests for throwing versions of all the integer stuff
   readonly attribute byte readonlyByte;
   attribute byte writableByte;
   void passByte(byte arg);
   byte receiveByte();
@@ -274,41 +274,41 @@ interface TestExampleInterface {
   sequence<object?> receiveNullableObjectSequence();
 
   void passSequenceOfSequences(sequence<sequence<long>> arg);
   void passSequenceOfSequencesOfSequences(sequence<sequence<sequence<long>>> arg);
   //XXXbz No support for sequence of sequence return values yet.
   //sequence<sequence<long>> receiveSequenceOfSequences();
 
   // MozMap types
-  void passMozMap(MozMap<long> arg);
-  void passNullableMozMap(MozMap<long>? arg);
-  void passMozMapOfNullableInts(MozMap<long?> arg);
-  void passOptionalMozMapOfNullableInts(optional MozMap<long?> arg);
-  void passOptionalNullableMozMapOfNullableInts(optional MozMap<long?>? arg);
-  void passCastableObjectMozMap(MozMap<TestInterface> arg);
-  void passNullableCastableObjectMozMap(MozMap<TestInterface?> arg);
-  void passCastableObjectNullableMozMap(MozMap<TestInterface>? arg);
-  void passNullableCastableObjectNullableMozMap(MozMap<TestInterface?>? arg);
-  void passOptionalMozMap(optional MozMap<long> arg);
-  void passOptionalNullableMozMap(optional MozMap<long>? arg);
-  void passOptionalNullableMozMapWithDefaultValue(optional MozMap<long>? arg = null);
-  void passOptionalObjectMozMap(optional MozMap<TestInterface> arg);
-  void passExternalInterfaceMozMap(MozMap<TestExternalInterface> arg);
-  void passNullableExternalInterfaceMozMap(MozMap<TestExternalInterface?> arg);
-  void passStringMozMap(MozMap<DOMString> arg);
-  void passByteStringMozMap(MozMap<ByteString> arg);
-  void passMozMapOfMozMaps(MozMap<MozMap<long>> arg);
-  MozMap<long> receiveMozMap();
-  MozMap<long>? receiveNullableMozMap();
-  MozMap<long?> receiveMozMapOfNullableInts();
-  MozMap<long?>? receiveNullableMozMapOfNullableInts();
+  void passMozMap(record<DOMString, long> arg);
+  void passNullableMozMap(record<DOMString, long>? arg);
+  void passMozMapOfNullableInts(record<DOMString, long?> arg);
+  void passOptionalMozMapOfNullableInts(optional record<DOMString, long?> arg);
+  void passOptionalNullableMozMapOfNullableInts(optional record<DOMString, long?>? arg);
+  void passCastableObjectMozMap(record<DOMString, TestInterface> arg);
+  void passNullableCastableObjectMozMap(record<DOMString, TestInterface?> arg);
+  void passCastableObjectNullableMozMap(record<DOMString, TestInterface>? arg);
+  void passNullableCastableObjectNullableMozMap(record<DOMString, TestInterface?>? arg);
+  void passOptionalMozMap(optional record<DOMString, long> arg);
+  void passOptionalNullableMozMap(optional record<DOMString, long>? arg);
+  void passOptionalNullableMozMapWithDefaultValue(optional record<DOMString, long>? arg = null);
+  void passOptionalObjectMozMap(optional record<DOMString, TestInterface> arg);
+  void passExternalInterfaceMozMap(record<DOMString, TestExternalInterface> arg);
+  void passNullableExternalInterfaceMozMap(record<DOMString, TestExternalInterface?> arg);
+  void passStringMozMap(record<DOMString, DOMString> arg);
+  void passByteStringMozMap(record<DOMString, ByteString> arg);
+  void passMozMapOfMozMaps(record<DOMString, record<DOMString, long>> arg);
+  record<DOMString, long> receiveMozMap();
+  record<DOMString, long>? receiveNullableMozMap();
+  record<DOMString, long?> receiveMozMapOfNullableInts();
+  record<DOMString, long?>? receiveNullableMozMapOfNullableInts();
   //XXXbz No support for MozMap of MozMaps return values yet.
-  //MozMap<MozMap<long>> receiveMozMapOfMozMaps();
-  MozMap<any> receiveAnyMozMap();
+  //record<DOMString, record<DOMString, long>> receiveMozMapOfMozMaps();
+  record<DOMString, any> receiveAnyMozMap();
 
   // Typed array types
   void passArrayBuffer(ArrayBuffer arg);
   void passNullableArrayBuffer(ArrayBuffer? arg);
   void passOptionalArrayBuffer(optional ArrayBuffer arg);
   void passOptionalNullableArrayBuffer(optional ArrayBuffer? arg);
   void passOptionalNullableArrayBufferWithDefaultValue(optional ArrayBuffer? arg= null);
   void passArrayBufferView(ArrayBufferView arg);
@@ -318,18 +318,18 @@ interface TestExampleInterface {
   void passUint8Array(Uint8Array arg);
   void passUint16Array(Uint16Array arg);
   void passUint32Array(Uint32Array arg);
   void passUint8ClampedArray(Uint8ClampedArray arg);
   void passFloat32Array(Float32Array arg);
   void passFloat64Array(Float64Array arg);
   void passSequenceOfArrayBuffers(sequence<ArrayBuffer> arg);
   void passSequenceOfNullableArrayBuffers(sequence<ArrayBuffer?> arg);
-  void passMozMapOfArrayBuffers(MozMap<ArrayBuffer> arg);
-  void passMozMapOfNullableArrayBuffers(MozMap<ArrayBuffer?> arg);
+  void passMozMapOfArrayBuffers(record<DOMString, ArrayBuffer> arg);
+  void passMozMapOfNullableArrayBuffers(record<DOMString, ArrayBuffer?> arg);
   void passVariadicTypedArray(Float32Array... arg);
   void passVariadicNullableTypedArray(Float32Array?... arg);
   Uint8Array receiveUint8Array();
   attribute Uint8Array uint8ArrayAttr;
 
   // DOMString types
   void passString(DOMString arg);
   void passNullableString(DOMString? arg);
@@ -395,43 +395,43 @@ interface TestExampleInterface {
   void passNullableSequenceOfAny(sequence<any>? arg);
   void passOptionalSequenceOfAny(optional sequence<any> arg);
   void passOptionalNullableSequenceOfAny(optional sequence<any>? arg);
   void passOptionalSequenceOfAnyWithDefaultValue(optional sequence<any>? arg = null);
   void passSequenceOfSequenceOfAny(sequence<sequence<any>> arg);
   void passSequenceOfNullableSequenceOfAny(sequence<sequence<any>?> arg);
   void passNullableSequenceOfNullableSequenceOfAny(sequence<sequence<any>?>? arg);
   void passOptionalNullableSequenceOfNullableSequenceOfAny(optional sequence<sequence<any>?>? arg);
-  void passMozMapOfAny(MozMap<any> arg);
-  void passNullableMozMapOfAny(MozMap<any>? arg);
-  void passOptionalMozMapOfAny(optional MozMap<any> arg);
-  void passOptionalNullableMozMapOfAny(optional MozMap<any>? arg);
-  void passOptionalMozMapOfAnyWithDefaultValue(optional MozMap<any>? arg = null);
-  void passMozMapOfMozMapOfAny(MozMap<MozMap<any>> arg);
-  void passMozMapOfNullableMozMapOfAny(MozMap<MozMap<any>?> arg);
-  void passNullableMozMapOfNullableMozMapOfAny(MozMap<MozMap<any>?>? arg);
-  void passOptionalNullableMozMapOfNullableMozMapOfAny(optional MozMap<MozMap<any>?>? arg);
-  void passOptionalNullableMozMapOfNullableSequenceOfAny(optional MozMap<sequence<any>?>? arg);
-  void passOptionalNullableSequenceOfNullableMozMapOfAny(optional sequence<MozMap<any>?>? arg);
+  void passMozMapOfAny(record<DOMString, any> arg);
+  void passNullableMozMapOfAny(record<DOMString, any>? arg);
+  void passOptionalMozMapOfAny(optional record<DOMString, any> arg);
+  void passOptionalNullableMozMapOfAny(optional record<DOMString, any>? arg);
+  void passOptionalMozMapOfAnyWithDefaultValue(optional record<DOMString, any>? arg = null);
+  void passMozMapOfMozMapOfAny(record<DOMString, record<DOMString, any>> arg);
+  void passMozMapOfNullableMozMapOfAny(record<DOMString, record<DOMString, any>?> arg);
+  void passNullableMozMapOfNullableMozMapOfAny(record<DOMString, record<DOMString, any>?>? arg);
+  void passOptionalNullableMozMapOfNullableMozMapOfAny(optional record<DOMString, record<DOMString, any>?>? arg);
+  void passOptionalNullableMozMapOfNullableSequenceOfAny(optional record<DOMString, sequence<any>?>? arg);
+  void passOptionalNullableSequenceOfNullableMozMapOfAny(optional sequence<record<DOMString, any>?>? arg);
   any receiveAny();
 
   // object types
   void passObject(object arg);
   void passVariadicObject(object... arg);
   void passNullableObject(object? arg);
   void passVariadicNullableObject(object... arg);
   void passOptionalObject(optional object arg);
   void passOptionalNullableObject(optional object? arg);
   void passOptionalNullableObjectWithDefaultValue(optional object? arg = null);
   void passSequenceOfObject(sequence<object> arg);
   void passSequenceOfNullableObject(sequence<object?> arg);
   void passNullableSequenceOfObject(sequence<object>? arg);
   void passOptionalNullableSequenceOfNullableSequenceOfObject(optional sequence<sequence<object>?>? arg);
   void passOptionalNullableSequenceOfNullableSequenceOfNullableObject(optional sequence<sequence<object?>?>? arg);
-  void passMozMapOfObject(MozMap<object> arg);
+  void passMozMapOfObject(record<DOMString, object> arg);
   object receiveObject();
   object? receiveNullableObject();
 
   // Union types
   void passUnion((object or long) arg);
   // Some union tests are debug-only to avoid creating all those
   // unused union types in opt builds.
 
@@ -450,29 +450,29 @@ interface TestExampleInterface {
   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((MozMap<long> or long) arg);
-  void passUnion22((MozMap<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 passUnionWithCallback((EventHandler or long) arg);
   void passUnionWithByteString((ByteString or long) arg);
-  void passUnionWithMozMap((MozMap<DOMString> or DOMString) arg);
-  void passUnionWithMozMapAndSequence((MozMap<DOMString> or sequence<DOMString>) arg);
-  void passUnionWithSequenceAndMozMap((sequence<DOMString> or MozMap<DOMString>) arg);
+  void passUnionWithMozMap((record<DOMString, DOMString> or DOMString) arg);
+  void passUnionWithMozMapAndSequence((record<DOMString, DOMString> or sequence<DOMString>) arg);
+  void passUnionWithSequenceAndMozMap((sequence<DOMString> or record<DOMString, DOMString>) arg);
   void passUnionWithSVS((USVString or long) arg);
 #endif
   void passUnionWithNullable((object? or long) arg);
   void passNullableUnion((object or long)? arg);
   void passOptionalUnion(optional (object or long) arg);
   void passOptionalNullableUnion(optional (object or long)? arg);
   void passOptionalNullableUnionWithDefaultValue(optional (object or long)? arg = null);
   //void passUnionWithInterfaces((TestInterface or TestExternalInterface) arg);
@@ -541,19 +541,19 @@ interface TestExampleInterface {
   void passNullableUnionWithDefaultValue24(optional (double or USVString)? arg = null);
 
   void passSequenceOfUnions(sequence<(CanvasPattern or CanvasGradient)> arg);
   void passSequenceOfUnions2(sequence<(object or long)> arg);
   void passVariadicUnion((CanvasPattern or CanvasGradient)... arg);
 
   void passSequenceOfNullableUnions(sequence<(CanvasPattern or CanvasGradient)?> arg);
   void passVariadicNullableUnion((CanvasPattern or CanvasGradient)?... arg);
-  void passMozMapOfUnions(MozMap<(CanvasPattern or CanvasGradient)> arg);
+  void passMozMapOfUnions(record<DOMString, (CanvasPattern or CanvasGradient)> arg);
   // XXXbz no move constructor on some unions
-  // void passMozMapOfUnions2(MozMap<(object or long)> arg);
+  // void passMozMapOfUnions2(record<DOMString, (object or long)> arg);
 
   (CanvasPattern or CanvasGradient) receiveUnion();
   (object or long) receiveUnion2();
   (CanvasPattern? or CanvasGradient) receiveUnionContainingNull();
   (CanvasPattern or CanvasGradient)? receiveNullableUnion();
   (object or long)? receiveNullableUnion2();
 
   attribute (CanvasPattern or CanvasGradient) writableUnion;
@@ -563,17 +563,17 @@ interface TestExampleInterface {
   // Date types
   void passDate(Date arg);
   void passNullableDate(Date? arg);
   void passOptionalDate(optional Date arg);
   void passOptionalNullableDate(optional Date? arg);
   void passOptionalNullableDateWithDefaultValue(optional Date? arg = null);
   void passDateSequence(sequence<Date> arg);
   void passNullableDateSequence(sequence<Date?> arg);
-  void passDateMozMap(MozMap<Date> arg);
+  void passDateMozMap(record<DOMString, Date> arg);
   Date receiveDate();
   Date? receiveNullableDate();
 
   // Promise types
   void passPromise(Promise<any> arg);
   void passOptionalPromise(optional Promise<any> arg);
   void passPromiseSequence(sequence<Promise<any>> arg);
   Promise<any> receivePromise();
@@ -602,17 +602,17 @@ interface TestExampleInterface {
   [Cached, Pure, Frozen]
   readonly attribute Dict? readonlyFrozenNullableDictionary;
   [Cached, Pure, Frozen]
   attribute Dict writableFrozenDictionary;
   Dict receiveDictionary();
   Dict? receiveNullableDictionary();
   void passOtherDictionary(optional GrandparentDict x);
   void passSequenceOfDictionaries(sequence<Dict> x);
-  void passMozMapOfDictionaries(MozMap<GrandparentDict> x);
+  void passMozMapOfDictionaries(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(long x);
 
   void passDictContainingDict(optional DictContainingDict arg);
   void passDictContainingSequence(optional DictContainingSequence arg);
   DictContainingSequence receiveDictContainingSequence();
@@ -688,18 +688,18 @@ interface TestExampleInterface {
   void overload13(boolean arg);
   void overload14(optional long arg);
   void overload14(TestInterface arg);
   void overload15(long arg);
   void overload15(optional TestInterface arg);
   void overload16(long arg);
   void overload16(optional TestInterface? arg);
   void overload17(sequence<long> arg);
-  void overload17(MozMap<long> arg);
-  void overload18(MozMap<DOMString> 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 overload20(sequence<long> arg);
 
   // Variadic handling
   void passVariadicThirdArg(DOMString arg1, long arg2, TestInterface... arg3);
--- a/dom/bindings/test/TestJSImplGen.webidl
+++ b/dom/bindings/test/TestJSImplGen.webidl
@@ -285,41 +285,41 @@ interface TestJSImplInterface {
   sequence<object?> receiveNullableObjectSequence();
 
   void passSequenceOfSequences(sequence<sequence<long>> arg);
   void passSequenceOfSequencesOfSequences(sequence<sequence<sequence<long>>> arg);
   //XXXbz No support for sequence of sequence return values yet.
   //sequence<sequence<long>> receiveSequenceOfSequences();
 
   // MozMap types
-  void passMozMap(MozMap<long> arg);
-  void passNullableMozMap(MozMap<long>? arg);
-  void passMozMapOfNullableInts(MozMap<long?> arg);
-  void passOptionalMozMapOfNullableInts(optional MozMap<long?> arg);
-  void passOptionalNullableMozMapOfNullableInts(optional MozMap<long?>? arg);
-  void passCastableObjectMozMap(MozMap<TestJSImplInterface> arg);
-  void passNullableCastableObjectMozMap(MozMap<TestJSImplInterface?> arg);
-  void passCastableObjectNullableMozMap(MozMap<TestJSImplInterface>? arg);
-  void passNullableCastableObjectNullableMozMap(MozMap<TestJSImplInterface?>? arg);
-  void passOptionalMozMap(optional MozMap<long> arg);
-  void passOptionalNullableMozMap(optional MozMap<long>? arg);
-  void passOptionalNullableMozMapWithDefaultValue(optional MozMap<long>? arg = null);
-  void passOptionalObjectMozMap(optional MozMap<TestJSImplInterface> arg);
-  void passExternalInterfaceMozMap(MozMap<TestExternalInterface> arg);
-  void passNullableExternalInterfaceMozMap(MozMap<TestExternalInterface?> arg);
-  void passStringMozMap(MozMap<DOMString> arg);
-  void passByteStringMozMap(MozMap<ByteString> arg);
-  void passMozMapOfMozMaps(MozMap<MozMap<long>> arg);
-  MozMap<long> receiveMozMap();
-  MozMap<long>? receiveNullableMozMap();
-  MozMap<long?> receiveMozMapOfNullableInts();
-  MozMap<long?>? receiveNullableMozMapOfNullableInts();
+  void passMozMap(record<DOMString, long> arg);
+  void passNullableMozMap(record<DOMString, long>? arg);
+  void passMozMapOfNullableInts(record<DOMString, long?> arg);
+  void passOptionalMozMapOfNullableInts(optional record<DOMString, long?> arg);
+  void passOptionalNullableMozMapOfNullableInts(optional record<DOMString, long?>? arg);
+  void passCastableObjectMozMap(record<DOMString, TestJSImplInterface> arg);
+  void passNullableCastableObjectMozMap(record<DOMString, TestJSImplInterface?> arg);
+  void passCastableObjectNullableMozMap(record<DOMString, TestJSImplInterface>? arg);
+  void passNullableCastableObjectNullableMozMap(record<DOMString, TestJSImplInterface?>? arg);
+  void passOptionalMozMap(optional record<DOMString, long> arg);
+  void passOptionalNullableMozMap(optional record<DOMString, long>? arg);
+  void passOptionalNullableMozMapWithDefaultValue(optional record<DOMString, long>? arg = null);
+  void passOptionalObjectMozMap(optional record<DOMString, TestJSImplInterface> arg);
+  void passExternalInterfaceMozMap(record<DOMString, TestExternalInterface> arg);
+  void passNullableExternalInterfaceMozMap(record<DOMString, TestExternalInterface?> arg);
+  void passStringMozMap(record<DOMString, DOMString> arg);
+  void passByteStringMozMap(record<DOMString, ByteString> arg);
+  void passMozMapOfMozMaps(record<DOMString, record<DOMString, long>> arg);
+  record<DOMString, long> receiveMozMap();
+  record<DOMString, long>? receiveNullableMozMap();
+  record<DOMString, long?> receiveMozMapOfNullableInts();
+  record<DOMString, long?>? receiveNullableMozMapOfNullableInts();
   //XXXbz No support for MozMap of MozMaps return values yet.
-  //MozMap<MozMap<long>> receiveMozMapOfMozMaps();
-  MozMap<any> receiveAnyMozMap();
+  //record<DOMString, record<DOMString, long>> receiveMozMapOfMozMaps();
+  record<DOMString, any> receiveAnyMozMap();
 
   // Typed array types
   void passArrayBuffer(ArrayBuffer arg);
   void passNullableArrayBuffer(ArrayBuffer? arg);
   void passOptionalArrayBuffer(optional ArrayBuffer arg);
   void passOptionalNullableArrayBuffer(optional ArrayBuffer? arg);
   void passOptionalNullableArrayBufferWithDefaultValue(optional ArrayBuffer? arg= null);
   void passArrayBufferView(ArrayBufferView arg);
@@ -329,18 +329,18 @@ interface TestJSImplInterface {
   void passUint8Array(Uint8Array arg);
   void passUint16Array(Uint16Array arg);
   void passUint32Array(Uint32Array arg);
   void passUint8ClampedArray(Uint8ClampedArray arg);
   void passFloat32Array(Float32Array arg);
   void passFloat64Array(Float64Array arg);
   void passSequenceOfArrayBuffers(sequence<ArrayBuffer> arg);
   void passSequenceOfNullableArrayBuffers(sequence<ArrayBuffer?> arg);
-  void passMozMapOfArrayBuffers(MozMap<ArrayBuffer> arg);
-  void passMozMapOfNullableArrayBuffers(MozMap<ArrayBuffer?> arg);
+  void passMozMapOfArrayBuffers(record<DOMString, ArrayBuffer> arg);
+  void passMozMapOfNullableArrayBuffers(record<DOMString, ArrayBuffer?> arg);
   void passVariadicTypedArray(Float32Array... arg);
   void passVariadicNullableTypedArray(Float32Array?... arg);
   Uint8Array receiveUint8Array();
   attribute Uint8Array uint8ArrayAttr;
 
   // DOMString types
   void passString(DOMString arg);
   void passNullableString(DOMString? arg);
@@ -407,43 +407,43 @@ interface TestJSImplInterface {
   void passNullableSequenceOfAny(sequence<any>? arg);
   void passOptionalSequenceOfAny(optional sequence<any> arg);
   void passOptionalNullableSequenceOfAny(optional sequence<any>? arg);
   void passOptionalSequenceOfAnyWithDefaultValue(optional sequence<any>? arg = null);
   void passSequenceOfSequenceOfAny(sequence<sequence<any>> arg);
   void passSequenceOfNullableSequenceOfAny(sequence<sequence<any>?> arg);
   void passNullableSequenceOfNullableSequenceOfAny(sequence<sequence<any>?>? arg);
   void passOptionalNullableSequenceOfNullableSequenceOfAny(optional sequence<sequence<any>?>? arg);
-  void passMozMapOfAny(MozMap<any> arg);
-  void passNullableMozMapOfAny(MozMap<any>? arg);
-  void passOptionalMozMapOfAny(optional MozMap<any> arg);
-  void passOptionalNullableMozMapOfAny(optional MozMap<any>? arg);
-  void passOptionalMozMapOfAnyWithDefaultValue(optional MozMap<any>? arg = null);
-  void passMozMapOfMozMapOfAny(MozMap<MozMap<any>> arg);
-  void passMozMapOfNullableMozMapOfAny(MozMap<MozMap<any>?> arg);
-  void passNullableMozMapOfNullableMozMapOfAny(MozMap<MozMap<any>?>? arg);
-  void passOptionalNullableMozMapOfNullableMozMapOfAny(optional MozMap<MozMap<any>?>? arg);
-  void passOptionalNullableMozMapOfNullableSequenceOfAny(optional MozMap<sequence<any>?>? arg);
-  void passOptionalNullableSequenceOfNullableMozMapOfAny(optional sequence<MozMap<any>?>? arg);
+  void passMozMapOfAny(record<DOMString, any> arg);
+  void passNullableMozMapOfAny(record<DOMString, any>? arg);
+  void passOptionalMozMapOfAny(optional record<DOMString, any> arg);
+  void passOptionalNullableMozMapOfAny(optional record<DOMString, any>? arg);
+  void passOptionalMozMapOfAnyWithDefaultValue(optional record<DOMString, any>? arg = null);
+  void passMozMapOfMozMapOfAny(record<DOMString, record<DOMString, any>> arg);
+  void passMozMapOfNullableMozMapOfAny(record<DOMString, record<DOMString, any>?> arg);
+  void passNullableMozMapOfNullableMozMapOfAny(record<DOMString, record<DOMString, any>?>? arg);
+  void passOptionalNullableMozMapOfNullableMozMapOfAny(optional record<DOMString, record<DOMString, any>?>? arg);
+  void passOptionalNullableMozMapOfNullableSequenceOfAny(optional record<DOMString, sequence<any>?>? arg);
+  void passOptionalNullableSequenceOfNullableMozMapOfAny(optional sequence<record<DOMString, any>?>? arg);
   any receiveAny();
 
   // object types
   void passObject(object arg);
   void passVariadicObject(object... arg);
   void passNullableObject(object? arg);
   void passVariadicNullableObject(object... arg);
   void passOptionalObject(optional object arg);
   void passOptionalNullableObject(optional object? arg);
   void passOptionalNullableObjectWithDefaultValue(optional object? arg = null);
   void passSequenceOfObject(sequence<object> arg);
   void passSequenceOfNullableObject(sequence<object?> arg);
   void passNullableSequenceOfObject(sequence<object>? arg);
   void passOptionalNullableSequenceOfNullableSequenceOfObject(optional sequence<sequence<object>?>? arg);
   void passOptionalNullableSequenceOfNullableSequenceOfNullableObject(optional sequence<sequence<object?>?>? arg);
-  void passMozMapOfObject(MozMap<object> arg);
+  void passMozMapOfObject(record<DOMString, object> arg);
   object receiveObject();
   object? receiveNullableObject();
 
   // Union types
   void passUnion((object or long) arg);
   // Some union tests are debug-only to avoid creating all those
   // unused union types in opt builds.
 #ifdef DEBUG
@@ -461,29 +461,29 @@ interface TestJSImplInterface {
   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((MozMap<long> or long) arg);
-  void passUnion22((MozMap<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 passUnionWithCallback((EventHandler or long) arg);
   void passUnionWithByteString((ByteString or long) arg);
-  void passUnionWithMozMap((MozMap<DOMString> or DOMString) arg);
-  void passUnionWithMozMapAndSequence((MozMap<DOMString> or sequence<DOMString>) arg);
-  void passUnionWithSequenceAndMozMap((sequence<DOMString> or MozMap<DOMString>) arg);
+  void passUnionWithMozMap((record<DOMString, DOMString> or DOMString) arg);
+  void passUnionWithMozMapAndSequence((record<DOMString, DOMString> or sequence<DOMString>) arg);
+  void passUnionWithSequenceAndMozMap((sequence<DOMString> or record<DOMString, DOMString>) arg);
   void passUnionWithSVS((USVString or long) arg);
 #endif
   void passUnionWithNullable((object? or long) arg);
   void passNullableUnion((object or long)? arg);
   void passOptionalUnion(optional (object or long) arg);
   void passOptionalNullableUnion(optional (object or long)? arg);
   void passOptionalNullableUnionWithDefaultValue(optional (object or long)? arg = null);
   //void passUnionWithInterfaces((TestJSImplInterface or TestExternalInterface) arg);
@@ -552,19 +552,19 @@ interface TestJSImplInterface {
   void passNullableUnionWithDefaultValue24(optional (double or USVString)? arg = null);
 
   void passSequenceOfUnions(sequence<(CanvasPattern or CanvasGradient)> arg);
   void passSequenceOfUnions2(sequence<(object or long)> arg);
   void passVariadicUnion((CanvasPattern or CanvasGradient)... arg);
 
   void passSequenceOfNullableUnions(sequence<(CanvasPattern or CanvasGradient)?> arg);
   void passVariadicNullableUnion((CanvasPattern or CanvasGradient)?... arg);
-  void passMozMapOfUnions(MozMap<(CanvasPattern or CanvasGradient)> arg);
+  void passMozMapOfUnions(record<DOMString, (CanvasPattern or CanvasGradient)> arg);
   // XXXbz no move constructor on some unions
-  // void passMozMapOfUnions2(MozMap<(object or long)> arg);
+  // void passMozMapOfUnions2(record<DOMString, (object or long)> arg);
 
   (CanvasPattern or CanvasGradient) receiveUnion();
   (object or long) receiveUnion2();
   (CanvasPattern? or CanvasGradient) receiveUnionContainingNull();
   (CanvasPattern or CanvasGradient)? receiveNullableUnion();
   (object or long)? receiveNullableUnion2();
 
   attribute (CanvasPattern or CanvasGradient) writableUnion;
@@ -574,17 +574,17 @@ interface TestJSImplInterface {
   // Date types
   void passDate(Date arg);
   void passNullableDate(Date? arg);
   void passOptionalDate(optional Date arg);
   void passOptionalNullableDate(optional Date? arg);
   void passOptionalNullableDateWithDefaultValue(optional Date? arg = null);
   void passDateSequence(sequence<Date> arg);
   void passNullableDateSequence(sequence<Date?> arg);
-  void passDateMozMap(MozMap<Date> arg);
+  void passDateMozMap(record<DOMString, Date> arg);
   Date receiveDate();
   Date? receiveNullableDate();
 
   // Promise types
   void passPromise(Promise<any> arg);
   void passOptionalPromise(optional Promise<any> arg);
   void passPromiseSequence(sequence<Promise<any>> arg);
   Promise<any> receivePromise();
@@ -613,17 +613,17 @@ interface TestJSImplInterface {
   [Cached, Pure, Frozen]
   readonly attribute Dict? readonlyFrozenNullableDictionary;
   [Cached, Pure, Frozen]
   attribute Dict writableFrozenDictionary;
   Dict receiveDictionary();
   Dict? receiveNullableDictionary();
   void passOtherDictionary(optional GrandparentDict x);
   void passSequenceOfDictionaries(sequence<Dict> x);
-  void passMozMapOfDictionaries(MozMap<GrandparentDict> x);
+  void passMozMapOfDictionaries(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(long x);
 
   void passDictContainingDict(optional DictContainingDict arg);
   void passDictContainingSequence(optional DictContainingSequence arg);
   DictContainingSequence receiveDictContainingSequence();
@@ -702,18 +702,18 @@ interface TestJSImplInterface {
   void overload13(boolean arg);
   void overload14(optional long arg);
   void overload14(TestInterface arg);
   void overload15(long arg);
   void overload15(optional TestInterface arg);
   void overload16(long arg);
   void overload16(optional TestInterface? arg);
   void overload17(sequence<long> arg);
-  void overload17(MozMap<long> arg);
-  void overload18(MozMap<DOMString> 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 overload20(sequence<long> arg);
 
   // Variadic handling
   void passVariadicThirdArg(DOMString arg1, long arg2, TestJSImplInterface... arg3);
--- a/dom/fetch/Headers.cpp
+++ b/dom/fetch/Headers.cpp
@@ -20,65 +20,65 @@ NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(He
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(Headers)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
   NS_INTERFACE_MAP_ENTRY(nsISupports)
 NS_INTERFACE_MAP_END
 
 // static
 already_AddRefed<Headers>
 Headers::Constructor(const GlobalObject& aGlobal,
-                     const Optional<HeadersOrByteStringSequenceSequenceOrByteStringMozMap>& aInit,
+                     const Optional<HeadersOrByteStringSequenceSequenceOrByteStringByteStringRecord>& aInit,
                      ErrorResult& aRv)
 {
   RefPtr<InternalHeaders> ih = new InternalHeaders();
   RefPtr<Headers> headers = new Headers(aGlobal.GetAsSupports(), ih);
 
   if (!aInit.WasPassed()) {
     return headers.forget();
   }
 
   if (aInit.Value().IsHeaders()) {
     ih->Fill(*aInit.Value().GetAsHeaders().mInternalHeaders, aRv);
   } else if (aInit.Value().IsByteStringSequenceSequence()) {
     ih->Fill(aInit.Value().GetAsByteStringSequenceSequence(), aRv);
-  } else if (aInit.Value().IsByteStringMozMap()) {
-    ih->Fill(aInit.Value().GetAsByteStringMozMap(), aRv);
+  } else if (aInit.Value().IsByteStringByteStringRecord()) {
+    ih->Fill(aInit.Value().GetAsByteStringByteStringRecord(), aRv);
   }
 
   if (aRv.Failed()) {
     return nullptr;
   }
 
   return headers.forget();
 }
 
 // static
 already_AddRefed<Headers>
 Headers::Constructor(const GlobalObject& aGlobal,
-                     const OwningHeadersOrByteStringSequenceSequenceOrByteStringMozMap& aInit,
+                     const OwningHeadersOrByteStringSequenceSequenceOrByteStringByteStringRecord& aInit,
                      ErrorResult& aRv)
 {
   nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(aGlobal.GetAsSupports());
   return Create(global, aInit, aRv);
 }
 
 /* static */ already_AddRefed<Headers>
 Headers::Create(nsIGlobalObject* aGlobal,
-                const OwningHeadersOrByteStringSequenceSequenceOrByteStringMozMap& aInit,
+                const OwningHeadersOrByteStringSequenceSequenceOrByteStringByteStringRecord& aInit,
                 ErrorResult& aRv)
 {
   RefPtr<InternalHeaders> ih = new InternalHeaders();
   RefPtr<Headers> headers = new Headers(aGlobal, ih);
 
   if (aInit.IsHeaders()) {
     ih->Fill(*(aInit.GetAsHeaders().get()->mInternalHeaders), aRv);
   } else if (aInit.IsByteStringSequenceSequence()) {
     ih->Fill(aInit.GetAsByteStringSequenceSequence(), aRv);
-  } else if (aInit.IsByteStringMozMap()) {
-    ih->Fill(aInit.GetAsByteStringMozMap(), aRv);
+  } else if (aInit.IsByteStringByteStringRecord()) {
+    ih->Fill(aInit.GetAsByteStringByteStringRecord(), aRv);
   }
 
   if (NS_WARN_IF(aRv.Failed())) {
     return nullptr;
   }
 
   return headers.forget();
 }
--- a/dom/fetch/Headers.h
+++ b/dom/fetch/Headers.h
@@ -16,18 +16,18 @@
 
 namespace mozilla {
 
 class ErrorResult;
 
 namespace dom {
 
 template<typename T> class MozMap;
-class HeadersOrByteStringSequenceSequenceOrByteStringMozMap;
-class OwningHeadersOrByteStringSequenceSequenceOrByteStringMozMap;
+class HeadersOrByteStringSequenceSequenceOrByteStringByteStringRecord;
+class OwningHeadersOrByteStringSequenceSequenceOrByteStringByteStringRecord;
 
 /**
  * This Headers class is only used to represent the content facing Headers
  * object. It is actually backed by an InternalHeaders implementation. Gecko
  * code should NEVER use this, except in the Request and Response
  * implementations, where they must always be created from the backing
  * InternalHeaders object.
  */
@@ -52,27 +52,27 @@ public:
   }
 
   explicit Headers(const Headers& aOther) = delete;
 
   static bool PrefEnabled(JSContext* cx, JSObject* obj);
 
   static already_AddRefed<Headers>
   Constructor(const GlobalObject& aGlobal,
-              const Optional<HeadersOrByteStringSequenceSequenceOrByteStringMozMap>& aInit,
+              const Optional<HeadersOrByteStringSequenceSequenceOrByteStringByteStringRecord>& aInit,
               ErrorResult& aRv);
 
   static already_AddRefed<Headers>
   Constructor(const GlobalObject& aGlobal,
-              const OwningHeadersOrByteStringSequenceSequenceOrByteStringMozMap& aInit,
+              const OwningHeadersOrByteStringSequenceSequenceOrByteStringByteStringRecord& aInit,
               ErrorResult& aRv);
 
   static already_AddRefed<Headers>
   Create(nsIGlobalObject* aGlobalObject,
-         const OwningHeadersOrByteStringSequenceSequenceOrByteStringMozMap& aInit,
+         const OwningHeadersOrByteStringSequenceSequenceOrByteStringByteStringRecord& aInit,
          ErrorResult& aRv);
 
   void Append(const nsACString& aName, const nsACString& aValue,
               ErrorResult& aRv)
   {
     mInternalHeaders->Append(aName, aValue, aRv);
   }
 
--- a/dom/webidl/Headers.webidl
+++ b/dom/webidl/Headers.webidl
@@ -3,17 +3,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://fetch.spec.whatwg.org/#headers-class
  */
 
-typedef (Headers or sequence<sequence<ByteString>> or MozMap<ByteString>) HeadersInit;
+typedef (Headers or sequence<sequence<ByteString>> or record<ByteString, ByteString>) HeadersInit;
 
 enum HeadersGuardEnum {
   "none",
   "request",
   "request-no-cors",
   "response",
   "immutable"
 };
--- a/dom/webidl/InstallTrigger.webidl
+++ b/dom/webidl/InstallTrigger.webidl
@@ -52,17 +52,17 @@ interface InstallTriggerImpl {
    *         following properties:
    *          * URL for the add-on's URL
    *          * IconURL for an icon for the add-on
    *          * Hash for a hash of the add-on
    * @param  aCallback
    *         A callback to call as each installation succeeds or fails
    * @return true if the installations were successfully started
    */
-  boolean install(MozMap<(DOMString or InstallTriggerData)> installs,
+  boolean install(record<DOMString, (DOMString or InstallTriggerData)> installs,
                   optional InstallTriggerCallback callback);
 
   /**
    * Starts installing a new add-on.
    *
    * @deprecated use "install" in the future.
    *
    * @param  aType
--- a/dom/webidl/TestInterfaceJS.webidl
+++ b/dom/webidl/TestInterfaceJS.webidl
@@ -19,17 +19,17 @@ interface TestInterfaceJS : EventTarget 
   attribute any anyAttr;
   attribute object objectAttr;
   [Cached, Pure] attribute TestInterfaceJSDictionary dictionaryAttr;
   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);
-  DOMString pingPongMap(MozMap<any> map);
+  DOMString pingPongMap(record<DOMString, any> map);
   long objectSequenceLength(sequence<object> seq);
   long anySequenceLength(sequence<any> seq);
 
   // For testing bug 968335.
   DOMString getCallerPrincipal();
 
   DOMString convertSVS(USVString svs);