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
This commit is contained in:
Boris Zbarsky
2019-10-17 15:38:39 +00:00
parent ec33842b07
commit 39fb38a418
81 changed files with 296 additions and 251 deletions

View File

@@ -1084,18 +1084,11 @@ class IDLInterfaceOrNamespace(IDLInterfaceOrInterfaceMixinOrNamespace):
"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:
@@ -1653,60 +1646,45 @@ class IDLInterface(IDLInterfaceOrNamespace):
[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)
# 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])
# 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",
@@ -4879,7 +4857,7 @@ class IDLMethod(IDLInterfaceMember, IDLScope):
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)
@@ -4905,10 +4883,7 @@ class IDLMethod(IDLInterfaceMember, IDLScope):
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"
@@ -5403,14 +5378,13 @@ class IDLMethod(IDLInterfaceMember, IDLScope):
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 = []
@@ -5427,6 +5401,18 @@ class IDLConstructor(IDLMethod):
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])
@@ -5437,7 +5423,7 @@ class IDLConstructor(IDLMethod):
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)

View File

@@ -105,8 +105,8 @@ def WebIDLTest(parser, harness):
parser = parser.reset()
parser.parse("""
[HTMLConstructor]
interface TestHTMLConstructor {
[HTMLConstructor] constructor();
};
""")
results = parser.finish()
@@ -138,8 +138,8 @@ def WebIDLTest(parser, harness):
threw = False
try:
parser.parse("""
[HTMLConstructor(DOMString a)]
interface TestHTMLConstructorWithArgs {
[HTMLConstructor] constructor(DOMString a);
};
""")
results = parser.finish()
@@ -153,8 +153,8 @@ def WebIDLTest(parser, harness):
threw = False
try:
parser.parse("""
[HTMLConstructor]
callback interface TestHTMLConstructorOnCallbackInterface {
[HTMLConstructor] constructor();
};
""")
results = parser.finish()
@@ -168,9 +168,9 @@ def WebIDLTest(parser, harness):
threw = False
try:
parser.parse("""
[HTMLConstructor]
interface TestHTMLConstructorAndConstructor {
constructor();
[HTMLConstructor] constructor();
};
""")
results = parser.finish()
@@ -183,10 +183,10 @@ def WebIDLTest(parser, harness):
threw = False
try:
parser.parse("""
[HTMLConstructor]
interface TestHTMLConstructorAndConstructor {
[Throws]
constructor();
[HTMLConstructor] constructor();
};
""")
results = parser.finish()
@@ -200,9 +200,9 @@ def WebIDLTest(parser, harness):
threw = False
try:
parser.parse("""
[HTMLConstructor]
interface TestHTMLConstructorAndConstructor {
constructor(DOMString a);
[HTMLConstructor] constructor();
};
""")
results = parser.finish()
@@ -216,10 +216,10 @@ def WebIDLTest(parser, harness):
threw = False
try:
parser.parse("""
[HTMLConstructor]
interface TestHTMLConstructorAndConstructor {
[Throws]
constructor(DOMString a);
[HTMLConstructor] constructor();
};
""")
results = parser.finish()
@@ -235,10 +235,10 @@ def WebIDLTest(parser, harness):
threw = False
try:
parser.parse("""
[HTMLConstructor]
interface TestHTMLConstructorAndConstructor {
[ChromeOnly]
constructor();
[HTMLConstructor] constructor();
};
""")
results = parser.finish()
@@ -252,10 +252,10 @@ def WebIDLTest(parser, harness):
threw = False
try:
parser.parse("""
[HTMLConstructor]
interface TestHTMLConstructorAndConstructor {
[Throws, ChromeOnly]
constructor();
[HTMLConstructor] constructor();
};
""")
results = parser.finish()
@@ -270,10 +270,10 @@ def WebIDLTest(parser, harness):
threw = False
try:
parser.parse("""
[HTMLConstructor]
interface TestHTMLConstructorAndConstructor {
[ChromeOnly]
constructor(DOMString a);
[HTMLConstructor] constructor();
};
""")
results = parser.finish()
@@ -288,10 +288,10 @@ def WebIDLTest(parser, harness):
threw = False
try:
parser.parse("""
[HTMLConstructor]
interface TestHTMLConstructorAndConstructor {
[Throws, ChromeOnly]
constructor(DOMString a);
[HTMLConstructor] constructor();
};
""")
results = parser.finish()

