Commit ce8bf10a authored by Yoshifumi Inoue's avatar Yoshifumi Inoue Committed by Commit Bot

Make most HTML elements to support custom element

This patch add [HTMLConstructor] IDL extend attribute[1] to interface
declaration of all of HTML element except for below to support custom element.

Following HTML elements are not supported by this patch
 - <canvas> [2] Blink IDL compiler issue
 - <embed> [3] Crash in V8
 - <form> [4] Crash in Blink
 - <iframe> [2] Blink IDL compiler issue
 - <input> [2] Blink IDL compiler issue
 - <object> [5] Crash in V8
 - <video> [2] Blink IDL compiler issue

[1] https://html.spec.whatwg.org/multipage/dom.html#htmlconstructor
[2] http://crbug.com/806163 Blink IDL compiler should ignore HTMLConstructor
extended attribute
[3] http://crbug.com/806184 HTMLEmbedElement.idl should have HTMLConstruct
extend attribute
[4] http://crbug.com/806185 HTMLFormElement.idl should have HTMLConstruct extend
attribute
[5] http://crbug.com/806187 HTMLObjectElement.idl should have HTMLConstruct
extend attribute

Bug: 805326
Change-Id: Iccd292766102dbcd3eebf3ec1fd044dc4ff266b5
Reviewed-on: https://chromium-review.googlesource.com/888228
Commit-Queue: Kent Tamura <tkent@chromium.org>
Reviewed-by: default avatarKent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#532297}
parent 5690fe9f
......@@ -19,7 +19,7 @@
*/
// https://html.spec.whatwg.org/#the-a-element
[HTMLConstructor]
interface HTMLAnchorElement : HTMLElement {
[CEReactions, Reflect] attribute DOMString target;
[CEReactions, Reflect] attribute DOMString download;
......
......@@ -19,7 +19,7 @@
*/
// https://html.spec.whatwg.org/#the-area-element
[HTMLConstructor]
interface HTMLAreaElement : HTMLElement {
[CEReactions, Reflect] attribute DOMString alt;
[CEReactions, Reflect] attribute DOMString coords;
......
......@@ -18,7 +18,7 @@
*/
// https://html.spec.whatwg.org/#the-br-element
[HTMLConstructor]
interface HTMLBRElement : HTMLElement {
// obsolete members
// https://html.spec.whatwg.org/#HTMLBRElement-partial
......
......@@ -18,7 +18,7 @@
*/
// https://html.spec.whatwg.org/#the-base-element
[HTMLConstructor]
interface HTMLBaseElement : HTMLElement {
[CEReactions] attribute USVString href;
[CEReactions, Reflect] attribute DOMString target;
......
......@@ -19,7 +19,7 @@
*/
// https://html.spec.whatwg.org/#the-body-element
[HTMLConstructor]
interface HTMLBodyElement : HTMLElement {
// obsolete members
// https://html.spec.whatwg.org/#HTMLBodyElement-partial
......
......@@ -18,7 +18,7 @@
*/
// https://html.spec.whatwg.org/#the-dl-element
[HTMLConstructor]
interface HTMLDListElement : HTMLElement {
// obsolete members
// https://html.spec.whatwg.org/#HTMLDListElement-partial
......
......@@ -18,7 +18,7 @@
*/
// https://html.spec.whatwg.org/#the-details-element
[HTMLConstructor]
interface HTMLDetailsElement : HTMLElement {
[CEReactions, Reflect] attribute boolean open;
};
......@@ -24,7 +24,7 @@
*/
// https://html.spec.whatwg.org/#the-dialog-element
[HTMLConstructor]
interface HTMLDialogElement : HTMLElement {
[CEReactions, Reflect] attribute boolean open;
attribute DOMString returnValue;
......
......@@ -18,7 +18,7 @@
*/
// https://html.spec.whatwg.org/#htmldirectoryelement
[HTMLConstructor]
interface HTMLDirectoryElement : HTMLElement {
[CEReactions, Reflect] attribute boolean compact;
};
......@@ -18,7 +18,7 @@
*/
// https://html.spec.whatwg.org/#htmlfontelement
[HTMLConstructor]
interface HTMLFontElement : HTMLElement {
[CEReactions, Reflect, TreatNullAs=EmptyString] attribute DOMString color;
[CEReactions, Reflect] attribute DOMString face;
......
......@@ -19,7 +19,7 @@
*/
// https://html.spec.whatwg.org/#htmlframeelement
[HTMLConstructor]
interface HTMLFrameElement : HTMLElement {
[CEReactions, Reflect] attribute DOMString name;
[CEReactions, Reflect] attribute DOMString scrolling;
......
......@@ -22,6 +22,7 @@
// FIXME: HTMLFrameSetElement should not have [OverrideBuiltins].
[
HTMLConstructor,
OverrideBuiltins
] interface HTMLFrameSetElement : HTMLElement {
[CEReactions, Reflect] attribute DOMString cols;
......
......@@ -18,7 +18,7 @@
*/
// https://html.spec.whatwg.org/#the-hr-element
[HTMLConstructor]
interface HTMLHRElement : HTMLElement {
// obsolete members
// https://html.spec.whatwg.org/#HTMLHRElement-partial
......
......@@ -18,6 +18,6 @@
*/
// https://html.spec.whatwg.org/#the-head-element
[HTMLConstructor]
interface HTMLHeadElement : HTMLElement {
};
......@@ -18,7 +18,7 @@
*/
// https://html.spec.whatwg.org/#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements
[HTMLConstructor]
interface HTMLHeadingElement : HTMLElement {
// obsolete members
// https://html.spec.whatwg.org/#HTMLHeadingElement-partial
......
......@@ -18,7 +18,7 @@
*/
// https://html.spec.whatwg.org/#the-html-element
[HTMLConstructor]
interface HTMLHtmlElement : HTMLElement {
// obsolete members
// https://html.spec.whatwg.org/#HTMLHtmlElement-partial
......
......@@ -23,6 +23,7 @@
[
ActiveScriptWrappable,
ConstructorCallWith=Document,
HTMLConstructor,
NamedConstructor=Image(optional unsigned long width, optional unsigned long height)
] interface HTMLImageElement : HTMLElement {
[CEReactions, Reflect] attribute DOMString alt;
......
......@@ -18,7 +18,7 @@
*/
// https://html.spec.whatwg.org/#the-li-element
[HTMLConstructor]
interface HTMLLIElement : HTMLElement {
[CEReactions, Reflect] attribute long value;
......
......@@ -20,7 +20,7 @@
*/
// https://html.spec.whatwg.org/#the-link-element
[HTMLConstructor]
interface HTMLLinkElement : HTMLElement {
// FIXME: The disabled attribute has been removed from the spec:
// https://www.w3.org/Bugs/Public/show_bug.cgi?id=14703
......
......@@ -19,7 +19,7 @@
*/
// https://html.spec.whatwg.org/#the-map-element
[HTMLConstructor]
interface HTMLMapElement : HTMLElement {
[CEReactions, Reflect] attribute DOMString name;
readonly attribute HTMLCollection areas;
......
......@@ -18,7 +18,7 @@
*/
// https://html.spec.whatwg.org/#htmlmarqueeelement
[HTMLConstructor]
interface HTMLMarqueeElement : HTMLElement {
[Reflect] attribute DOMString behavior;
[Reflect] attribute DOMString bgColor;
......
......@@ -18,7 +18,7 @@
*/
// https://html.spec.whatwg.org/#the-menu-element
[HTMLConstructor]
interface HTMLMenuElement : HTMLElement {
// obsolete members
// https://html.spec.whatwg.org/#HTMLMenuElement-partial
......
......@@ -18,7 +18,7 @@
*/
// https://html.spec.whatwg.org/#the-meta-element
[HTMLConstructor]
interface HTMLMetaElement : HTMLElement {
[CEReactions, Reflect] attribute DOMString name;
[CEReactions, Reflect=http_equiv] attribute DOMString httpEquiv;
......
......@@ -18,7 +18,7 @@
*/
// https://html.spec.whatwg.org/#the-meter-element
[HTMLConstructor]
interface HTMLMeterElement : HTMLElement {
[CEReactions] attribute double value;
[CEReactions] attribute double min;
......
......@@ -19,7 +19,7 @@
// https://html.spec.whatwg.org/#the-ins-element
// https://html.spec.whatwg.org/#the-del-element
[HTMLConstructor]
interface HTMLModElement : HTMLElement {
[CEReactions, Reflect, URL] attribute DOMString cite;
[CEReactions, Reflect] attribute DOMString dateTime;
......
......@@ -18,7 +18,7 @@
*/
// https://html.spec.whatwg.org/#the-ol-element
[HTMLConstructor]
interface HTMLOListElement : HTMLElement {
[CEReactions, Reflect] attribute boolean reversed;
[CEReactions] attribute long start;
......
......@@ -18,7 +18,7 @@
*/
// https://html.spec.whatwg.org/#the-param-element
[HTMLConstructor]
interface HTMLParamElement : HTMLElement {
[CEReactions, Reflect] attribute DOMString name;
[CEReactions, Reflect] attribute DOMString value;
......
......@@ -3,6 +3,6 @@
// found in the LICENSE file.
// https://html.spec.whatwg.org/#the-picture-element
[HTMLConstructor]
interface HTMLPictureElement : HTMLElement {
};
......@@ -19,7 +19,7 @@
*/
// https://html.spec.whatwg.org/#the-pre-element
[HTMLConstructor]
interface HTMLPreElement : HTMLElement {
// obsolete members
// https://html.spec.whatwg.org/#HTMLPreElement-partial
......
......@@ -18,7 +18,7 @@
*/
// https://html.spec.whatwg.org/#the-progress-element
[HTMLConstructor]
interface HTMLProgressElement : HTMLElement {
[CEReactions] attribute double value;
[CEReactions] attribute double max;
......
......@@ -19,7 +19,7 @@
// https://html.spec.whatwg.org/#the-blockquote-element
// https://html.spec.whatwg.org/#the-q-element
[HTMLConstructor]
interface HTMLQuoteElement : HTMLElement {
[CEReactions, Reflect, URL] attribute DOMString cite;
};
......@@ -18,7 +18,7 @@
*/
// https://html.spec.whatwg.org/#the-script-element
[HTMLConstructor]
interface HTMLScriptElement : HTMLElement {
[CEReactions, Reflect, URL, RaisesException=Setter] attribute ScriptURLString src;
[CEReactions, Reflect] attribute DOMString type;
......
......@@ -25,7 +25,7 @@
*/
// https://w3c.github.io/webcomponents/spec/shadow/#the-slot-element
[HTMLConstructor]
interface HTMLSlotElement : HTMLElement {
[CEReactions, Reflect] attribute DOMString name;
[ImplementedAs=AssignedNodesForBinding] sequence<Node> assignedNodes(optional AssignedNodesOptions options);
......
......@@ -24,7 +24,7 @@
*/
// https://html.spec.whatwg.org/#the-source-element
[HTMLConstructor]
interface HTMLSourceElement : HTMLElement {
[CEReactions, Reflect, URL] attribute USVString src;
[CEReactions] attribute DOMString type;
......
......@@ -24,6 +24,6 @@
*/
// https://html.spec.whatwg.org/#the-span-element
[HTMLConstructor]
interface HTMLSpanElement : HTMLElement {
};
......@@ -19,7 +19,7 @@
*/
// https://html.spec.whatwg.org/#the-style-element
[HTMLConstructor]
interface HTMLStyleElement : HTMLElement {
// TODO(foolip): The disabled attribute has been removed from the spec:
// https://www.w3.org/Bugs/Public/show_bug.cgi?id=14703
......
......@@ -19,7 +19,7 @@
*/
// https://html.spec.whatwg.org/#the-caption-element
[HTMLConstructor]
interface HTMLTableCaptionElement : HTMLElement {
// obsolete members
// https://html.spec.whatwg.org/#HTMLTableCaptionElement-partial
......
......@@ -19,7 +19,7 @@
*/
// https://html.spec.whatwg.org/#attributes-common-to-td-and-th-elements
[HTMLConstructor]
interface HTMLTableCellElement : HTMLElement {
[CEReactions] attribute unsigned long colSpan;
[CEReactions] attribute unsigned long rowSpan;
......
......@@ -20,7 +20,7 @@
// https://html.spec.whatwg.org/#the-colgroup-element
// https://html.spec.whatwg.org/#the-col-element
[HTMLConstructor]
interface HTMLTableColElement : HTMLElement {
[CEReactions] attribute unsigned long span;
......
......@@ -19,7 +19,7 @@
*/
// https://html.spec.whatwg.org/#the-table-element
[HTMLConstructor]
interface HTMLTableElement : HTMLElement {
[CEReactions, RaisesException=Setter] attribute HTMLTableCaptionElement? caption;
[CEReactions] HTMLTableCaptionElement createCaption();
......
......@@ -19,7 +19,7 @@
*/
// https://html.spec.whatwg.org/#the-tr-element
[HTMLConstructor]
interface HTMLTableRowElement : HTMLElement {
readonly attribute long rowIndex;
readonly attribute long sectionRowIndex;
......
......@@ -21,7 +21,7 @@
// https://html.spec.whatwg.org/#the-tbody-element
// https://html.spec.whatwg.org/#the-thead-element
// https://html.spec.whatwg.org/#the-tfoot-element
[HTMLConstructor]
interface HTMLTableSectionElement : HTMLElement {
readonly attribute HTMLCollection rows;
[CEReactions, RaisesException] HTMLElement insertRow(optional long index = -1);
......
......@@ -29,7 +29,7 @@
*/
// https://html.spec.whatwg.org/#the-template-element
[HTMLConstructor]
interface HTMLTemplateElement : HTMLElement {
readonly attribute DocumentFragment content;
};
......@@ -18,7 +18,7 @@
*/
// https://html.spec.whatwg.org/#the-title-element
[HTMLConstructor]
interface HTMLTitleElement : HTMLElement {
[CEReactions] attribute DOMString text;
};
......@@ -18,7 +18,7 @@
*/
// https://html.spec.whatwg.org/#the-ul-element
[HTMLConstructor]
interface HTMLUListElement : HTMLElement {
// obsolete members
// https://html.spec.whatwg.org/#HTMLUListElement-partial
......
......@@ -19,7 +19,7 @@
*/
// https://html.spec.whatwg.org/#the-button-element
[HTMLConstructor]
interface HTMLButtonElement : HTMLElement {
[CEReactions, Reflect] attribute boolean autofocus;
[CEReactions, Reflect] attribute boolean disabled;
......
......@@ -29,7 +29,7 @@
*/
// https://html.spec.whatwg.org/#the-datalist-element
[HTMLConstructor]
interface HTMLDataListElement : HTMLElement {
readonly attribute HTMLCollection options;
};
......@@ -18,7 +18,7 @@
*/
// https://html.spec.whatwg.org/#the-fieldset-element
[HTMLConstructor]
interface HTMLFieldSetElement : HTMLElement {
[CEReactions, Reflect] attribute boolean disabled;
[ImplementedAs=formOwner] readonly attribute HTMLFormElement? form;
......
......@@ -19,7 +19,7 @@
*/
// https://html.spec.whatwg.org/#the-label-element
[HTMLConstructor]
interface HTMLLabelElement : HTMLElement {
readonly attribute HTMLFormElement? form;
[CEReactions, Reflect=for] attribute DOMString htmlFor;
......
......@@ -19,7 +19,7 @@
*/
// https://html.spec.whatwg.org/#the-legend-element
[HTMLConstructor]
interface HTMLLegendElement : HTMLElement {
readonly attribute HTMLFormElement? form;
......
......@@ -18,7 +18,7 @@
*/
// https://html.spec.whatwg.org/#the-optgroup-element
[HTMLConstructor]
interface HTMLOptGroupElement : HTMLElement {
[CEReactions, Reflect] attribute boolean disabled;
[CEReactions, Reflect] attribute DOMString label;
......
......@@ -21,6 +21,7 @@
// https://html.spec.whatwg.org/#the-option-element
[
HTMLConstructor,
NamedConstructor=Option(optional DOMString data = null,
optional DOMString value = null,
optional boolean defaultSelected = false,
......
......@@ -24,7 +24,7 @@
*/
// https://html.spec.whatwg.org/#the-output-element
[HTMLConstructor]
interface HTMLOutputElement : HTMLElement {
[CEReactions, PutForwards=value] readonly attribute DOMTokenList htmlFor;
[ImplementedAs=formOwner] readonly attribute HTMLFormElement? form;
......
......@@ -20,7 +20,7 @@
*/
// https://html.spec.whatwg.org/#the-select-element
[HTMLConstructor]
interface HTMLSelectElement : HTMLElement {
[CEReactions, Reflect] attribute DOMString autocomplete;
[CEReactions, Reflect] attribute boolean autofocus;
......
......@@ -20,7 +20,7 @@
*/
// https://html.spec.whatwg.org/#the-textarea-element
[HTMLConstructor]
interface HTMLTextAreaElement : HTMLElement {
[CEReactions, Reflect] attribute DOMString autocomplete;
[CEReactions, Reflect] attribute boolean autofocus;
......
......@@ -26,6 +26,7 @@
// https://html.spec.whatwg.org/#the-audio-element
[
HTMLConstructor,
NamedConstructor=Audio(optional DOMString src),
ConstructorCallWith=Document
] interface HTMLAudioElement : HTMLMediaElement {
......
......@@ -24,7 +24,7 @@
*/
// https://html.spec.whatwg.org/#the-track-element
[HTMLConstructor]
interface HTMLTrackElement : HTMLElement {
[CEReactions] attribute DOMString kind;
[CEReactions, Reflect, URL] attribute DOMString src;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment