Convert [HTMLConstructor] as constructor extension

This commit is contained in:
Kagami Sascha Rosylight 2019-10-19 20:26:20 +09:00
parent 175c0d56ca
commit e271edad92
71 changed files with 322 additions and 216 deletions

View file

@ -392,15 +392,19 @@ class Descriptor(DescriptorProvider):
return (self.interface.getUserData("hasConcreteDescendant", False) or
self.interface.getUserData("hasProxyDescendant", False))
def hasHTMLConstructor(self):
ctor = self.interface.ctor()
return ctor and ctor.isHTMLConstructor()
def shouldHaveGetConstructorObjectMethod(self):
assert self.interface.hasInterfaceObject()
if self.interface.getExtendedAttribute("Inline"):
return False
return (self.interface.isCallback() or self.interface.isNamespace() or
self.hasDescendants() or self.interface.getExtendedAttribute("HTMLConstructor"))
self.hasDescendants() or self.hasHTMLConstructor())
def shouldCacheConstructor(self):
return self.hasDescendants() or self.interface.getExtendedAttribute("HTMLConstructor")
return self.hasDescendants() or self.hasHTMLConstructor()
def isExposedConditionally(self):
return self.interface.isExposedConditionally()

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",
@ -1777,6 +1755,11 @@ class IDLInterface(IDLInterfaceOrNamespace):
if not attr.hasValue():
raise WebIDLError("[%s] must have a value" % identifier,
[attr.location])
elif identifier == "InstrumentedProps":
# Known extended attributes that take a list
if not attr.hasArgs():
raise WebIDLError("[%s] must have arguments" % identifier,
[attr.location])
else:
raise WebIDLError("Unknown extended attribute %s on interface" % identifier,
[attr.location])
@ -4884,7 +4867,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)
@ -4910,10 +4893,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"
@ -5408,14 +5388,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 = []
@ -5432,6 +5411,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])
@ -5442,7 +5433,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)
@ -5660,6 +5651,8 @@ class Tokenizer(object):
"namespace": "NAMESPACE",
"ReadableStream": "READABLESTREAM",
"constructor": "CONSTRUCTOR",
"symbol": "SYMBOL",
"async": "ASYNC",
}
tokens.extend(keywords.values())
@ -6746,37 +6739,54 @@ class Parser(Tokenizer):
def p_ArgumentName(self, p):
"""
ArgumentName : IDENTIFIER
| ATTRIBUTE
| CALLBACK
| CONST
| CONSTRUCTOR
| DELETER
| DICTIONARY
| ENUM
| EXCEPTION
| GETTER
| INHERIT
| INTERFACE
| ITERABLE
| LEGACYCALLER
| MAPLIKE
| PARTIAL
| REQUIRED
| SERIALIZER
| SETLIKE
| SETTER
| STATIC
| STRINGIFIER
| TYPEDEF
| UNRESTRICTED
| NAMESPACE
| ArgumentNameKeyword
"""
p[0] = p[1]
def p_ArgumentNameKeyword(self, p):
"""
ArgumentNameKeyword : ASYNC
| ATTRIBUTE
| CALLBACK
| CONST
| CONSTRUCTOR
| DELETER
| DICTIONARY
| ENUM
| EXCEPTION
| GETTER
| INCLUDES
| INHERIT
| INTERFACE
| ITERABLE
| LEGACYCALLER
| MAPLIKE
| MIXIN
| NAMESPACE
| PARTIAL
| READONLY
| REQUIRED
| SERIALIZER
| SETLIKE
| SETTER
| STATIC
| STRINGIFIER
| TYPEDEF
| UNRESTRICTED
"""
p[0] = p[1]
def p_AttributeName(self, p):
"""
AttributeName : IDENTIFIER
| REQUIRED
| AttributeNameKeyword
"""
p[0] = p[1]
def p_AttributeNameKeyword(self, p):
"""
AttributeNameKeyword : ASYNC
| REQUIRED
"""
p[0] = p[1]
@ -6868,36 +6878,27 @@ class Parser(Tokenizer):
| BYTESTRING
| USVSTRING
| JSSTRING
| PROMISE
| ANY
| ATTRIBUTE
| BOOLEAN
| BYTE
| LEGACYCALLER
| CONST
| CONSTRUCTOR
| DELETER
| DOUBLE
| EXCEPTION
| FALSE
| FLOAT
| GETTER
| INHERIT
| INTERFACE
| LONG
| NULL
| OBJECT
| OCTET
| OR
| OPTIONAL
| SEQUENCE
| RECORD
| SETTER
| SEQUENCE
| SHORT
| STATIC
| STRINGIFIER
| SYMBOL
| TRUE
| TYPEDEF
| UNSIGNED
| VOID
| ArgumentNameKeyword
"""
pass

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

@ -11,8 +11,10 @@
*/
// https://html.spec.whatwg.org/multipage/#htmlanchorelement
[Exposed=Window, HTMLConstructor]
[Exposed=Window]
interface HTMLAnchorElement : HTMLElement {
[HTMLConstructor] constructor();
[CEReactions]
attribute DOMString target;
// [CEReactions]

View file

@ -3,8 +3,10 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://html.spec.whatwg.org/multipage/#htmlareaelement
[Exposed=Window, HTMLConstructor]
[Exposed=Window]
interface HTMLAreaElement : HTMLElement {
[HTMLConstructor] constructor();
// [CEReactions]
// attribute DOMString alt;
// [CEReactions]

View file

@ -3,5 +3,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://html.spec.whatwg.org/multipage/#htmlaudioelement
[Exposed=Window, HTMLConstructor, NamedConstructor=Audio(optional DOMString src)]
interface HTMLAudioElement : HTMLMediaElement {};
[Exposed=Window, NamedConstructor=Audio(optional DOMString src)]
interface HTMLAudioElement : HTMLMediaElement {
[HTMLConstructor] constructor();
};

View file

@ -3,8 +3,10 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://html.spec.whatwg.org/multipage/#htmlbrelement
[Exposed=Window, HTMLConstructor]
[Exposed=Window]
interface HTMLBRElement : HTMLElement {
[HTMLConstructor] constructor();
// also has obsolete members
};

View file

@ -3,8 +3,10 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://html.spec.whatwg.org/multipage/#htmlbaseelement
[Exposed=Window, HTMLConstructor]
[Exposed=Window]
interface HTMLBaseElement : HTMLElement {
[HTMLConstructor] constructor();
[CEReactions]
attribute DOMString href;
// [CEReactions]

View file

@ -3,8 +3,10 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://html.spec.whatwg.org/multipage/#the-body-element
[Exposed=Window, HTMLConstructor]
[Exposed=Window]
interface HTMLBodyElement : HTMLElement {
[HTMLConstructor] constructor();
// also has obsolete members
};
HTMLBodyElement includes WindowEventHandlers;

View file

@ -3,8 +3,10 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://html.spec.whatwg.org/multipage/#htmlbuttonelement
[Exposed=Window, HTMLConstructor]
[Exposed=Window]
interface HTMLButtonElement : HTMLElement {
[HTMLConstructor] constructor();
// [CEReactions]
// attribute boolean autofocus;
[CEReactions]

View file

@ -5,9 +5,10 @@
// https://html.spec.whatwg.org/multipage/#htmlcanvaselement
typedef (CanvasRenderingContext2D or WebGLRenderingContext or WebGL2RenderingContext) RenderingContext;
[Exposed=Window,
HTMLConstructor]
[Exposed=Window]
interface HTMLCanvasElement : HTMLElement {
[HTMLConstructor] constructor();
[CEReactions, Pure] attribute unsigned long width;
[CEReactions, Pure] attribute unsigned long height;

View file

@ -3,8 +3,10 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://html.spec.whatwg.org/multipage/#htmldlistelement
[Exposed=Window, HTMLConstructor]
[Exposed=Window]
interface HTMLDListElement : HTMLElement {
[HTMLConstructor] constructor();
// also has obsolete members
};

View file

@ -3,8 +3,10 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://html.spec.whatwg.org/multipage/#htmldataelement
[Exposed=Window, HTMLConstructor]
[Exposed=Window]
interface HTMLDataElement : HTMLElement {
[HTMLConstructor] constructor();
[CEReactions]
attribute DOMString value;
};

View file

@ -3,7 +3,9 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://html.spec.whatwg.org/multipage/#htmldatalistelement
[Exposed=Window, HTMLConstructor]
[Exposed=Window]
interface HTMLDataListElement : HTMLElement {
[HTMLConstructor] constructor();
readonly attribute HTMLCollection options;
};

View file

@ -3,8 +3,10 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://html.spec.whatwg.org/multipage/#htmldetailselement
[Exposed=Window, HTMLConstructor]
[Exposed=Window]
interface HTMLDetailsElement : HTMLElement {
[HTMLConstructor] constructor();
[CEReactions]
attribute boolean open;
};

View file

@ -3,8 +3,10 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://html.spec.whatwg.org/multipage/#htmldialogelement
[Exposed=Window, HTMLConstructor]
[Exposed=Window]
interface HTMLDialogElement : HTMLElement {
[HTMLConstructor] constructor();
[CEReactions]
attribute boolean open;
attribute DOMString returnValue;

View file

@ -3,8 +3,10 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://html.spec.whatwg.org/multipage/#htmldirectoryelement
[Exposed=Window, HTMLConstructor]
[Exposed=Window]
interface HTMLDirectoryElement : HTMLElement {
[HTMLConstructor] constructor();
// [CEReactions]
// attribute boolean compact;
};

View file

@ -3,8 +3,10 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://html.spec.whatwg.org/multipage/#htmldivelement
[Exposed=Window, HTMLConstructor]
[Exposed=Window]
interface HTMLDivElement : HTMLElement {
[HTMLConstructor] constructor();
// also has obsolete members
};

View file

@ -3,8 +3,10 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://html.spec.whatwg.org/multipage/#htmlelement
[Exposed=Window, HTMLConstructor]
[Exposed=Window]
interface HTMLElement : Element {
[HTMLConstructor] constructor();
// metadata attributes
[CEReactions]
attribute DOMString title;

View file

@ -3,8 +3,10 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://html.spec.whatwg.org/multipage/#htmlembedelement
[Exposed=Window, HTMLConstructor]
[Exposed=Window]
interface HTMLEmbedElement : HTMLElement {
[HTMLConstructor] constructor();
// [CEReactions]
// attribute DOMString src;
// [CEReactions]

View file

@ -3,8 +3,10 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://html.spec.whatwg.org/multipage/#htmlfieldsetelement
[Exposed=Window, HTMLConstructor]
[Exposed=Window]
interface HTMLFieldSetElement : HTMLElement {
[HTMLConstructor] constructor();
[CEReactions]
attribute boolean disabled;
readonly attribute HTMLFormElement? form;

View file

@ -3,8 +3,10 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://html.spec.whatwg.org/multipage/#htmlfontelement
[Exposed=Window, HTMLConstructor]
[Exposed=Window]
interface HTMLFontElement : HTMLElement {
[HTMLConstructor] constructor();
[CEReactions]
attribute [TreatNullAs=EmptyString] DOMString color;
[CEReactions]

View file

@ -3,8 +3,10 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://html.spec.whatwg.org/multipage/#htmlformelement
[Exposed=Window, /*OverrideBuiltins, */HTMLConstructor]
[Exposed=Window]
interface HTMLFormElement : HTMLElement {
[HTMLConstructor] constructor();
[CEReactions]
attribute DOMString acceptCharset;
[CEReactions]

View file

@ -3,8 +3,10 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://html.spec.whatwg.org/multipage/#htmlframeelement
[Exposed=Window, HTMLConstructor]
[Exposed=Window]
interface HTMLFrameElement : HTMLElement {
[HTMLConstructor] constructor();
// [CEReactions]
// attribute DOMString name;
// [CEReactions]

View file

@ -3,8 +3,10 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://html.spec.whatwg.org/multipage/#htmlframesetelement
[Exposed=Window, HTMLConstructor]
[Exposed=Window]
interface HTMLFrameSetElement : HTMLElement {
[HTMLConstructor] constructor();
// [CEReactions]
// attribute DOMString cols;
// [CEReactions]

View file

@ -3,8 +3,10 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://html.spec.whatwg.org/multipage/#htmlhrelement
[Exposed=Window, HTMLConstructor]
[Exposed=Window]
interface HTMLHRElement : HTMLElement {
[HTMLConstructor] constructor();
// also has obsolete members
};

View file

@ -3,5 +3,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://html.spec.whatwg.org/multipage/#htmlheadelement
[Exposed=Window, HTMLConstructor]
interface HTMLHeadElement : HTMLElement {};
[Exposed=Window]
interface HTMLHeadElement : HTMLElement {
[HTMLConstructor] constructor();
};

View file

@ -3,8 +3,10 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://html.spec.whatwg.org/multipage/#htmlheadingelement
[Exposed=Window, HTMLConstructor]
[Exposed=Window]
interface HTMLHeadingElement : HTMLElement {
[HTMLConstructor] constructor();
// also has obsolete members
};

View file

@ -3,8 +3,10 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://html.spec.whatwg.org/multipage/#htmlhtmlelement
[Exposed=Window, HTMLConstructor]
[Exposed=Window]
interface HTMLHtmlElement : HTMLElement {
[HTMLConstructor] constructor();
// also has obsolete members
};

View file

@ -3,8 +3,10 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://html.spec.whatwg.org/multipage/#htmliframeelement
[Exposed=Window, HTMLConstructor]
[Exposed=Window]
interface HTMLIFrameElement : HTMLElement {
[HTMLConstructor] constructor();
[CEReactions]
attribute USVString src;
// [CEReactions]

View file

@ -3,8 +3,10 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://html.spec.whatwg.org/multipage/#htmlimageelement
[Exposed=Window, HTMLConstructor, NamedConstructor=Image(optional unsigned long width, optional unsigned long height)]
[Exposed=Window, NamedConstructor=Image(optional unsigned long width, optional unsigned long height)]
interface HTMLImageElement : HTMLElement {
[HTMLConstructor] constructor();
[CEReactions]
attribute DOMString alt;
[CEReactions]

View file

@ -3,8 +3,10 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://html.spec.whatwg.org/multipage/#htmlinputelement
[Exposed=Window, HTMLConstructor]
[Exposed=Window]
interface HTMLInputElement : HTMLElement {
[HTMLConstructor] constructor();
[CEReactions]
attribute DOMString accept;
[CEReactions]
@ -109,7 +111,6 @@ interface HTMLInputElement : HTMLElement {
// Select with file-system paths for testing purpose
[Pref="dom.testing.htmlinputelement.select_files.enabled"]
void selectFiles(sequence<DOMString> path);
};
// https://html.spec.whatwg.org/multipage/#HTMLInputElement-partial

View file

@ -3,8 +3,10 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://html.spec.whatwg.org/multipage/#htmllielement
[Exposed=Window, HTMLConstructor]
[Exposed=Window]
interface HTMLLIElement : HTMLElement {
[HTMLConstructor] constructor();
[CEReactions]
attribute long value;

View file

@ -3,8 +3,10 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://html.spec.whatwg.org/multipage/#htmllabelelement
[Exposed=Window, HTMLConstructor]
[Exposed=Window]
interface HTMLLabelElement : HTMLElement {
[HTMLConstructor] constructor();
readonly attribute HTMLFormElement? form;
[CEReactions]
attribute DOMString htmlFor;

View file

@ -3,8 +3,10 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://html.spec.whatwg.org/multipage/#htmllegendelement
[Exposed=Window, HTMLConstructor]
[Exposed=Window]
interface HTMLLegendElement : HTMLElement {
[HTMLConstructor] constructor();
readonly attribute HTMLFormElement? form;
// also has obsolete members

View file

@ -3,8 +3,10 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://html.spec.whatwg.org/multipage/#htmllinkelement
[Exposed=Window, HTMLConstructor]
[Exposed=Window]
interface HTMLLinkElement : HTMLElement {
[HTMLConstructor] constructor();
[CEReactions]
attribute USVString href;
[CEReactions]

View file

@ -3,8 +3,10 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://html.spec.whatwg.org/multipage/#htmlmapelement
[Exposed=Window, HTMLConstructor]
[Exposed=Window]
interface HTMLMapElement : HTMLElement {
[HTMLConstructor] constructor();
// [CEReactions]
// attribute DOMString name;
// readonly attribute HTMLCollection areas;

View file

@ -3,8 +3,10 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://html.spec.whatwg.org/multipage/#htmlmetaelement
[Exposed=Window, HTMLConstructor]
[Exposed=Window]
interface HTMLMetaElement : HTMLElement {
[HTMLConstructor] constructor();
[CEReactions]
attribute DOMString name;
// [CEReactions]

View file

@ -3,8 +3,10 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://html.spec.whatwg.org/multipage/#htmlmeterelement
[Exposed=Window, HTMLConstructor]
[Exposed=Window]
interface HTMLMeterElement : HTMLElement {
[HTMLConstructor] constructor();
// [CEReactions]
// attribute double value;
// [CEReactions]

View file

@ -3,8 +3,10 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://html.spec.whatwg.org/multipage/#htmlmodelement
[Exposed=Window, HTMLConstructor]
[Exposed=Window]
interface HTMLModElement : HTMLElement {
[HTMLConstructor] constructor();
// [CEReactions]
// attribute DOMString cite;
// [CEReactions]

View file

@ -3,8 +3,10 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://html.spec.whatwg.org/multipage/#htmlolistelement
[Exposed=Window, HTMLConstructor]
[Exposed=Window]
interface HTMLOListElement : HTMLElement {
[HTMLConstructor] constructor();
// [CEReactions]
// attribute boolean reversed;
// [CEReactions]

View file

@ -3,8 +3,10 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://html.spec.whatwg.org/multipage/#htmlobjectelement
[Exposed=Window, HTMLConstructor]
[Exposed=Window]
interface HTMLObjectElement : HTMLElement {
[HTMLConstructor] constructor();
// [CEReactions]
// attribute DOMString data;
[CEReactions]

View file

@ -3,8 +3,10 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://html.spec.whatwg.org/multipage/#htmloptgroupelement
[Exposed=Window, HTMLConstructor]
[Exposed=Window]
interface HTMLOptGroupElement : HTMLElement {
[HTMLConstructor] constructor();
[CEReactions]
attribute boolean disabled;
// [CEReactions]

View file

@ -3,10 +3,12 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://html.spec.whatwg.org/multipage/#htmloptionelement
[Exposed=Window, HTMLConstructor/*, NamedConstructor=Option(optional DOMString text = "", optional DOMString value,
[Exposed=Window/*, NamedConstructor=Option(optional DOMString text = "", optional DOMString value,
optional boolean defaultSelected = false,
optional boolean selected = false)*/]
interface HTMLOptionElement : HTMLElement {
[HTMLConstructor] constructor();
[CEReactions]
attribute boolean disabled;
readonly attribute HTMLFormElement? form;

View file

@ -3,8 +3,10 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://html.spec.whatwg.org/multipage/#htmloutputelement
[Exposed=Window, HTMLConstructor]
[Exposed=Window]
interface HTMLOutputElement : HTMLElement {
[HTMLConstructor] constructor();
// [SameObject, PutForwards=value] readonly attribute DOMTokenList htmlFor;
readonly attribute HTMLFormElement? form;
// [CEReactions]

View file

@ -3,8 +3,10 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://html.spec.whatwg.org/multipage/#htmlparagraphelement
[Exposed=Window, HTMLConstructor]
[Exposed=Window]
interface HTMLParagraphElement : HTMLElement {
[HTMLConstructor] constructor();
// also has obsolete members
};

View file

@ -3,8 +3,10 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://html.spec.whatwg.org/multipage/#htmlparamelement
[Exposed=Window, HTMLConstructor]
[Exposed=Window]
interface HTMLParamElement : HTMLElement {
[HTMLConstructor] constructor();
// [CEReactions]
// attribute DOMString name;
// [CEReactions]

View file

@ -3,5 +3,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://html.spec.whatwg.org/multipage/#htmlpictureelement
[Exposed=Window, HTMLConstructor]
interface HTMLPictureElement : HTMLElement {};
[Exposed=Window]
interface HTMLPictureElement : HTMLElement {
[HTMLConstructor] constructor();
};

View file

@ -3,8 +3,10 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://html.spec.whatwg.org/multipage/#htmlpreelement
[Exposed=Window, HTMLConstructor]
[Exposed=Window]
interface HTMLPreElement : HTMLElement {
[HTMLConstructor] constructor();
// also has obsolete members
};

View file

@ -3,8 +3,10 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://html.spec.whatwg.org/multipage/#htmlprogresselement
[Exposed=Window, HTMLConstructor]
[Exposed=Window]
interface HTMLProgressElement : HTMLElement {
[HTMLConstructor] constructor();
// [CEReactions]
// attribute double value;
// [CEReactions]

View file

@ -3,8 +3,10 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://html.spec.whatwg.org/multipage/#htmlquoteelement
[Exposed=Window, HTMLConstructor]
[Exposed=Window]
interface HTMLQuoteElement : HTMLElement {
[HTMLConstructor] constructor();
// [CEReactions]
// attribute DOMString cite;
};

View file

@ -3,8 +3,10 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://html.spec.whatwg.org/multipage/#htmlscriptelement
[Exposed=Window, HTMLConstructor]
[Exposed=Window]
interface HTMLScriptElement : HTMLElement {
[HTMLConstructor] constructor();
[CEReactions]
attribute USVString src;
[CEReactions]

View file

@ -3,8 +3,10 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://html.spec.whatwg.org/multipage/#htmlselectelement
[Exposed=Window, HTMLConstructor]
[Exposed=Window]
interface HTMLSelectElement : HTMLElement {
[HTMLConstructor] constructor();
// [CEReactions]
// attribute boolean autofocus;
[CEReactions]

View file

@ -3,8 +3,10 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://html.spec.whatwg.org/multipage/#htmlsourceelement
[Exposed=Window, HTMLConstructor]
[Exposed=Window]
interface HTMLSourceElement : HTMLElement {
[HTMLConstructor] constructor();
[CEReactions]
attribute DOMString src;
[CEReactions]

View file

@ -3,5 +3,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://html.spec.whatwg.org/multipage/#htmlspanelement
[Exposed=Window, HTMLConstructor]
interface HTMLSpanElement : HTMLElement {};
[Exposed=Window]
interface HTMLSpanElement : HTMLElement {
[HTMLConstructor] constructor();
};

View file

@ -3,8 +3,10 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://html.spec.whatwg.org/multipage/#htmlstyleelement
[Exposed=Window, HTMLConstructor]
[Exposed=Window]
interface HTMLStyleElement : HTMLElement {
[HTMLConstructor] constructor();
// [CEReactions]
// attribute DOMString media;
// [CEReactions]

View file

@ -3,8 +3,10 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://html.spec.whatwg.org/multipage/#htmltablecaptionelement
[Exposed=Window, HTMLConstructor]
[Exposed=Window]
interface HTMLTableCaptionElement : HTMLElement {
[HTMLConstructor] constructor();
// also has obsolete members
};

View file

@ -3,8 +3,10 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://html.spec.whatwg.org/multipage/#htmltablecellelement
[Exposed=Window, HTMLConstructor]
[Exposed=Window]
interface HTMLTableCellElement : HTMLElement {
[HTMLConstructor] constructor();
[CEReactions]
attribute unsigned long colSpan;
[CEReactions]

View file

@ -3,8 +3,10 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://html.spec.whatwg.org/multipage/#htmltablecolelement
[Exposed=Window, HTMLConstructor]
[Exposed=Window]
interface HTMLTableColElement : HTMLElement {
[HTMLConstructor] constructor();
// [CEReactions]
// attribute unsigned long span;

View file

@ -3,8 +3,10 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://html.spec.whatwg.org/multipage/#htmltableelement
[Exposed=Window, HTMLConstructor]
[Exposed=Window]
interface HTMLTableElement : HTMLElement {
[HTMLConstructor] constructor();
[CEReactions]
attribute HTMLTableCaptionElement? caption;
HTMLTableCaptionElement createCaption();

View file

@ -3,8 +3,10 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://html.spec.whatwg.org/multipage/#htmltablerowelement
[Exposed=Window, HTMLConstructor]
[Exposed=Window]
interface HTMLTableRowElement : HTMLElement {
[HTMLConstructor] constructor();
readonly attribute long rowIndex;
readonly attribute long sectionRowIndex;
readonly attribute HTMLCollection cells;

View file

@ -3,8 +3,10 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://html.spec.whatwg.org/multipage/#htmltablesectionelement
[Exposed=Window, HTMLConstructor]
[Exposed=Window]
interface HTMLTableSectionElement : HTMLElement {
[HTMLConstructor] constructor();
readonly attribute HTMLCollection rows;
[Throws]
HTMLElement insertRow(optional long index = -1);

View file

@ -3,7 +3,9 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://html.spec.whatwg.org/multipage/#htmltemplateelement
[Exposed=Window, HTMLConstructor]
[Exposed=Window]
interface HTMLTemplateElement : HTMLElement {
[HTMLConstructor] constructor();
readonly attribute DocumentFragment content;
};

View file

@ -3,8 +3,10 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://html.spec.whatwg.org/multipage/#htmltextareaelement
[Exposed=Window, HTMLConstructor]
[Exposed=Window]
interface HTMLTextAreaElement : HTMLElement {
[HTMLConstructor] constructor();
// [CEReactions]
// attribute DOMString autocomplete;
// [CEReactions]

View file

@ -3,8 +3,10 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://html.spec.whatwg.org/multipage/#htmltimeelement
[Exposed=Window, HTMLConstructor]
[Exposed=Window]
interface HTMLTimeElement : HTMLElement {
[HTMLConstructor] constructor();
[CEReactions]
attribute DOMString dateTime;
};

View file

@ -3,8 +3,10 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://html.spec.whatwg.org/multipage/#htmltitleelement
[Exposed=Window, HTMLConstructor]
[Exposed=Window]
interface HTMLTitleElement : HTMLElement {
[HTMLConstructor] constructor();
[CEReactions, Pure]
attribute DOMString text;
};

View file

@ -3,8 +3,10 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://html.spec.whatwg.org/multipage/#htmltrackelement
[Exposed=Window, HTMLConstructor]
[Exposed=Window]
interface HTMLTrackElement : HTMLElement {
[HTMLConstructor] constructor();
[CEReactions]
attribute DOMString kind;
[CEReactions]

View file

@ -3,8 +3,10 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://html.spec.whatwg.org/multipage/#htmlulistelement
[Exposed=Window, HTMLConstructor]
[Exposed=Window]
interface HTMLUListElement : HTMLElement {
[HTMLConstructor] constructor();
// also has obsolete members
};

View file

@ -3,8 +3,10 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://html.spec.whatwg.org/multipage/#htmlvideoelement
[Exposed=Window, HTMLConstructor]
[Exposed=Window]
interface HTMLVideoElement : HTMLMediaElement {
[HTMLConstructor] constructor();
// [CEReactions]
// attribute unsigned long width;
// [CEReactions]