View File

@@ -50,23 +50,9 @@ def WebIDLTest(parser, harness):
threw = False
try:
parser.parse("""
[Global, HTMLConstructor, Exposed=TestHTMLConstructorGlobal]
interface TestHTMLConstructorGlobal {
};
""")
results = parser.finish()
except:
threw = True
harness.ok(threw, "Should have thrown.")
parser = parser.reset()
threw = False
try:
parser.parse("""
[HTMLConstructor, Global, Exposed=TestHTMLConstructorGlobal]
[Global, Exposed=TestHTMLConstructorGlobal]
interface TestHTMLConstructorGlobal {
[HTMLConstructor] constructor();
};
""")

View File

@@ -28,24 +28,9 @@ def WebIDLTest(parser, harness):
threw = False
try:
parser.parse("""
[NoInterfaceObject, HTMLConstructor]
interface TestHTMLConstructorNoInterfaceObject {
};
""")
results = parser.finish()
except:
threw = True
harness.ok(threw, "Should have thrown.")
parser = parser.reset()
threw = False
try:
parser.parse("""
[HTMLConstructor, NoInterfaceObject]
[NoInterfaceObject]
interface TestHTMLConstructorNoInterfaceObject {
[HTMLConstructor] constructor();
};
""")

View File

@@ -1327,9 +1327,9 @@ interface TestWorkerExposedInterface {
[NeedsSubjectPrincipal=NonSystem] attribute boolean needsNonSystemSubjectPrincipalAttr;
};
[HTMLConstructor,
Exposed=Window]
[Exposed=Window]
interface TestHTMLConstructorInterface {
[HTMLConstructor] constructor();
};
[Exposed=Window]

View File

