Bug 1587819. Convert [HTMLConstructor] to being an extended attribute on constructor operations. r=edgar
authorBoris Zbarsky <bzbarsky@mit.edu>
Thu, 17 Oct 2019 15:38:39 +0000
changeset 559355 b8905d33a7c0e55f84e2378b51cc6488f7b81aee
parent 559354 c853fce199e6d3e74dd3dcb373eeb7c311dd8b48
child 559356 e641756cd54fd66ef804282b89018edddf5b8a47
push id12177
push usercsabou@mozilla.com
push dateMon, 21 Oct 2019 14:52:16 +0000
treeherdermozilla-beta@1918a9cd33bc [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersedgar
bugs1587819
milestone71.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1587819. Convert [HTMLConstructor] to being an extended attribute on constructor operations. r=edgar The changes to the IDL files were done by running this in dom/webidl: perl -pi -e 'BEGIN { $/ = undef; } s/\[HTMLConstructor,\n Exposed=Window\]\ninterface ([A-Za-z]+) : HTMLElement \{/[Exposed=Window]\ninterface \1 : HTMLElement {\n [HTMLConstructor] constructor();\n/g' *.webidl and then fixing any remaining parser failures. That involved hand-editing the following files: TestCodeGen.webidl XULFrameElement.webidl XULMenuElement.webidl XULTextElement.webidl XULTreeElement.webidl HTMLAudioElement.webidl HTMLDialogElement.webidl HTMLElement.webidl HTMLEmbedElement.webidl HTMLFormElement.webidl HTMLImageElement.webidl HTMLObjectElement.webidl HTMLOptionElement.webidl HTMLSlotElement.webidl HTMLVideoElement.webidl XULElement.webidl XULPopupElement.webidl Differential Revision: https://phabricator.services.mozilla.com/D49349
dom/bindings/parser/WebIDL.py
dom/bindings/parser/tests/test_constructor.py
dom/bindings/parser/tests/test_constructor_global.py
dom/bindings/parser/tests/test_constructor_no_interface_object.py
dom/bindings/test/TestCodeGen.webidl
dom/chrome-webidl/XULFrameElement.webidl
dom/chrome-webidl/XULMenuElement.webidl
dom/chrome-webidl/XULTextElement.webidl
dom/chrome-webidl/XULTreeElement.webidl
dom/webidl/HTMLAnchorElement.webidl
dom/webidl/HTMLAreaElement.webidl
dom/webidl/HTMLAudioElement.webidl
dom/webidl/HTMLBRElement.webidl
dom/webidl/HTMLBaseElement.webidl
dom/webidl/HTMLBodyElement.webidl
dom/webidl/HTMLButtonElement.webidl
dom/webidl/HTMLCanvasElement.webidl
dom/webidl/HTMLDListElement.webidl
dom/webidl/HTMLDataElement.webidl
dom/webidl/HTMLDataListElement.webidl
dom/webidl/HTMLDetailsElement.webidl
dom/webidl/HTMLDialogElement.webidl
dom/webidl/HTMLDirectoryElement.webidl
dom/webidl/HTMLDivElement.webidl
dom/webidl/HTMLElement.webidl
dom/webidl/HTMLEmbedElement.webidl
dom/webidl/HTMLFieldSetElement.webidl
dom/webidl/HTMLFontElement.webidl
dom/webidl/HTMLFormElement.webidl
dom/webidl/HTMLFrameElement.webidl
dom/webidl/HTMLFrameSetElement.webidl
dom/webidl/HTMLHRElement.webidl
dom/webidl/HTMLHeadElement.webidl
dom/webidl/HTMLHeadingElement.webidl
dom/webidl/HTMLHtmlElement.webidl
dom/webidl/HTMLIFrameElement.webidl
dom/webidl/HTMLImageElement.webidl
dom/webidl/HTMLInputElement.webidl
dom/webidl/HTMLLIElement.webidl
dom/webidl/HTMLLabelElement.webidl
dom/webidl/HTMLLegendElement.webidl
dom/webidl/HTMLLinkElement.webidl
dom/webidl/HTMLMapElement.webidl
dom/webidl/HTMLMarqueeElement.webidl
dom/webidl/HTMLMenuElement.webidl
dom/webidl/HTMLMenuItemElement.webidl
dom/webidl/HTMLMetaElement.webidl
dom/webidl/HTMLMeterElement.webidl
dom/webidl/HTMLModElement.webidl
dom/webidl/HTMLOListElement.webidl
dom/webidl/HTMLObjectElement.webidl
dom/webidl/HTMLOptGroupElement.webidl
dom/webidl/HTMLOptionElement.webidl
dom/webidl/HTMLOutputElement.webidl
dom/webidl/HTMLParagraphElement.webidl
dom/webidl/HTMLParamElement.webidl
dom/webidl/HTMLPictureElement.webidl
dom/webidl/HTMLPreElement.webidl
dom/webidl/HTMLProgressElement.webidl
dom/webidl/HTMLQuoteElement.webidl
dom/webidl/HTMLScriptElement.webidl
dom/webidl/HTMLSelectElement.webidl
dom/webidl/HTMLSlotElement.webidl
dom/webidl/HTMLSourceElement.webidl
dom/webidl/HTMLSpanElement.webidl
dom/webidl/HTMLStyleElement.webidl
dom/webidl/HTMLTableCaptionElement.webidl
dom/webidl/HTMLTableCellElement.webidl
dom/webidl/HTMLTableColElement.webidl
dom/webidl/HTMLTableElement.webidl
dom/webidl/HTMLTableRowElement.webidl
dom/webidl/HTMLTableSectionElement.webidl
dom/webidl/HTMLTemplateElement.webidl
dom/webidl/HTMLTextAreaElement.webidl
dom/webidl/HTMLTimeElement.webidl
dom/webidl/HTMLTitleElement.webidl
dom/webidl/HTMLTrackElement.webidl
dom/webidl/HTMLUListElement.webidl
dom/webidl/HTMLVideoElement.webidl
dom/webidl/XULElement.webidl
dom/webidl/XULPopupElement.webidl
--- a/dom/bindings/parser/WebIDL.py
+++ b/dom/bindings/parser/WebIDL.py
@@ -1079,28 +1079,21 @@ class IDLInterfaceOrNamespace(IDLInterfa
                     "Can't have both a constructor and [NoInterfaceObject]",
                     [self.location, ctor.location])
 
             if self.globalNames:
                 raise WebIDLError(
                     "Can't have both a constructor and [Global]",
                     [self.location, ctor.location])
 
-            assert(len(ctor._exposureGlobalNames) == 0 or
-                   ctor._exposureGlobalNames == self._exposureGlobalNames)
+            assert(ctor._exposureGlobalNames == self._exposureGlobalNames)
             ctor._exposureGlobalNames.update(self._exposureGlobalNames)
-            if ctor in self.members:
-                # constructor operation.
-                self.members.remove(ctor)
-            else:
-                # extended attribute.  This can only happen with
-                # [HTMLConstructor] and this is the only way we can get into this
-                # code with len(ctor._exposureGlobalNames) !=
-                # self._exposureGlobalNames.
-                ctor.finish(scope)
+            # Remove the constructor operation from our member list so
+            # it doesn't get in the way later.
+            self.members.remove(ctor)
 
         for ctor in self.namedConstructors:
             if self.globalNames:
                 raise WebIDLError(
                     "Can't have both a named constructor and [Global]",
                     [self.location, ctor.location])
             assert len(ctor._exposureGlobalNames) == 0
             ctor._exposureGlobalNames.update(self._exposureGlobalNames)
@@ -1648,70 +1641,55 @@ class IDLInterface(IDLInterfaceOrNamespa
                 raise WebIDLError("TreatNonObjectAsNull cannot be specified on interfaces",
                                   [attr.location, self.location])
             elif identifier == "NoInterfaceObject":
                 if not attr.noArguments():
                     raise WebIDLError("[NoInterfaceObject] must take no arguments",
                                       [attr.location])
 
                 self._noInterfaceObject = True
-            elif identifier == "NamedConstructor" or identifier == "HTMLConstructor":
-                if identifier == "NamedConstructor" and not attr.hasValue():
+            elif identifier == "NamedConstructor":
+                if not attr.hasValue():
                     raise WebIDLError("NamedConstructor must either take an identifier or take a named argument list",
                                       [attr.location])
 
-                if identifier == "HTMLConstructor":
-                    if not attr.noArguments():
-                        raise WebIDLError(str(identifier) + " must take no arguments",
-                                          [attr.location])
 
                 args = attr.args() if attr.hasArgs() else []
 
                 retType = IDLWrapperType(self.location, self)
 
-                if identifier == "HTMLConstructor":
-                    name = "constructor"
-                    allowForbidden = True
-                else:
-                    name = attr.value()
-                    allowForbidden = False
-
-                method = IDLConstructor(
-                    attr.location, args, name,
-                    htmlConstructor=(identifier == "HTMLConstructor"))
+                method = IDLConstructor(attr.location, args, attr.value())
                 method.reallyInit(self)
 
-                # Are always assumed to be able to throw (since there's no way to
-                # indicate otherwise).
+                # Named constructors are always assumed to be able to
+                # throw (since there's no way to indicate otherwise).
                 method.addExtendedAttributes(
                     [IDLExtendedAttribute(self.location, ("Throws",))])
 
-                if identifier == "HTMLConstructor":
-                    method.resolve(self)
-                else:
-                    # We need to detect conflicts for NamedConstructors across
-                    # interfaces. We first call resolve on the parentScope,
-                    # which will merge all NamedConstructors with the same
-                    # identifier accross interfaces as overloads.
-                    method.resolve(self.parentScope)
-
-                    # Then we look up the identifier on the parentScope. If the
-                    # result is the same as the method we're adding then it
-                    # hasn't been added as an overload and it's the first time
-                    # we've encountered a NamedConstructor with that identifier.
-                    # If the result is not the same as the method we're adding
-                    # then it has been added as an overload and we need to check
-                    # whether the result is actually one of our existing
-                    # NamedConstructors.
-                    newMethod = self.parentScope.lookupIdentifier(method.identifier)
-                    if newMethod == method:
-                        self.namedConstructors.append(method)
-                    elif newMethod not in self.namedConstructors:
-                        raise WebIDLError("NamedConstructor conflicts with a NamedConstructor of a different interface",
-                                          [method.location, newMethod.location])
+                # We need to detect conflicts for NamedConstructors across
+                # interfaces. We first call resolve on the parentScope,
+                # which will merge all NamedConstructors with the same
+                # identifier accross interfaces as overloads.
+                method.resolve(self.parentScope)
+
+                # Then we look up the identifier on the parentScope. If the
+                # result is the same as the method we're adding then it
+                # hasn't been added as an overload and it's the first time
+                # we've encountered a NamedConstructor with that identifier.
+                # If the result is not the same as the method we're adding
+                # then it has been added as an overload and we need to check
+                # whether the result is actually one of our existing
+                # NamedConstructors.
+                newMethod = self.parentScope.lookupIdentifier(method.identifier)
+                if newMethod == method:
+                    self.namedConstructors.append(method)
+                elif newMethod not in self.namedConstructors:
+                    raise WebIDLError("NamedConstructor conflicts with a "
+                                      "NamedConstructor of a different interface",
+                                      [method.location, newMethod.location])
             elif (identifier == "ExceptionClass"):
                 if not attr.noArguments():
                     raise WebIDLError("[ExceptionClass] must take no arguments",
                                       [attr.location])
                 if self.parent:
                     raise WebIDLError("[ExceptionClass] must not be specified on "
                                       "an interface with inherited interfaces",
                                       [attr.location, self.location])
@@ -4874,17 +4852,17 @@ class IDLMethod(IDLInterfaceMember, IDLS
         'Named',
         'Indexed'
     )
 
     def __init__(self, location, identifier, returnType, arguments,
                  static=False, getter=False, setter=False,
                  deleter=False, specialType=NamedOrIndexed.Neither,
                  legacycaller=False, stringifier=False,
-                 maplikeOrSetlikeOrIterable=None, htmlConstructor=False):
+                 maplikeOrSetlikeOrIterable=None):
         # REVIEW: specialType is NamedOrIndexed -- wow, this is messed up.
         IDLInterfaceMember.__init__(self, location, identifier,
                                     IDLInterfaceMember.Tags.Method)
 
         self._hasOverloads = False
 
         assert isinstance(returnType, IDLType)
 
@@ -4900,20 +4878,17 @@ class IDLMethod(IDLInterfaceMember, IDLS
         assert isinstance(deleter, bool)
         self._deleter = deleter
         assert isinstance(legacycaller, bool)
         self._legacycaller = legacycaller
         assert isinstance(stringifier, bool)
         self._stringifier = stringifier
         assert maplikeOrSetlikeOrIterable is None or isinstance(maplikeOrSetlikeOrIterable, IDLMaplikeOrSetlikeOrIterableBase)
         self.maplikeOrSetlikeOrIterable = maplikeOrSetlikeOrIterable
-        assert isinstance(htmlConstructor, bool)
-        # The identifier of a HTMLConstructor must be 'constructor'.
-        assert not htmlConstructor or identifier.name == "constructor"
-        self._htmlConstructor = htmlConstructor
+        self._htmlConstructor = False
         self._specialType = specialType
         self._unforgeable = False
         self.dependsOn = "Everything"
         self.affects = "Everything"
         self.aliases = []
 
         if static and identifier.name == "prototype":
             raise WebIDLError("The identifier of a static operation must not be 'prototype'",
@@ -5398,51 +5373,62 @@ class IDLMethod(IDLInterfaceMember, IDLS
     def _getDependentObjects(self):
         deps = set()
         for overload in self._overloads:
             deps.update(overload._getDependentObjects())
         return deps
 
 
 class IDLConstructor(IDLMethod):
-    def __init__(self, location, args, name, htmlConstructor=False):
+    def __init__(self, location, args, name):
         # We can't actually init our IDLMethod yet, because we do not know the
         # return type yet.  Just save the info we have for now and we will init
         # it later.
         self._initLocation = location
         self._initArgs = args
         self._initName = name
-        self._htmlConstructor = htmlConstructor
         self._inited = False
         self._initExtendedAttrs = []
 
     def addExtendedAttributes(self, attrs):
         if self._inited:
             return IDLMethod.addExtendedAttributes(self, attrs)
         self._initExtendedAttrs.extend(attrs)
 
     def handleExtendedAttribute(self, attr):
         identifier = attr.identifier()
         if (identifier == "BinaryName" or
             identifier == "ChromeOnly" or
             identifier == "NewObject" or
             identifier == "SecureContext" or
             identifier == "Throws"):
             IDLMethod.handleExtendedAttribute(self, attr)
+        elif identifier == "HTMLConstructor":
+            if not attr.noArguments():
+                raise WebIDLError("[HTMLConstructor] must take no arguments",
+                                  [attr.location])
+            # We shouldn't end up here for named constructors.
+            assert(self.identifier.name == "constructor")
+
+            if any(len(sig[1]) != 0 for sig in self.signatures()):
+                raise WebIDLError("[HTMLConstructor] must not be applied to a "
+                                  "constructor operation that has arguments.",
+                                  [attr.location])
+            self._htmlConstructor = True
         else:
             raise WebIDLError("Unknown extended attribute %s on method" % identifier,
                               [attr.location])
 
     def reallyInit(self, parentInterface):
         name = self._initName
         location = self._initLocation
         identifier = IDLUnresolvedIdentifier(location, name, allowForbidden=True)
         retType = IDLWrapperType(parentInterface.location, parentInterface)
         IDLMethod.__init__(self, location, identifier, retType, self._initArgs,
-                           static=True, htmlConstructor=self._htmlConstructor)
+                           static=True)
         self._inited = True;
         # Propagate through whatever extended attributes we already had
         self.addExtendedAttributes(self._initExtendedAttrs)
         self._initExtendedAttrs = []
         # Constructors are always NewObject.  Whether they throw or not is
         # indicated by [Throws] annotations in the usual way.
         self.addExtendedAttributes(
             [IDLExtendedAttribute(self.location, ("NewObject",))])
--- a/dom/bindings/parser/tests/test_constructor.py
+++ b/dom/bindings/parser/tests/test_constructor.py
@@ -100,18 +100,18 @@ def WebIDLTest(parser, harness):
                "Should be an IDLInterface")
 
     checkMethod(results[0].ctor(), "::TestChromeOnlyConstructor::constructor",
                 "constructor", [("TestChromeOnlyConstructor (Wrapper)", [])],
                 chromeOnly=True)
 
     parser = parser.reset()
     parser.parse("""
-        [HTMLConstructor]
         interface TestHTMLConstructor {
+          [HTMLConstructor] constructor();
         };
     """)
     results = parser.finish()
     harness.check(len(results), 1, "Should be one production")
     harness.ok(isinstance(results[0], WebIDL.IDLInterface),
                "Should be an IDLInterface")
 
     checkMethod(results[0].ctor(), "::TestHTMLConstructor::constructor",
@@ -133,170 +133,170 @@ def WebIDLTest(parser, harness):
 
     harness.ok(threw, "Can't have both a constructor and a ChromeOnly constructor")
 
     # Test HTMLConstructor with argument
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
-            [HTMLConstructor(DOMString a)]
             interface TestHTMLConstructorWithArgs {
+              [HTMLConstructor] constructor(DOMString a);
             };
         """)
         results = parser.finish()
     except:
         threw = True
 
     harness.ok(threw, "HTMLConstructor should take no argument")
 
     # Test HTMLConstructor on a callback interface
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
-            [HTMLConstructor]
             callback interface TestHTMLConstructorOnCallbackInterface {
+              [HTMLConstructor] constructor();
             };
         """)
         results = parser.finish()
     except:
         threw = True
 
     harness.ok(threw, "HTMLConstructor can't be used on a callback interface")
 
     # Test HTMLConstructor and constructor operation
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
-            [HTMLConstructor]
             interface TestHTMLConstructorAndConstructor {
               constructor();
+              [HTMLConstructor] constructor();
             };
         """)
         results = parser.finish()
     except:
         threw = True
 
     harness.ok(threw, "Can't have both a constructor and a HTMLConstructor")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
-            [HTMLConstructor]
             interface TestHTMLConstructorAndConstructor {
               [Throws]
               constructor();
+              [HTMLConstructor] constructor();
             };
         """)
         results = parser.finish()
     except:
         threw = True
 
     harness.ok(threw,
                "Can't have both a throwing constructor and a HTMLConstructor")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
-            [HTMLConstructor]
             interface TestHTMLConstructorAndConstructor {
               constructor(DOMString a);
+              [HTMLConstructor] constructor();
             };
         """)
         results = parser.finish()
     except:
         threw = True
 
     harness.ok(threw,
                "Can't have both a HTMLConstructor and a constructor operation")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
-            [HTMLConstructor]
             interface TestHTMLConstructorAndConstructor {
               [Throws]
               constructor(DOMString a);
+              [HTMLConstructor] constructor();
             };
         """)
         results = parser.finish()
     except:
         threw = True
 
     harness.ok(threw,
                "Can't have both a HTMLConstructor and a throwing constructor "
                "operation")
 
     # Test HTMLConstructor and [ChromeOnly] constructor operation
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
-            [HTMLConstructor]
             interface TestHTMLConstructorAndConstructor {
               [ChromeOnly]
               constructor();
+              [HTMLConstructor] constructor();
             };
         """)
         results = parser.finish()
     except:
         threw = True
 
     harness.ok(threw,
                "Can't have both a ChromeOnly constructor and a HTMLConstructor")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
-            [HTMLConstructor]
             interface TestHTMLConstructorAndConstructor {
               [Throws, ChromeOnly]
               constructor();
+              [HTMLConstructor] constructor();
             };
         """)
         results = parser.finish()
     except:
         threw = True
 
     harness.ok(threw,
                "Can't have both a throwing chromeonly constructor and a "
                "HTMLConstructor")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
-            [HTMLConstructor]
             interface TestHTMLConstructorAndConstructor {
               [ChromeOnly]
               constructor(DOMString a);
+              [HTMLConstructor] constructor();
             };
         """)
         results = parser.finish()
     except:
         threw = True
 
     harness.ok(threw,
                "Can't have both a HTMLConstructor and a chromeonly constructor "
                "operation")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
-            [HTMLConstructor]
             interface TestHTMLConstructorAndConstructor {
               [Throws, ChromeOnly]
               constructor(DOMString a);
+              [HTMLConstructor] constructor();
             };
         """)
         results = parser.finish()
     except:
         threw = True
 
     harness.ok(threw,
                "Can't have both a HTMLConstructor and a throwing chromeonly "
--- a/dom/bindings/parser/tests/test_constructor_global.py
+++ b/dom/bindings/parser/tests/test_constructor_global.py
@@ -45,33 +45,19 @@ def WebIDLTest(parser, harness):
         threw = True
 
     harness.ok(threw, "Should have thrown.")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
-            [Global, HTMLConstructor, Exposed=TestHTMLConstructorGlobal]
+            [Global, Exposed=TestHTMLConstructorGlobal]
             interface TestHTMLConstructorGlobal {
+              [HTMLConstructor] constructor();
             };
         """)
 
         results = parser.finish()
     except:
         threw = True
 
     harness.ok(threw, "Should have thrown.")
-
-    parser = parser.reset()
-    threw = False
-    try:
-        parser.parse("""
-            [HTMLConstructor, Global, Exposed=TestHTMLConstructorGlobal]
-            interface TestHTMLConstructorGlobal {
-            };
-        """)
-
-        results = parser.finish()
-    except:
-        threw = True
-
-    harness.ok(threw, "Should have thrown.")
--- a/dom/bindings/parser/tests/test_constructor_no_interface_object.py
+++ b/dom/bindings/parser/tests/test_constructor_no_interface_object.py
@@ -23,34 +23,19 @@ def WebIDLTest(parser, harness):
     """)
 
     # Test HTMLConstructor and NoInterfaceObject
     parser = parser.reset()
 
     threw = False
     try:
         parser.parse("""
-            [NoInterfaceObject, HTMLConstructor]
+            [NoInterfaceObject]
             interface TestHTMLConstructorNoInterfaceObject {
+              [HTMLConstructor] constructor();
             };
         """)
 
         results = parser.finish()
     except:
         threw = True
 
     harness.ok(threw, "Should have thrown.")