@@ -6,10 +6,12 @@
interface nsIDocShell;
interface nsIWebNavigation;
[HTMLConstructor, Func="IsChromeOrXBL",
[Func="IsChromeOrXBL",
Exposed=Window]
interface XULFrameElement : XULElement
{
[HTMLConstructor] constructor();
readonly attribute nsIDocShell? docShell;
readonly attribute nsIWebNavigation? webNavigation;

View File

@@ -5,9 +5,10 @@
* 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;

View File

@@ -5,9 +5,11 @@
* 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;

View File

@@ -13,10 +13,12 @@ dictionary TreeCellInfo {
DOMString childElt = "";
};
[HTMLConstructor, Func="IsChromeOrXBL",
[Func="IsChromeOrXBL",
Exposed=Window]
interface XULTreeElement : XULElement
{
[HTMLConstructor] constructor();
/**
* Obtain the columns.
*/

View File

@@ -12,9 +12,10 @@
*/
// 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]

View File

@@ -13,9 +13,10 @@
*/
// 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]

View File

@@ -11,7 +11,9 @@
* 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();
};

View File

@@ -13,9 +13,10 @@
*/
// 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 {

View File

@@ -12,9 +12,10 @@
*/
// 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]

View File

@@ -11,9 +11,10 @@
* and create derivative works of this document.
*/
[HTMLConstructor,
Exposed=Window]
[Exposed=Window]
interface HTMLBodyElement : HTMLElement {
[HTMLConstructor] constructor();
};
partial interface HTMLBodyElement {

View File

@@ -11,9 +11,10 @@
*/
// 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]

View File

@@ -13,9 +13,10 @@
interface nsISupports;
interface Variant;
[HTMLConstructor,
Exposed=Window]
[Exposed=Window]
interface HTMLCanvasElement : HTMLElement {
[HTMLConstructor] constructor();
[CEReactions, Pure, SetterThrows]
attribute unsigned long width;
[CEReactions, Pure, SetterThrows]

View File

@@ -13,9 +13,10 @@
*/
// 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

View File

@@ -7,9 +7,10 @@
* 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;
};

View File

@@ -11,8 +11,9 @@
* and create derivative works of this document.
*/
[HTMLConstructor,
Exposed=Window]
[Exposed=Window]
interface HTMLDataListElement : HTMLElement {
[HTMLConstructor] constructor();
readonly attribute HTMLCollection options;
};

View File

@@ -11,9 +11,10 @@
* and create derivative works of this document.
*/
[HTMLConstructor,
Exposed=Window]
[Exposed=Window]
interface HTMLDetailsElement : HTMLElement {
[HTMLConstructor] constructor();
[CEReactions, SetterThrows]
attribute boolean open;
};

View File

@@ -11,9 +11,11 @@
* 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;

View File

@@ -12,9 +12,10 @@
*/
// 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;
};

View File

@@ -11,9 +11,10 @@
* 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]

View File

@@ -12,9 +12,10 @@
* and create derivative works of this document.
*/
[HTMLConstructor,
Exposed=Window]
[Exposed=Window]
interface HTMLElement : Element {
[HTMLConstructor] constructor();
// metadata attributes
[CEReactions]
attribute DOMString title;

View File

@@ -13,9 +13,11 @@
*/
// 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]

View File

@@ -11,9 +11,10 @@
* 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;

View File

@@ -11,9 +11,10 @@
* 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;

View File

@@ -11,9 +11,11 @@
* 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]

View File

@@ -11,9 +11,10 @@
*/
// 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]

View File

@@ -11,9 +11,10 @@
* and create derivative works of this document.
*/
[HTMLConstructor,
Exposed=Window]
[Exposed=Window]
interface HTMLFrameSetElement : HTMLElement {
[HTMLConstructor] constructor();
[CEReactions, SetterThrows]
attribute DOMString cols;
[CEReactions, SetterThrows]

View File

@@ -12,9 +12,10 @@
*/
// 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

View File

@@ -12,7 +12,8 @@
*/
// 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();
};

View File

@@ -12,9 +12,10 @@
*/
// 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

View File

@@ -13,9 +13,10 @@
*/
// 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 {

View File

@@ -13,9 +13,10 @@
* 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]

View File

@@ -16,10 +16,11 @@ 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]

View File

@@ -22,9 +22,10 @@ enum SelectionMode {
interface XULControllers;
[HTMLConstructor,
Exposed=Window]
[Exposed=Window]
interface HTMLInputElement : HTMLElement {
[HTMLConstructor] constructor();
[CEReactions, Pure, SetterThrows]
attribute DOMString accept;
[CEReactions, Pure, SetterThrows]

View File

@@ -13,9 +13,10 @@
*/
// 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;
};

View File

@@ -11,9 +11,10 @@
* 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;

View File

@@ -13,9 +13,10 @@
*/
// 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;
};

View File

@@ -12,9 +12,10 @@
*/
// 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]

View File

@@ -11,9 +11,10 @@
*/
// 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]

View File

@@ -12,9 +12,10 @@
// 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;

View File

@@ -15,9 +15,10 @@
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]

View File

@@ -12,9 +12,10 @@
*/
// 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]

View File

@@ -12,9 +12,10 @@
*/
// 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]

View File

@@ -12,9 +12,10 @@
*/
// 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]

View File

@@ -11,9 +11,10 @@
*/
// 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]

View File

@@ -13,9 +13,10 @@
*/
// 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]

View File

@@ -13,9 +13,11 @@
*/
// 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]

View File