-
-    parser = parser.reset()
-
-    threw = False
-    try:
-        parser.parse("""
-            [HTMLConstructor, NoInterfaceObject]
-            interface TestHTMLConstructorNoInterfaceObject {
-            };
-        """)
-
-        results = parser.finish()
-    except:
-        threw = True
-
-    harness.ok(threw, "Should have thrown.")
--- a/dom/bindings/test/TestCodeGen.webidl
+++ b/dom/bindings/test/TestCodeGen.webidl
@@ -1322,19 +1322,19 @@ interface TestWorkerExposedInterface {
   [NeedsSubjectPrincipal] void needsSubjectPrincipalMethod();
   [NeedsSubjectPrincipal] attribute boolean needsSubjectPrincipalAttr;
   [NeedsCallerType] void needsCallerTypeMethod();
   [NeedsCallerType] attribute boolean needsCallerTypeAttr;
   [NeedsSubjectPrincipal=NonSystem] void needsNonSystemSubjectPrincipalMethod();
   [NeedsSubjectPrincipal=NonSystem] attribute boolean needsNonSystemSubjectPrincipalAttr;
 };
 
-[HTMLConstructor,
- Exposed=Window]
+[Exposed=Window]
 interface TestHTMLConstructorInterface {
+  [HTMLConstructor] constructor();
 };
 
 [Exposed=Window]
 interface TestThrowingConstructorInterface {
   [Throws]
   constructor();
   [Throws]
   constructor(DOMString str);
--- a/dom/chrome-webidl/XULFrameElement.webidl
+++ b/dom/chrome-webidl/XULFrameElement.webidl
@@ -1,20 +1,22 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 interface nsIDocShell;
 interface nsIWebNavigation;
 
-[HTMLConstructor, Func="IsChromeOrXBL",
+[Func="IsChromeOrXBL",
  Exposed=Window]
 interface XULFrameElement : XULElement
 {
+  [HTMLConstructor] constructor();
+
   readonly attribute nsIDocShell? docShell;
   readonly attribute nsIWebNavigation? webNavigation;
 
   readonly attribute WindowProxy? contentWindow;
   readonly attribute Document? contentDocument; 
 };
 
 XULFrameElement includes MozFrameLoaderOwner;
--- a/dom/chrome-webidl/XULMenuElement.webidl
+++ b/dom/chrome-webidl/XULMenuElement.webidl
@@ -1,18 +1,19 @@
 
 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-[HTMLConstructor, Func="IsChromeOrXBL",
+[Func="IsChromeOrXBL",
  Exposed=Window]
 interface XULMenuElement : XULElement {
+  [HTMLConstructor] constructor();
 
   attribute Element? activeChild;
 
   boolean handleKeyPress(KeyboardEvent keyEvent);
 
   readonly attribute boolean openedWithKey;
 
 };
--- a/dom/chrome-webidl/XULTextElement.webidl
+++ b/dom/chrome-webidl/XULTextElement.webidl
@@ -1,14 +1,16 @@
 
 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-[HTMLConstructor, Func="IsChromeOrXBL",
+[Func="IsChromeOrXBL",
  Exposed=Window]
 interface XULTextElement : XULElement {
+  [HTMLConstructor] constructor();
+
   attribute boolean disabled;
   attribute DOMString value;
   attribute DOMString accessKey;
 };
--- a/dom/chrome-webidl/XULTreeElement.webidl
+++ b/dom/chrome-webidl/XULTreeElement.webidl
@@ -8,20 +8,22 @@
 interface MozTreeView;
 
 dictionary TreeCellInfo {
     long row = 0;
     TreeColumn? col = null;
     DOMString childElt = "";
 };
 
-[HTMLConstructor, Func="IsChromeOrXBL",
+[Func="IsChromeOrXBL",
  Exposed=Window]
 interface XULTreeElement : XULElement
 {
+  [HTMLConstructor] constructor();
+
   /**
    * Obtain the columns.
    */
   readonly attribute TreeColumns? columns;
 
   /**
    * The view that backs the tree and that supplies it with its data.
    * It is dynamically settable, either using a view attribute on the
--- a/dom/webidl/HTMLAnchorElement.webidl
+++ b/dom/webidl/HTMLAnchorElement.webidl
@@ -7,19 +7,20 @@
  * http://www.whatwg.org/specs/web-apps/current-work/#the-a-element
  * http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
  * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
  * Opera Software ASA. You are granted a license to use, reproduce
  * and create derivative works of this document.
  */
 
 // http://www.whatwg.org/specs/web-apps/current-work/#the-a-element
-[HTMLConstructor,
- Exposed=Window]
+[Exposed=Window]
 interface HTMLAnchorElement : HTMLElement {
+  [HTMLConstructor] constructor();
+
            [CEReactions, SetterThrows]
            attribute DOMString target;
            [CEReactions, SetterThrows]
            attribute DOMString download;
            [CEReactions, SetterThrows]
            attribute DOMString ping;
            [CEReactions, SetterThrows]
            attribute DOMString rel;
--- a/dom/webidl/HTMLAreaElement.webidl
+++ b/dom/webidl/HTMLAreaElement.webidl
@@ -8,19 +8,20 @@
  * http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
  &
  * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
  * Opera Software ASA. You are granted a license to use, reproduce
  * and create derivative works of this document.
  */
 
 // http://www.whatwg.org/specs/web-apps/current-work/#the-area-element
-[HTMLConstructor,
- Exposed=Window]
+[Exposed=Window]
 interface HTMLAreaElement : HTMLElement {
+  [HTMLConstructor] constructor();
+
            [CEReactions, SetterThrows]
            attribute DOMString alt;
            [CEReactions, SetterThrows]
            attribute DOMString coords;
            [CEReactions, SetterThrows]
            attribute DOMString shape;
            [CEReactions, SetterThrows]
            attribute DOMString target;
--- a/dom/webidl/HTMLAudioElement.webidl
+++ b/dom/webidl/HTMLAudioElement.webidl
@@ -6,12 +6,14 @@
  * The origin of this IDL file is
  * http://www.whatwg.org/specs/web-apps/current-work/#the-audio-element
  *
  * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
  * Opera Software ASA. You are granted a license to use, reproduce
  * and create derivative works of this document.
  */
 
-[HTMLConstructor, NamedConstructor=Audio(optional DOMString src),
+[NamedConstructor=Audio(optional DOMString src),
  Exposed=Window]
-interface HTMLAudioElement : HTMLMediaElement {};
+interface HTMLAudioElement : HTMLMediaElement {
+  [HTMLConstructor] constructor();
+};
 
--- a/dom/webidl/HTMLBRElement.webidl
+++ b/dom/webidl/HTMLBRElement.webidl
@@ -8,19 +8,20 @@
  * http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
  *
  * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
  * Opera Software ASA. You are granted a license to use, reproduce
  * and create derivative works of this document.
  */
 
 // http://www.whatwg.org/specs/web-apps/current-work/#the-br-element
-[HTMLConstructor,
- Exposed=Window]
-interface HTMLBRElement : HTMLElement {};
+[Exposed=Window]
+interface HTMLBRElement : HTMLElement {
+  [HTMLConstructor] constructor();
+};
 
 // http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
 partial interface HTMLBRElement {
              [CEReactions, SetterThrows]
              attribute DOMString clear;
 };
 
 // Mozilla extensions
--- a/dom/webidl/HTMLBaseElement.webidl
+++ b/dom/webidl/HTMLBaseElement.webidl
@@ -7,17 +7,18 @@
  * http://www.whatwg.org/specs/web-apps/current-work/#the-base-element
  *
  * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
  * Opera Software ASA. You are granted a license to use, reproduce
  * and create derivative works of this document.
  */
 
 // http://www.whatwg.org/specs/web-apps/current-work/#the-base-element
-[HTMLConstructor,
- Exposed=Window]
+[Exposed=Window]
 interface HTMLBaseElement : HTMLElement {
+  [HTMLConstructor] constructor();
+
            [CEReactions, SetterThrows, Pure]
            attribute DOMString href;
            [CEReactions, SetterThrows, Pure]
            attribute DOMString target;
 };
 
--- a/dom/webidl/HTMLBodyElement.webidl
+++ b/dom/webidl/HTMLBodyElement.webidl
@@ -6,19 +6,20 @@
  * The origin of this IDL file is
  * http://www.whatwg.org/specs/web-apps/current-work/
  *
  * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
  * Opera Software ASA. You are granted a license to use, reproduce
  * and create derivative works of this document.
  */
 
-[HTMLConstructor,
- Exposed=Window]
+[Exposed=Window]
 interface HTMLBodyElement : HTMLElement {
+  [HTMLConstructor] constructor();
+
 };
 
 partial interface HTMLBodyElement {
   [CEReactions, SetterThrows]
   attribute [TreatNullAs=EmptyString] DOMString text;
   [CEReactions, SetterThrows]
   attribute [TreatNullAs=EmptyString] DOMString link;
   [CEReactions, SetterThrows]
--- a/dom/webidl/HTMLButtonElement.webidl
+++ b/dom/webidl/HTMLButtonElement.webidl
@@ -6,19 +6,20 @@
  * The origin of this IDL file is
  * http://www.whatwg.org/specs/web-apps/current-work/#the-button-element
  * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
  * Opera Software ASA. You are granted a license to use, reproduce
  * and create derivative works of this document.
  */
 
 // http://www.whatwg.org/specs/web-apps/current-work/#the-button-element
-[HTMLConstructor,
- Exposed=Window]
+[Exposed=Window]
 interface HTMLButtonElement : HTMLElement {
+  [HTMLConstructor] constructor();
+
   [CEReactions, SetterThrows, Pure]
            attribute boolean autofocus;
   [CEReactions, SetterThrows, Pure]
            attribute boolean disabled;
   [Pure]
   readonly attribute HTMLFormElement? form;
   [CEReactions, SetterThrows, Pure]
            attribute DOMString formAction;
--- a/dom/webidl/HTMLCanvasElement.webidl
+++ b/dom/webidl/HTMLCanvasElement.webidl
@@ -8,19 +8,20 @@
  * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
  * Opera Software ASA. You are granted a license to use, reproduce
  * and create derivative works of this document.
  */
 
 interface nsISupports;
 interface Variant;
 
-[HTMLConstructor,
- Exposed=Window]
+[Exposed=Window]
 interface HTMLCanvasElement : HTMLElement {
+  [HTMLConstructor] constructor();
+
   [CEReactions, Pure, SetterThrows]
            attribute unsigned long width;
   [CEReactions, Pure, SetterThrows]
            attribute unsigned long height;
 
   [Throws]
   nsISupports? getContext(DOMString contextId, optional any contextOptions = null);
 
--- a/dom/webidl/HTMLDListElement.webidl
+++ b/dom/webidl/HTMLDListElement.webidl
@@ -8,18 +8,19 @@
  * http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
  *
  * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
  * Opera Software ASA. You are granted a license to use, reproduce
  * and create derivative works of this document.
  */
 
 // http://www.whatwg.org/specs/web-apps/current-work/#the-dl-element
-[HTMLConstructor,
- Exposed=Window]
+[Exposed=Window]
 interface HTMLDListElement : HTMLElement {
+  [HTMLConstructor] constructor();
+
 };
 
 // http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
 partial interface HTMLDListElement {
            [CEReactions, SetterThrows]
            attribute boolean compact;
 };
--- a/dom/webidl/HTMLDataElement.webidl
+++ b/dom/webidl/HTMLDataElement.webidl
@@ -2,14 +2,15 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/.
  *
  * The origin of this IDL file is
  * http://www.whatwg.org/specs/web-apps/current-work/multipage/text-level-semantics.html#the-data-element
  */
 
-[HTMLConstructor,
- Exposed=Window]
+[Exposed=Window]
 interface HTMLDataElement : HTMLElement {
+  [HTMLConstructor] constructor();
+
            [CEReactions, SetterThrows]
            attribute DOMString value;
 };
--- a/dom/webidl/HTMLDataListElement.webidl
+++ b/dom/webidl/HTMLDataListElement.webidl
@@ -6,13 +6,14 @@
  * The origin of this IDL file is
  * http://www.whatwg.org/specs/web-apps/current-work/
  *
  * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
  * Opera Software ASA. You are granted a license to use, reproduce
  * and create derivative works of this document.
  */
 
-[HTMLConstructor,
- Exposed=Window]
+[Exposed=Window]
 interface HTMLDataListElement : HTMLElement {
+  [HTMLConstructor] constructor();
+
   readonly attribute HTMLCollection options;
 };
--- a/dom/webidl/HTMLDetailsElement.webidl
+++ b/dom/webidl/HTMLDetailsElement.webidl
@@ -6,14 +6,15 @@
  * The origin of this IDL file is
  * https://html.spec.whatwg.org/multipage/forms.html#the-details-element
  *
  * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
  * Opera Software ASA. You are granted a license to use, reproduce
  * and create derivative works of this document.
  */
 
-[HTMLConstructor,
- Exposed=Window]
+[Exposed=Window]
 interface HTMLDetailsElement : HTMLElement {
+  [HTMLConstructor] constructor();
+
   [CEReactions, SetterThrows]
   attribute boolean open;
 };
--- a/dom/webidl/HTMLDialogElement.webidl
+++ b/dom/webidl/HTMLDialogElement.webidl
@@ -6,19 +6,21 @@
  * The origin of this IDL file is
  * https://html.spec.whatwg.org/multipage/forms.html#the-dialog-element
  *
  * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
  * Opera Software ASA. You are granted a license to use, reproduce
  * and create derivative works of this document.
  */
 
-[Pref="dom.dialog_element.enabled", HTMLConstructor,
+[Pref="dom.dialog_element.enabled",
  Exposed=Window]
 interface HTMLDialogElement : HTMLElement {
+  [HTMLConstructor] constructor();
+
   [CEReactions, SetterThrows]
   attribute boolean open;
   attribute DOMString returnValue;
   [CEReactions]
   void show();
   [CEReactions, Throws]
   void showModal();
   [CEReactions]
--- a/dom/webidl/HTMLDirectoryElement.webidl
+++ b/dom/webidl/HTMLDirectoryElement.webidl
@@ -7,15 +7,16 @@
  * http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
  *
  * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
  * Opera Software ASA. You are granted a license to use, reproduce
  * and create derivative works of this document.
  */
 
 // http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
-[HTMLConstructor,
- Exposed=Window]
+[Exposed=Window]
 interface HTMLDirectoryElement : HTMLElement {
+  [HTMLConstructor] constructor();
+
            [CEReactions, SetterThrows, Pure]
            attribute boolean compact;
 };
 
--- a/dom/webidl/HTMLDivElement.webidl
+++ b/dom/webidl/HTMLDivElement.webidl
@@ -6,16 +6,17 @@
  * The origin of this IDL file is
  * http://www.whatwg.org/specs/web-apps/current-work/
  *
  * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
  * Opera Software ASA. You are granted a license to use, reproduce
  * and create derivative works of this document.
  */
 
-[HTMLConstructor,
- Exposed=Window]
-interface HTMLDivElement : HTMLElement {};
+[Exposed=Window]
+interface HTMLDivElement : HTMLElement {
+  [HTMLConstructor] constructor();
+};
 
 partial interface HTMLDivElement {
   [CEReactions, SetterThrows]
            attribute DOMString align;
 };
--- a/dom/webidl/HTMLElement.webidl
+++ b/dom/webidl/HTMLElement.webidl
@@ -7,19 +7,20 @@
  * http://www.whatwg.org/specs/web-apps/current-work/ and
  * http://dev.w3.org/csswg/cssom-view/
  *
  * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
  * Opera Software ASA. You are granted a license to use, reproduce
  * and create derivative works of this document.
  */
 
-[HTMLConstructor,
- Exposed=Window]
+[Exposed=Window]
 interface HTMLElement : Element {
+  [HTMLConstructor] constructor();
+
   // metadata attributes
   [CEReactions]
            attribute DOMString title;
   [CEReactions]
            attribute DOMString lang;
   //         attribute boolean translate;
   [CEReactions, SetterThrows, Pure]
            attribute DOMString dir;
--- a/dom/webidl/HTMLEmbedElement.webidl
+++ b/dom/webidl/HTMLEmbedElement.webidl
@@ -8,19 +8,21 @@
  * http://www.whatwg.org/specs/web-apps/current-work/#HTMLEmbedElement-partial
  *
  * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
  * Opera Software ASA. You are granted a license to use, reproduce
  * and create derivative works of this document.
  */
 
 // http://www.whatwg.org/specs/web-apps/current-work/#the-embed-element
-[HTMLConstructor, NeedResolve,
+[NeedResolve,
  Exposed=Window]
 interface HTMLEmbedElement : HTMLElement {
+  [HTMLConstructor] constructor();
+
   [CEReactions, Pure, SetterThrows]
            attribute DOMString src;
   [CEReactions, Pure, SetterThrows]
            attribute DOMString type;
   [CEReactions, Pure, SetterThrows]
            attribute DOMString width;
   [CEReactions, Pure, SetterThrows]
            attribute DOMString height;
--- a/dom/webidl/HTMLFieldSetElement.webidl
+++ b/dom/webidl/HTMLFieldSetElement.webidl
@@ -6,19 +6,20 @@
  * The origin of this IDL file is
  * http://www.whatwg.org/specs/web-apps/current-work/#the-fieldset-element
  *
  * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
  * Opera Software ASA. You are granted a license to use, reproduce
  * and create derivative works of this document.
  */
 
-[HTMLConstructor,
- Exposed=Window]
+[Exposed=Window]
 interface HTMLFieldSetElement : HTMLElement {
+  [HTMLConstructor] constructor();
+
   [CEReactions, SetterThrows]
            attribute boolean disabled;
   readonly attribute HTMLFormElement? form;
   [CEReactions, SetterThrows]
            attribute DOMString name;
 
   readonly attribute DOMString type;
 
--- a/dom/webidl/HTMLFontElement.webidl
+++ b/dom/webidl/HTMLFontElement.webidl
@@ -6,15 +6,16 @@
  * The origin of this IDL file is
  * http://www.whatwg.org/specs/web-apps/current-work/
  *
  * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
  * Opera Software ASA. You are granted a license to use, reproduce
  * and create derivative works of this document.
  */
 
-[HTMLConstructor,
- Exposed=Window]
+[Exposed=Window]
 interface HTMLFontElement : HTMLElement {
+  [HTMLConstructor] constructor();
+
   [CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString color;
   [CEReactions, SetterThrows]                          attribute DOMString face;
   [CEReactions, SetterThrows]                          attribute DOMString size;
 };
--- a/dom/webidl/HTMLFormElement.webidl
+++ b/dom/webidl/HTMLFormElement.webidl
@@ -6,19 +6,21 @@
  * The origin of this IDL file is
  * http://www.whatwg.org/specs/web-apps/current-work/#htmlformelement
  *
  * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
  * Opera Software ASA. You are granted a license to use, reproduce
  * and create derivative works of this document.
  */
 
-[OverrideBuiltins, LegacyUnenumerableNamedProperties, HTMLConstructor,
+[OverrideBuiltins, LegacyUnenumerableNamedProperties,
  Exposed=Window]
 interface HTMLFormElement : HTMLElement {
+  [HTMLConstructor] constructor();
+
            [CEReactions, Pure, SetterThrows]
            attribute DOMString acceptCharset;
            [CEReactions, Pure, SetterThrows]
            attribute DOMString action;
            [CEReactions, Pure, SetterThrows]
            attribute DOMString autocomplete;
            [CEReactions, Pure, SetterThrows]
            attribute DOMString enctype;
--- a/dom/webidl/HTMLFrameElement.webidl
+++ b/dom/webidl/HTMLFrameElement.webidl
@@ -6,19 +6,20 @@
  * The origin of this IDL file is
  * http://www.whatwg.org/specs/web-apps/current-work/#htmlframeelement
  * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
  * Opera Software ASA. You are granted a license to use, reproduce
  * and create derivative works of this document.
  */
 
 // http://www.whatwg.org/specs/web-apps/current-work/#htmlframeelement
-[HTMLConstructor,
- Exposed=Window]
+[Exposed=Window]
 interface HTMLFrameElement : HTMLElement {
+  [HTMLConstructor] constructor();
+
            [CEReactions, SetterThrows]
            attribute DOMString name;
            [CEReactions, SetterThrows]
            attribute DOMString scrolling;
            [CEReactions, SetterNeedsSubjectPrincipal=NonSystem, SetterThrows]
            attribute DOMString src;
            [CEReactions, SetterThrows]
            attribute DOMString frameBorder;
--- a/dom/webidl/HTMLFrameSetElement.webidl
+++ b/dom/webidl/HTMLFrameSetElement.webidl
@@ -6,18 +6,19 @@
  * The origin of this IDL file is
  * http://www.whatwg.org/specs/web-apps/current-work/
  *
  * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
  * Opera Software ASA. You are granted a license to use, reproduce
  * and create derivative works of this document.
  */
 
-[HTMLConstructor,
- Exposed=Window]
+[Exposed=Window]
 interface HTMLFrameSetElement : HTMLElement {
+  [HTMLConstructor] constructor();
+
   [CEReactions, SetterThrows]
   attribute DOMString cols;
   [CEReactions, SetterThrows]
   attribute DOMString rows;
 };
 
 HTMLFrameSetElement includes WindowEventHandlers;
--- a/dom/webidl/HTMLHRElement.webidl
+++ b/dom/webidl/HTMLHRElement.webidl
@@ -7,19 +7,20 @@
  * http://www.whatwg.org/specs/web-apps/current-work/#the-hr-element
  * http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
  * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
  * Opera Software ASA. You are granted a license to use, reproduce
  * and create derivative works of this document.
  */
 
 // http://www.whatwg.org/specs/web-apps/current-work/#the-hr-element
-[HTMLConstructor,
- Exposed=Window]
+[Exposed=Window]
 interface HTMLHRElement : HTMLElement {
+  [HTMLConstructor] constructor();
+
 };
 
 // http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
 partial interface HTMLHRElement {
            [CEReactions, SetterThrows]
            attribute DOMString align;
            [CEReactions, SetterThrows]
            attribute DOMString color;
--- a/dom/webidl/HTMLHeadElement.webidl
+++ b/dom/webidl/HTMLHeadElement.webidl
@@ -7,12 +7,13 @@
  * http://www.whatwg.org/specs/web-apps/current-work/#the-head-element
  *
  * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
  * Opera Software ASA. You are granted a license to use, reproduce
  * and create derivative works of this document.
  */
 
 // http://www.whatwg.org/specs/web-apps/current-work/#the-head-element
-[HTMLConstructor,
- Exposed=Window]
-interface HTMLHeadElement : HTMLElement {};
+[Exposed=Window]
+interface HTMLHeadElement : HTMLElement {
+  [HTMLConstructor] constructor();
+};
 
--- a/dom/webidl/HTMLHeadingElement.webidl
+++ b/dom/webidl/HTMLHeadingElement.webidl
@@ -7,18 +7,19 @@
  * http://www.whatwg.org/specs/web-apps/current-work/#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements
  * http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
  * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
  * Opera Software ASA. You are granted a license to use, reproduce
  * and create derivative works of this document.
  */
 
 // http://www.whatwg.org/specs/web-apps/current-work/#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements
-[HTMLConstructor,
- Exposed=Window]
+[Exposed=Window]
 interface HTMLHeadingElement : HTMLElement {
+  [HTMLConstructor] constructor();
+
 };
 
 // http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
 partial interface HTMLHeadingElement {
            [CEReactions, SetterThrows]
            attribute DOMString align;
 };
--- a/dom/webidl/HTMLHtmlElement.webidl
+++ b/dom/webidl/HTMLHtmlElement.webidl
@@ -8,17 +8,18 @@
  * http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
  *
  * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
  * Opera Software ASA. You are granted a license to use, reproduce
  * and create derivative works of this document.
  */
 
 // http://www.whatwg.org/specs/web-apps/current-work/#the-html-element
-[HTMLConstructor,
- Exposed=Window]
-interface HTMLHtmlElement : HTMLElement {};
+[Exposed=Window]
+interface HTMLHtmlElement : HTMLElement {
+  [HTMLConstructor] constructor();
+};
 
 // http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
 partial interface HTMLHtmlElement {
            [CEReactions, SetterThrows, Pure]
            attribute DOMString version;
 };
--- a/dom/webidl/HTMLIFrameElement.webidl
+++ b/dom/webidl/HTMLIFrameElement.webidl
@@ -8,19 +8,20 @@
  * http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
  * https://wicg.github.io/feature-policy/#policy
  *
  * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
  * Opera Software ASA. You are granted a license to use, reproduce
  * and create derivative works of this document.
  */
 
-[HTMLConstructor,
- Exposed=Window]
+[Exposed=Window]
 interface HTMLIFrameElement : HTMLElement {
+  [HTMLConstructor] constructor();
+
   [CEReactions, SetterNeedsSubjectPrincipal=NonSystem, SetterThrows, Pure]
            attribute DOMString src;
   [CEReactions, SetterThrows, Pure]
            attribute DOMString srcdoc;
   [CEReactions, SetterThrows, Pure]
            attribute DOMString name;
   [PutForwards=value] readonly attribute DOMTokenList sandbox;
            // attribute boolean seamless;
--- a/dom/webidl/HTMLImageElement.webidl
+++ b/dom/webidl/HTMLImageElement.webidl
@@ -11,20 +11,21 @@
  * and create derivative works of this document.
  */
 
 interface imgINotificationObserver;
 interface imgIRequest;
 interface URI;
 interface nsIStreamListener;
 
-[HTMLConstructor,
- NamedConstructor=Image(optional unsigned long width, optional unsigned long height),
+[NamedConstructor=Image(optional unsigned long width, optional unsigned long height),
  Exposed=Window]
 interface HTMLImageElement : HTMLElement {
+  [HTMLConstructor] constructor();
+
            [CEReactions, SetterThrows]
            attribute DOMString alt;
            [CEReactions, SetterNeedsSubjectPrincipal=NonSystem, SetterThrows]
            attribute DOMString src;
            [CEReactions, SetterNeedsSubjectPrincipal=NonSystem, SetterThrows]
            attribute DOMString srcset;
            [CEReactions, SetterThrows]
            attribute DOMString? crossOrigin;
--- a/dom/webidl/HTMLInputElement.webidl
+++ b/dom/webidl/HTMLInputElement.webidl
@@ -17,19 +17,20 @@ enum SelectionMode {
   "select",
   "start",
   "end",
   "preserve",
 };
 
 interface XULControllers;
 
-[HTMLConstructor,
- Exposed=Window]
+[Exposed=Window]
 interface HTMLInputElement : HTMLElement {
+  [HTMLConstructor] constructor();
+
   [CEReactions, Pure, SetterThrows]
            attribute DOMString accept;
   [CEReactions, Pure, SetterThrows]
            attribute DOMString alt;
   [CEReactions, Pure, SetterThrows]
            attribute DOMString autocomplete;
   [CEReactions, Pure, SetterThrows]
            attribute boolean autofocus;
--- a/dom/webidl/HTMLLIElement.webidl
+++ b/dom/webidl/HTMLLIElement.webidl
@@ -8,19 +8,20 @@
  * http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
  *
  * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
  * Opera Software ASA. You are granted a license to use, reproduce
  * and create derivative works of this document.
  */
 
 // http://www.whatwg.org/specs/web-apps/current-work/#the-li-element
-[HTMLConstructor,
- Exposed=Window]
+[Exposed=Window]
 interface HTMLLIElement : HTMLElement {
+  [HTMLConstructor] constructor();
+
            [CEReactions, SetterThrows, Pure]
            attribute long value;
 };
 
 // http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
 partial interface HTMLLIElement {
            [CEReactions, SetterThrows, Pure]
            attribute DOMString type;
--- a/dom/webidl/HTMLLabelElement.webidl
+++ b/dom/webidl/HTMLLabelElement.webidl
@@ -6,16 +6,17 @@
  * The origin of this IDL file is
  * http://www.whatwg.org/specs/web-apps/current-work/
  *
  * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
  * Opera Software ASA. You are granted a license to use, reproduce
  * and create derivative works of this document.
  */
 
-[HTMLConstructor,
- Exposed=Window]
+[Exposed=Window]
 interface HTMLLabelElement : HTMLElement {
+  [HTMLConstructor] constructor();
+
   readonly attribute HTMLFormElement? form;
   [CEReactions]
            attribute DOMString htmlFor;
   readonly attribute HTMLElement? control;
 };
--- a/dom/webidl/HTMLLegendElement.webidl
+++ b/dom/webidl/HTMLLegendElement.webidl
@@ -8,19 +8,20 @@
  * http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
  *
  * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
  * Opera Software ASA. You are granted a license to use, reproduce
  * and create derivative works of this document.
  */
 
 // http://www.whatwg.org/specs/web-apps/current-work/#the-legend-element
-[HTMLConstructor,
- Exposed=Window]
+[Exposed=Window]
 interface HTMLLegendElement : HTMLElement {
+  [HTMLConstructor] constructor();
+
   readonly attribute HTMLFormElement? form;
 };
 
 // http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
 partial interface HTMLLegendElement {
            [CEReactions, SetterThrows]
            attribute DOMString align;
 };
--- a/dom/webidl/HTMLLinkElement.webidl
+++ b/dom/webidl/HTMLLinkElement.webidl
@@ -7,19 +7,20 @@
  * http://www.whatwg.org/specs/web-apps/current-work/#the-link-element
  * http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
  * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
  * Opera Software ASA. You are granted a license to use, reproduce
  * and create derivative works of this document.
  */
 
 // http://www.whatwg.org/specs/web-apps/current-work/#the-link-element
-[HTMLConstructor,
- Exposed=Window]
+[Exposed=Window]
 interface HTMLLinkElement : HTMLElement {
+  [HTMLConstructor] constructor();
+
   [CEReactions, SetterThrows, Pure]
            attribute boolean disabled;
   [CEReactions, SetterNeedsSubjectPrincipal=NonSystem, SetterThrows, Pure]
            attribute DOMString href;
   [CEReactions, SetterThrows, Pure]
            attribute DOMString? crossOrigin;
   [CEReactions, SetterThrows, Pure]
            attribute DOMString rel;
--- a/dom/webidl/HTMLMapElement.webidl
+++ b/dom/webidl/HTMLMapElement.webidl
@@ -6,18 +6,19 @@
  * The origin of this IDL file is
  * http://www.whatwg.org/specs/web-apps/current-work/#the-map-element
  * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
  * Opera Software ASA. You are granted a license to use, reproduce
  * and create derivative works of this document.
  */
 
 // http://www.whatwg.org/specs/web-apps/current-work/#the-map-element
-[HTMLConstructor,
- Exposed=Window]
+[Exposed=Window]
 interface HTMLMapElement : HTMLElement {
+  [HTMLConstructor] constructor();
+
   [CEReactions, SetterThrows, Pure]
            attribute DOMString name;
   [Constant]
   readonly attribute HTMLCollection areas;
   // Not supported yet.
   //readonly attribute HTMLCollection images;
 };
--- a/dom/webidl/HTMLMarqueeElement.webidl
+++ b/dom/webidl/HTMLMarqueeElement.webidl
@@ -7,19 +7,20 @@
  * https://html.spec.whatwg.org/multipage/obsolete.html#the-marquee-element
  * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
  * Opera Software ASA. You are granted a license to use, reproduce
  * and create derivative works of this document.
  */
 
 // https://html.spec.whatwg.org/multipage/obsolete.html#the-marquee-element
 
-[HTMLConstructor,
- Exposed=Window]
+[Exposed=Window]
 interface HTMLMarqueeElement : HTMLElement {
+  [HTMLConstructor] constructor();
+
   [CEReactions, SetterThrows] attribute DOMString behavior;
   [CEReactions, SetterThrows] attribute DOMString bgColor;
   [CEReactions, SetterThrows] attribute DOMString direction;
   [CEReactions, SetterThrows] attribute DOMString height;
   [CEReactions, SetterThrows] attribute unsigned long hspace;
   [CEReactions, SetterThrows] attribute long loop;
   [CEReactions, SetterThrows] attribute unsigned long scrollAmount;
   [CEReactions, SetterThrows] attribute unsigned long scrollDelay;
--- a/dom/webidl/HTMLMenuElement.webidl
+++ b/dom/webidl/HTMLMenuElement.webidl
@@ -10,19 +10,20 @@
  * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
  * Opera Software ASA. You are granted a license to use, reproduce
  * and create derivative works of this document.
  */
 
 interface MenuBuilder;
 
 // http://www.whatwg.org/specs/web-apps/current-work/#the-menu-element
-[HTMLConstructor,
- Exposed=Window]
+[Exposed=Window]
 interface HTMLMenuElement : HTMLElement {
+  [HTMLConstructor] constructor();
+
            [CEReactions, SetterThrows]
            attribute DOMString type;
            [CEReactions, SetterThrows]
            attribute DOMString label;
 };
 
 // http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
 partial interface HTMLMenuElement {
--- a/dom/webidl/HTMLMenuItemElement.webidl
+++ b/dom/webidl/HTMLMenuItemElement.webidl
@@ -7,19 +7,20 @@
  * http://www.whatwg.org/specs/web-apps/current-work/#the-menuitem-element
  *
  * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
  * Opera Software ASA. You are granted a license to use, reproduce
  * and create derivative works of this document.
  */
 
 // http://www.whatwg.org/specs/web-apps/current-work/#the-menuitem-element
-[HTMLConstructor,
- Exposed=Window]
+[Exposed=Window]
 interface HTMLMenuItemElement : HTMLElement {
+  [HTMLConstructor] constructor();
+
            [CEReactions, SetterThrows]
            attribute DOMString type;
            [CEReactions, SetterThrows]
            attribute DOMString label;
            [CEReactions, SetterThrows]
            attribute DOMString icon;
            [CEReactions, SetterThrows]
            attribute boolean disabled;
--- a/dom/webidl/HTMLMetaElement.webidl
+++ b/dom/webidl/HTMLMetaElement.webidl
@@ -7,19 +7,20 @@
  * http://www.whatwg.org/specs/web-apps/current-work/#the-meta-element
  * http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
  * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
  * Opera Software ASA. You are granted a license to use, reproduce
  * and create derivative works of this document.
  */
 
 // http://www.whatwg.org/specs/web-apps/current-work/#the-meta-element
-[HTMLConstructor,
- Exposed=Window]
+[Exposed=Window]
 interface HTMLMetaElement : HTMLElement {
+  [HTMLConstructor] constructor();
+
   [CEReactions, SetterThrows, Pure]
            attribute DOMString name;
   [CEReactions, SetterThrows, Pure]
            attribute DOMString httpEquiv;
   [CEReactions, SetterThrows, Pure]
            attribute DOMString content;
 };
 
--- a/dom/webidl/HTMLMeterElement.webidl
+++ b/dom/webidl/HTMLMeterElement.webidl
@@ -7,19 +7,20 @@
  * http://www.whatwg.org/specs/web-apps/current-work/#the-meter-element	
  *
  * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
  * Opera Software ASA. You are granted a license to use, reproduce
  * and create derivative works of this document.
  */
 
 // http://www.whatwg.org/specs/web-apps/current-work/#the-meter-element
-[HTMLConstructor,
- Exposed=Window]
+[Exposed=Window]
 interface HTMLMeterElement : HTMLElement {
+  [HTMLConstructor] constructor();
+
            [CEReactions, SetterThrows]
            attribute double value;
            [CEReactions, SetterThrows]
            attribute double min;
            [CEReactions, SetterThrows]
            attribute double max;
            [CEReactions, SetterThrows]
            attribute double low;
--- a/dom/webidl/HTMLModElement.webidl
+++ b/dom/webidl/HTMLModElement.webidl
@@ -6,16 +6,17 @@
  * The origin of this IDL file is
  * http://www.whatwg.org/specs/web-apps/current-work/#attributes-common-to-ins-and-del-elements
  * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
  * Opera Software ASA. You are granted a license to use, reproduce
  * and create derivative works of this document.
  */
 
 // http://www.whatwg.org/specs/web-apps/current-work/#attributes-common-to-ins-and-del-elements
-[HTMLConstructor,
- Exposed=Window]
+[Exposed=Window]
 interface HTMLModElement : HTMLElement {
+  [HTMLConstructor] constructor();
+
   [CEReactions, SetterThrows, Pure]
            attribute DOMString cite;
   [CEReactions, SetterThrows, Pure]
            attribute DOMString dateTime;
 };
--- a/dom/webidl/HTMLOListElement.webidl
+++ b/dom/webidl/HTMLOListElement.webidl
@@ -8,19 +8,20 @@
  * http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
  *
  * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
  * Opera Software ASA. You are granted a license to use, reproduce
  * and create derivative works of this document.
  */
 
 // http://www.whatwg.org/specs/web-apps/current-work/#the-ol-element
-[HTMLConstructor,
- Exposed=Window]
+[Exposed=Window]
 interface HTMLOListElement : HTMLElement {
+  [HTMLConstructor] constructor();
+
            [CEReactions, SetterThrows]
            attribute boolean reversed;
            [CEReactions, SetterThrows]
            attribute long start;
            [CEReactions, SetterThrows]
            attribute DOMString type;
 };
 
--- a/dom/webidl/HTMLObjectElement.webidl
+++ b/dom/webidl/HTMLObjectElement.webidl
@@ -8,19 +8,21 @@
  * http://www.whatwg.org/specs/web-apps/current-work/#HTMLObjectElement-partial
  *
  * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
  * Opera Software ASA. You are granted a license to use, reproduce
  * and create derivative works of this document.
  */
 
 // http://www.whatwg.org/specs/web-apps/current-work/#the-object-element
-[HTMLConstructor, NeedResolve,
+[NeedResolve,
  Exposed=Window]
 interface HTMLObjectElement : HTMLElement {
+  [HTMLConstructor] constructor();
+
   [CEReactions, Pure, SetterThrows]
            attribute DOMString data;
   [CEReactions, Pure, SetterThrows]
            attribute DOMString type;
   [CEReactions, Pure, SetterThrows]
            attribute DOMString name;
   [CEReactions, Pure, SetterThrows]
            attribute DOMString useMap;
--- a/dom/webidl/HTMLOptGroupElement.webidl
+++ b/dom/webidl/HTMLOptGroupElement.webidl
@@ -6,16 +6,17 @@
  * The origin of this IDL file is
  * http://www.whatwg.org/specs/web-apps/current-work/#the-optgroup-element
  *
  * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
  * Opera Software ASA. You are granted a license to use, reproduce
  * and create derivative works of this document.
  */
 
-[HTMLConstructor,
- Exposed=Window]
+[Exposed=Window]
 interface HTMLOptGroupElement : HTMLElement {
+  [HTMLConstructor] constructor();
+
            [CEReactions, SetterThrows]
            attribute boolean disabled;
            [CEReactions, SetterThrows]
            attribute DOMString label;
 };
--- a/dom/webidl/HTMLOptionElement.webidl
+++ b/dom/webidl/HTMLOptionElement.webidl
@@ -6,19 +6,21 @@
  * The origin of this IDL file is
  * http://www.whatwg.org/specs/web-apps/current-work/#the-option-element
  *
  * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
  * Opera Software ASA. You are granted a license to use, reproduce
  * and create derivative works of this document.
  */
 
-[HTMLConstructor, NamedConstructor=Option(optional DOMString text = "", optional DOMString value, optional boolean defaultSelected = false, optional boolean selected = false),
+[NamedConstructor=Option(optional DOMString text = "", optional DOMString value, optional boolean defaultSelected = false, optional boolean selected = false),
  Exposed=Window]
 interface HTMLOptionElement : HTMLElement {
+  [HTMLConstructor] constructor();
+
   [CEReactions, SetterThrows]
   attribute boolean disabled;
   readonly attribute HTMLFormElement? form;
   [CEReactions, SetterThrows]
   attribute DOMString label;
   [CEReactions, SetterThrows]
   attribute boolean defaultSelected;
   attribute boolean selected;
--- a/dom/webidl/HTMLOutputElement.webidl
+++ b/dom/webidl/HTMLOutputElement.webidl
@@ -7,19 +7,20 @@
  * http://www.whatwg.org/specs/web-apps/current-work/#the-output-element
  *
  * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
  * Opera Software ASA. You are granted a license to use, reproduce
  * and create derivative works of this document.
  */
 
 // http://www.whatwg.org/specs/web-apps/current-work/#the-output-element
-[HTMLConstructor,
- Exposed=Window]
+[Exposed=Window]
 interface HTMLOutputElement : HTMLElement {
+  [HTMLConstructor] constructor();
+
   [PutForwards=value, Constant]
   readonly attribute DOMTokenList htmlFor;
   readonly attribute HTMLFormElement? form;
   [CEReactions, SetterThrows, Pure]
            attribute DOMString name;
 
   [Constant]
   readonly attribute DOMString type;
--- a/dom/webidl/HTMLParagraphElement.webidl
+++ b/dom/webidl/HTMLParagraphElement.webidl
@@ -7,18 +7,19 @@
  * http://www.whatwg.org/specs/web-apps/current-work/#the-p-element
  * http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
  * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
  * Opera Software ASA. You are granted a license to use, reproduce
  * and create derivative works of this document.
  */
 
 // http://www.whatwg.org/specs/web-apps/current-work/#the-p-element
-[HTMLConstructor,
- Exposed=Window]
+[Exposed=Window]
 interface HTMLParagraphElement : HTMLElement {
+  [HTMLConstructor] constructor();
+
 };
 
 // http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
 partial interface HTMLParagraphElement {
            [CEReactions, SetterThrows]
            attribute DOMString align;
 };
--- a/dom/webidl/HTMLParamElement.webidl
+++ b/dom/webidl/HTMLParamElement.webidl
@@ -8,19 +8,20 @@
  * http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
  *
  * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
  * Opera Software ASA. You are granted a license to use, reproduce
  * and create derivative works of this document.
  */
 
 // http://www.whatwg.org/specs/web-apps/current-work/#the-param-element
-[HTMLConstructor,
- Exposed=Window]
+[Exposed=Window]
 interface HTMLParamElement : HTMLElement {
+  [HTMLConstructor] constructor();
+
            [CEReactions, SetterThrows, Pure]
            attribute DOMString name;
            [CEReactions, SetterThrows, Pure]
            attribute DOMString value;
 };
 
 // http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
 partial interface HTMLParamElement {
--- a/dom/webidl/HTMLPictureElement.webidl
+++ b/dom/webidl/HTMLPictureElement.webidl
@@ -1,10 +1,11 @@
 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-[HTMLConstructor,
- Exposed=Window]
+[Exposed=Window]
 interface HTMLPictureElement : HTMLElement {
+  [HTMLConstructor] constructor();
+
 };
--- a/dom/webidl/HTMLPreElement.webidl
+++ b/dom/webidl/HTMLPreElement.webidl
@@ -7,18 +7,19 @@
  * http://www.whatwg.org/specs/web-apps/current-work/#the-pre-element
  * http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
  * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
  * Opera Software ASA. You are granted a license to use, reproduce
  * and create derivative works of this document.
  */
 
 // http://www.whatwg.org/specs/web-apps/current-work/#the-pre-element
-[HTMLConstructor,
- Exposed=Window]
+[Exposed=Window]
 interface HTMLPreElement : HTMLElement {
+  [HTMLConstructor] constructor();
+
 };
 
 // http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
 partial interface HTMLPreElement {
            [CEReactions, SetterThrows]
            attribute long width;
 };
--- a/dom/webidl/HTMLProgressElement.webidl
+++ b/dom/webidl/HTMLProgressElement.webidl
@@ -6,18 +6,19 @@
  * The origin of this IDL file is
  * http://www.whatwg.org/specs/web-apps/current-work/#the-progress-element
  *
  * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
  * Opera Software ASA. You are granted a license to use, reproduce
  * and create derivative works of this document.
  */
 
-[HTMLConstructor,
- Exposed=Window]
+[Exposed=Window]
 interface HTMLProgressElement : HTMLElement {
+  [HTMLConstructor] constructor();
+
            [CEReactions, SetterThrows]
            attribute double value;
            [CEReactions, SetterThrows]
            attribute double max;
   readonly attribute double position;
   readonly attribute NodeList labels;
 };
--- a/dom/webidl/HTMLQuoteElement.webidl
+++ b/dom/webidl/HTMLQuoteElement.webidl
@@ -7,15 +7,16 @@
  * http://www.whatwg.org/specs/web-apps/current-work/#the-blockquote-element
  *
  * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
  * Opera Software ASA. You are granted a license to use, reproduce
  * and create derivative works of this document.
  */
 
 // http://www.whatwg.org/specs/web-apps/current-work/#the-blockquote-element
-[HTMLConstructor,
- Exposed=Window]
+[Exposed=Window]
 interface HTMLQuoteElement : HTMLElement {
+  [HTMLConstructor] constructor();
+
            [CEReactions, SetterThrows, Pure]
            attribute DOMString cite;
 };
 
--- a/dom/webidl/HTMLScriptElement.webidl
+++ b/dom/webidl/HTMLScriptElement.webidl
@@ -3,19 +3,20 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/.
  *
  * The origin of this IDL file is
  * http://www.whatwg.org/specs/web-apps/current-work/#the-script-element
  * http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
  */
 
-[HTMLConstructor,
- Exposed=Window]
+[Exposed=Window]
 interface HTMLScriptElement : HTMLElement {
+  [HTMLConstructor] constructor();
+
   [CEReactions, SetterNeedsSubjectPrincipal=NonSystem, SetterThrows]
   attribute DOMString src;
   [CEReactions, SetterThrows]
   attribute DOMString type;
   [CEReactions, SetterThrows, Pref="dom.moduleScripts.enabled"]
   attribute boolean noModule;
   [CEReactions, SetterThrows]
   attribute DOMString charset;
--- a/dom/webidl/HTMLSelectElement.webidl
+++ b/dom/webidl/HTMLSelectElement.webidl
@@ -2,19 +2,20 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  *
  * The origin of this IDL file is
  * http://www.whatwg.org/html/#the-select-element
  */
 
-[HTMLConstructor,
- Exposed=Window]
+[Exposed=Window]
 interface HTMLSelectElement : HTMLElement {
+  [HTMLConstructor] constructor();
+
   [CEReactions, SetterThrows, Pure]
   attribute boolean autofocus;
   [CEReactions, SetterThrows, Pure]
   attribute DOMString autocomplete;
   [CEReactions, SetterThrows, Pure]
   attribute boolean disabled;
   [Pure]
   readonly attribute HTMLFormElement? form;
--- a/dom/webidl/HTMLSlotElement.webidl
+++ b/dom/webidl/HTMLSlotElement.webidl
@@ -6,18 +6,20 @@
  * The origin of this IDL file is
  * https://html.spec.whatwg.org/multipage/forms.html#the-dialog-element
  *
  * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
  * Opera Software ASA. You are granted a license to use, reproduce
  * and create derivative works of this document.
  */
 
-[Exposed=Window, HTMLConstructor]
+[Exposed=Window]
 interface HTMLSlotElement : HTMLElement {
+  [HTMLConstructor] constructor();
+
   [CEReactions, SetterThrows] attribute DOMString name;
   sequence<Node> assignedNodes(optional AssignedNodesOptions options = {});
   sequence<Element> assignedElements(optional AssignedNodesOptions options = {});
 };
 
 dictionary AssignedNodesOptions {
   boolean flatten = false;
 };
--- a/dom/webidl/HTMLSourceElement.webidl
+++ b/dom/webidl/HTMLSourceElement.webidl
@@ -6,19 +6,20 @@
  * The origin of this IDL file is
  * http://www.whatwg.org/specs/web-apps/current-work/#the-source-element
  *
  * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
  * Opera Software ASA. You are granted a license to use, reproduce
  * and create derivative works of this document.
  */
 
-[HTMLConstructor,
- Exposed=Window]
+[Exposed=Window]
 interface HTMLSourceElement : HTMLElement {
+  [HTMLConstructor] constructor();
+
            [CEReactions, SetterNeedsSubjectPrincipal=NonSystem, SetterThrows]
            attribute DOMString src;
            [CEReactions, SetterThrows]
            attribute DOMString type;
 };
 
 partial interface HTMLSourceElement {
            [CEReactions, SetterNeedsSubjectPrincipal=NonSystem, SetterThrows]
--- a/dom/webidl/HTMLSpanElement.webidl
+++ b/dom/webidl/HTMLSpanElement.webidl
@@ -7,11 +7,12 @@
  * http://www.whatwg.org/specs/web-apps/current-work/#the-span-element
  *
  * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
  * Opera Software ASA. You are granted a license to use, reproduce
  * and create derivative works of this document.
  */
 
 // http://www.whatwg.org/specs/web-apps/current-work/#the-span-element
-[HTMLConstructor,
- Exposed=Window]
-interface HTMLSpanElement : HTMLElement {};
+[Exposed=Window]
+interface HTMLSpanElement : HTMLElement {
+  [HTMLConstructor] constructor();
+};
--- a/dom/webidl/HTMLStyleElement.webidl
+++ b/dom/webidl/HTMLStyleElement.webidl
@@ -3,19 +3,20 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/.
  *
  * The origin of this IDL file is
  * http://www.whatwg.org/specs/web-apps/current-work/#the-style-element
  * http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
  */
 
-[HTMLConstructor,
- Exposed=Window]
+[Exposed=Window]
 interface HTMLStyleElement : HTMLElement {
+  [HTMLConstructor] constructor();
+
            [Pure]
            attribute boolean disabled;
            [CEReactions, SetterThrows, Pure]
            attribute DOMString media;
            [CEReactions, SetterThrows, Pure]
            attribute DOMString type;
 };
 HTMLStyleElement includes LinkStyle;
--- a/dom/webidl/HTMLTableCaptionElement.webidl
+++ b/dom/webidl/HTMLTableCaptionElement.webidl
@@ -6,16 +6,17 @@
  * The origin of this IDL file is
  * http://www.whatwg.org/specs/web-apps/current-work/
  *
  * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
  * Opera Software ASA. You are granted a license to use, reproduce
  * and create derivative works of this document.
  */
 
-[HTMLConstructor,
- Exposed=Window]
-interface HTMLTableCaptionElement : HTMLElement {};
+[Exposed=Window]
+interface HTMLTableCaptionElement : HTMLElement {
+  [HTMLConstructor] constructor();
+};
 
 partial interface HTMLTableCaptionElement {
            [CEReactions, SetterThrows]
            attribute DOMString align;
 };
--- a/dom/webidl/HTMLTableCellElement.webidl
+++ b/dom/webidl/HTMLTableCellElement.webidl
@@ -6,19 +6,20 @@
  * The origin of this IDL file is
  * http://www.whatwg.org/specs/web-apps/current-work/
  *
  * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
  * Opera Software ASA. You are granted a license to use, reproduce
  * and create derivative works of this document.
  */
 
-[HTMLConstructor,
- Exposed=Window]
+[Exposed=Window]
 interface HTMLTableCellElement : HTMLElement {
+  [HTMLConstructor] constructor();
+
            [CEReactions, SetterThrows]
            attribute unsigned long colSpan;
            [CEReactions, SetterThrows]
            attribute unsigned long rowSpan;
   //[PutForwards=value] readonly attribute DOMTokenList headers;
            [CEReactions, SetterThrows]
            attribute DOMString headers;
   readonly attribute long cellIndex;
--- a/dom/webidl/HTMLTableColElement.webidl
+++ b/dom/webidl/HTMLTableColElement.webidl
@@ -6,19 +6,20 @@
  * The origin of this IDL file is
  * http://www.whatwg.org/specs/web-apps/current-work/
  *
  * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
  * Opera Software ASA. You are granted a license to use, reproduce
  * and create derivative works of this document.
  */
 
-[HTMLConstructor,
- Exposed=Window]
+[Exposed=Window]
 interface HTMLTableColElement : HTMLElement {
+  [HTMLConstructor] constructor();
+
            [CEReactions, SetterThrows]
            attribute unsigned long span;
 };
 
 partial interface HTMLTableColElement {
            [CEReactions, SetterThrows]
            attribute DOMString align;
            [CEReactions, SetterThrows]
--- a/dom/webidl/HTMLTableElement.webidl
+++ b/dom/webidl/HTMLTableElement.webidl
@@ -6,19 +6,20 @@
  * The origin of this IDL file is
  * http://www.whatwg.org/specs/web-apps/current-work/
  *
  * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
  * Opera Software ASA. You are granted a license to use, reproduce
  * and create derivative works of this document.
  */
 
-[HTMLConstructor,
- Exposed=Window]
+[Exposed=Window]
 interface HTMLTableElement : HTMLElement {
+  [HTMLConstructor] constructor();
+
            [CEReactions, SetterThrows]
            attribute HTMLTableCaptionElement? caption;
   HTMLElement createCaption();
   [CEReactions]
   void deleteCaption();
            [CEReactions, SetterThrows]
            attribute HTMLTableSectionElement? tHead;
   HTMLElement createTHead();
--- a/dom/webidl/HTMLTableRowElement.webidl
+++ b/dom/webidl/HTMLTableRowElement.webidl
@@ -6,19 +6,20 @@
  * The origin of this IDL file is
  * http://www.whatwg.org/specs/web-apps/current-work/
  *
  * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
  * Opera Software ASA. You are granted a license to use, reproduce
  * and create derivative works of this document.
  */
 
-[HTMLConstructor,
- Exposed=Window]
+[Exposed=Window]
 interface HTMLTableRowElement : HTMLElement {
+  [HTMLConstructor] constructor();
+
   readonly attribute long rowIndex;
   readonly attribute long sectionRowIndex;
   readonly attribute HTMLCollection cells;
   [Throws]
   HTMLElement insertCell(optional long index = -1);
   [CEReactions, Throws]
   void deleteCell(long index);
 };
--- a/dom/webidl/HTMLTableSectionElement.webidl
+++ b/dom/webidl/HTMLTableSectionElement.webidl
@@ -6,19 +6,20 @@
  * The origin of this IDL file is
  * http://www.whatwg.org/specs/web-apps/current-work/
  *
  * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
  * Opera Software ASA. You are granted a license to use, reproduce
  * and create derivative works of this document.
  */
 
-[HTMLConstructor,
- Exposed=Window]
+[Exposed=Window]
 interface HTMLTableSectionElement : HTMLElement {
+  [HTMLConstructor] constructor();
+
   readonly attribute HTMLCollection rows;
   [Throws]
   HTMLElement insertRow(optional long index = -1);
   [CEReactions, Throws]
   void deleteRow(long index);
 };
 
 partial interface HTMLTableSectionElement {
--- a/dom/webidl/HTMLTemplateElement.webidl
+++ b/dom/webidl/HTMLTemplateElement.webidl
@@ -4,14 +4,15 @@
  *
  * The origin of this IDL file is
  * https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/templates/index.html
  *
  * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
  * liability, trademark and document use rules apply.
  */
 
-[HTMLConstructor,
- Exposed=Window]
+[Exposed=Window]
 interface HTMLTemplateElement : HTMLElement {
+  [HTMLConstructor] constructor();
+
     readonly attribute DocumentFragment content;
 };
 
--- a/dom/webidl/HTMLTextAreaElement.webidl
+++ b/dom/webidl/HTMLTextAreaElement.webidl
@@ -9,19 +9,20 @@
  * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
  * Opera Software ASA. You are granted a license to use, reproduce
  * and create derivative works of this document.
  */
 
 interface nsIEditor;
 interface XULControllers;
 
-[HTMLConstructor,
- Exposed=Window]
+[Exposed=Window]
 interface HTMLTextAreaElement : HTMLElement {
+  [HTMLConstructor] constructor();
+
   [CEReactions, SetterThrows, Pure]
            attribute DOMString autocomplete;
   [CEReactions, SetterThrows, Pure]
            attribute boolean autofocus;
   [CEReactions, SetterThrows, Pure]
            attribute unsigned long cols;
            // attribute DOMString dirName;
   [CEReactions, SetterThrows, Pure]
--- a/dom/webidl/HTMLTimeElement.webidl
+++ b/dom/webidl/HTMLTimeElement.webidl
@@ -2,14 +2,15 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/.
  *
  * The origin of this IDL file is
  * http://www.whatwg.org/specs/web-apps/current-work/multipage/text-level-semantics.html#the-time-element
  */
 
-[HTMLConstructor,
- Exposed=Window]
+[Exposed=Window]
 interface HTMLTimeElement : HTMLElement {
+  [HTMLConstructor] constructor();
+
            [CEReactions, SetterThrows]
            attribute DOMString dateTime;
 };
--- a/dom/webidl/HTMLTitleElement.webidl
+++ b/dom/webidl/HTMLTitleElement.webidl
@@ -2,14 +2,15 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/.
  *
  * The origin of this IDL file is
  * http://www.whatwg.org/specs/web-apps/current-work/#the-title-element
  */
 
-[HTMLConstructor,
- Exposed=Window]
+[Exposed=Window]
 interface HTMLTitleElement : HTMLElement {
+  [HTMLConstructor] constructor();
+
            [CEReactions, Throws]
            attribute DOMString text;
 };
--- a/dom/webidl/HTMLTrackElement.webidl
+++ b/dom/webidl/HTMLTrackElement.webidl
@@ -2,19 +2,20 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/.
  *
  * The origin of this IDL file is
  * http://www.whatwg.org/specs/web-apps/current-work/#the-track-element
  */
 
-[HTMLConstructor,
- Exposed=Window]
+[Exposed=Window]
 interface HTMLTrackElement : HTMLElement {
+  [HTMLConstructor] constructor();
+
   [CEReactions, SetterThrows, Pure]
   attribute DOMString kind;
   [CEReactions, SetterThrows, Pure]
   attribute DOMString src;
   [CEReactions, SetterThrows, Pure]
   attribute DOMString srclang;
   [CEReactions, SetterThrows, Pure]
   attribute DOMString label;
--- a/dom/webidl/HTMLUListElement.webidl
+++ b/dom/webidl/HTMLUListElement.webidl
@@ -8,19 +8,20 @@
  * http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
  *
  * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
  * Opera Software ASA. You are granted a license to use, reproduce
  * and create derivative works of this document.
  */
 
 // http://www.whatwg.org/specs/web-apps/current-work/#the-ul-element
-[HTMLConstructor,
- Exposed=Window]
+[Exposed=Window]
 interface HTMLUListElement : HTMLElement {
+  [HTMLConstructor] constructor();
+
 };
 
 // http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
 partial interface HTMLUListElement {
            [CEReactions, SetterThrows]
            attribute boolean compact;
            [CEReactions, SetterThrows]
            attribute DOMString type;
--- a/dom/webidl/HTMLVideoElement.webidl
+++ b/dom/webidl/HTMLVideoElement.webidl
@@ -6,19 +6,20 @@
  * The origin of this IDL file is
  * http://www.whatwg.org/specs/web-apps/current-work/#the-video-element
  *
  * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
  * Opera Software ASA. You are granted a license to use, reproduce
  * and create derivative works of this document.
  */
 
-[HTMLConstructor,
- Exposed=Window]
+[Exposed=Window]
 interface HTMLVideoElement : HTMLMediaElement {
+  [HTMLConstructor] constructor();
+
   [CEReactions, SetterThrows]
            attribute unsigned long width;
   [CEReactions, SetterThrows]
            attribute unsigned long height;
   readonly attribute unsigned long videoWidth;
   readonly attribute unsigned long videoHeight;
   [CEReactions, SetterThrows]
            attribute DOMString poster;
--- a/dom/webidl/XULElement.webidl
+++ b/dom/webidl/XULElement.webidl
@@ -1,19 +1,21 @@
 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
 interface XULControllers;
 
-[HTMLConstructor, Func="IsChromeOrXBL",
+[Func="IsChromeOrXBL",
  Exposed=Window]
 interface XULElement : Element {
+  [HTMLConstructor] constructor();
+
   // Layout properties
   [SetterThrows]
   attribute DOMString align;
   [SetterThrows]
   attribute DOMString dir;
   [SetterThrows]
   attribute DOMString flex;
   [SetterThrows]
--- a/dom/webidl/XULPopupElement.webidl
+++ b/dom/webidl/XULPopupElement.webidl
@@ -15,20 +15,22 @@ dictionary OpenPopupOptions {
   // true if popup node attributes override position
   boolean attributesOverride = false;
   // triggerEvent the event that triggered this popup (mouse click for example)
   Event? triggerEvent = null;
 };
 
 typedef (DOMString or OpenPopupOptions) StringOrOpenPopupOptions;
 
-[HTMLConstructor, Func="IsChromeOrXBL",
+[Func="IsChromeOrXBL",
  Exposed=Window]
 interface XULPopupElement : XULElement
 {
+  [HTMLConstructor] constructor();
+
   /**
    * Allow the popup to automatically position itself.
    */
   attribute boolean autoPosition;
 
   /**
    * Open the popup relative to a specified node at a specific location.
    *