@@ -11,9 +11,10 @@
* and create derivative works of this document.
*/
[HTMLConstructor,
Exposed=Window]
[Exposed=Window]
interface HTMLOptGroupElement : HTMLElement {
[HTMLConstructor] constructor();
[CEReactions, SetterThrows]
attribute boolean disabled;
[CEReactions, SetterThrows]

View File

@@ -11,9 +11,11 @@
* 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;

View File

@@ -12,9 +12,10 @@
*/
// 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;

View File

@@ -12,9 +12,10 @@
*/
// 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

View File

@@ -13,9 +13,10 @@
*/
// 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]

View File

@@ -4,7 +4,8 @@
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
[HTMLConstructor,
Exposed=Window]
[Exposed=Window]
interface HTMLPictureElement : HTMLElement {
[HTMLConstructor] constructor();
};

View File

@@ -12,9 +12,10 @@
*/
// 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

View File

@@ -11,9 +11,10 @@
* and create derivative works of this document.
*/
[HTMLConstructor,
Exposed=Window]
[Exposed=Window]
interface HTMLProgressElement : HTMLElement {
[HTMLConstructor] constructor();
[CEReactions, SetterThrows]
attribute double value;
[CEReactions, SetterThrows]

View File

@@ -12,9 +12,10 @@
*/
// 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;
};

View File

@@ -8,9 +8,10 @@
* 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]

View File

@@ -7,9 +7,10 @@
* 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]

View File

@@ -11,8 +11,10 @@
* 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 = {});

View File

@@ -11,9 +11,10 @@
* 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]

View File

@@ -12,6 +12,7 @@
*/
// 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();
};

View File

@@ -8,9 +8,10 @@
* 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]

View File

@@ -11,9 +11,10 @@
* 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]

View File

@@ -11,9 +11,10 @@
* 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]

View File

@@ -11,9 +11,10 @@
* and create derivative works of this document.
*/
[HTMLConstructor,
Exposed=Window]
[Exposed=Window]
interface HTMLTableColElement : HTMLElement {
[HTMLConstructor] constructor();
[CEReactions, SetterThrows]
attribute unsigned long span;
};

View File

@@ -11,9 +11,10 @@
* and create derivative works of this document.
*/
[HTMLConstructor,
Exposed=Window]
[Exposed=Window]
interface HTMLTableElement : HTMLElement {
[HTMLConstructor] constructor();
[CEReactions, SetterThrows]
attribute HTMLTableCaptionElement? caption;
HTMLElement createCaption();

View File

@@ -11,9 +11,10 @@
* 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;

View File

@@ -11,9 +11,10 @@
* 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);

View File

@@ -9,9 +9,10 @@
* liability, trademark and document use rules apply.
*/
[HTMLConstructor,
Exposed=Window]
[Exposed=Window]
interface HTMLTemplateElement : HTMLElement {
[HTMLConstructor] constructor();
readonly attribute DocumentFragment content;
};

View File

@@ -14,9 +14,10 @@
interface nsIEditor;
interface XULControllers;
[HTMLConstructor,
Exposed=Window]
[Exposed=Window]
interface HTMLTextAreaElement : HTMLElement {
[HTMLConstructor] constructor();
[CEReactions, SetterThrows, Pure]
attribute DOMString autocomplete;
[CEReactions, SetterThrows, Pure]

View File

@@ -7,9 +7,10 @@
* 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;
};

View File

@@ -7,9 +7,10 @@
* 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;
};

View File

@@ -7,9 +7,10 @@
* 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]

View File

@@ -13,9 +13,10 @@
*/
// 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

View File

@@ -11,9 +11,10 @@
* 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]

View File

@@ -6,9 +6,11 @@
interface XULControllers;
[HTMLConstructor, Func="IsChromeOrXBL",
[Func="IsChromeOrXBL",
Exposed=Window]
interface XULElement : Element {
[HTMLConstructor] constructor();
// Layout properties
[SetterThrows]
attribute DOMString align;

View File

@@ -20,10 +20,12 @@ dictionary OpenPopupOptions {
typedef (DOMString or OpenPopupOptions) StringOrOpenPopupOptions;
[HTMLConstructor, Func="IsChromeOrXBL",
[Func="IsChromeOrXBL",
Exposed=Window]
interface XULPopupElement : XULElement
{
[HTMLConstructor] constructor();
/**
* Allow the popup to automatically position itself.
*/