Skip to content

Add form/imagemap/table/input types #495

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 13 additions & 25 deletions baselines/dom.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5649,6 +5649,8 @@ interface HTMLAreaElement extends HTMLElement, HTMLHyperlinkElementUtils {
*/
/** @deprecated */
noHref: boolean;
ping: string;
referrerPolicy: string;
rel: string;
readonly relList: DOMTokenList;
/**
Expand All @@ -5670,14 +5672,6 @@ declare var HTMLAreaElement: {
new(): HTMLAreaElement;
};

interface HTMLAreasCollection extends HTMLCollectionBase {
}

declare var HTMLAreasCollection: {
prototype: HTMLAreasCollection;
new(): HTMLAreasCollection;
};

interface HTMLAudioElement extends HTMLMediaElement {
addEventListener<K extends keyof HTMLMediaElementEventMap>(type: K, listener: (this: HTMLAudioElement, ev: HTMLMediaElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
Expand Down Expand Up @@ -6403,16 +6397,6 @@ interface HTMLFormElement extends HTMLElement {
* Returns whether a form will validate when it is submitted, without having to submit it.
*/
checkValidity(): boolean;
/**
* Retrieves a form object or an object from an elements collection.
* @param name Variant of type Number or String that specifies the object or collection to retrieve. If this parameter is a Number, it is the zero-based index of the object. If this parameter is a string, all objects with matching name or id properties are retrieved, and a collection is returned if more than one match is made.
* @param index Variant of type Number that specifies the zero-based index of the object to retrieve when a collection is returned.
*/
item(name?: any, index?: any): any;
/**
* Retrieves a form object or an object from an elements collection.
*/
namedItem(name: string): any;
reportValidity(): boolean;
/**
* Fires when the user resets a form.
Expand All @@ -6426,7 +6410,7 @@ interface HTMLFormElement extends HTMLElement {
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLFormElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
[name: string]: any;
[index: number]: Element;
}

declare var HTMLFormElement: {
Expand Down Expand Up @@ -6822,6 +6806,7 @@ interface HTMLInputElement extends HTMLElement {
* Sets or retrieves the initial contents of the object.
*/
defaultValue: string;
dirName: string;
disabled: boolean;
/**
* Returns a FileList object on a file type input object.
Expand Down Expand Up @@ -6856,6 +6841,7 @@ interface HTMLInputElement extends HTMLElement {
*/
height: number;
indeterminate: boolean;
readonly labels: NodeListOf<HTMLLabelElement> | null;
/**
* Specifies the ID of a pre-defined datalist of options for an input element.
*/
Expand Down Expand Up @@ -6938,7 +6924,6 @@ interface HTMLInputElement extends HTMLElement {
* Returns the input field value as a number.
*/
valueAsNumber: number;
webkitdirectory: boolean;
/**
* Sets or retrieves the width of the object.
*/
Expand All @@ -6951,6 +6936,7 @@ interface HTMLInputElement extends HTMLElement {
* Returns whether a form will validate when it is submitted, without having to submit it.
*/
checkValidity(): boolean;
reportValidity(): boolean;
/**
* Makes the selection equal to the current object.
*/
Expand All @@ -6960,6 +6946,8 @@ interface HTMLInputElement extends HTMLElement {
* @param error Sets a custom error message that is displayed when a form is submitted.
*/
setCustomValidity(error: string): void;
setRangeText(replacement: string): void;
setRangeText(replacement: string, start: number, end: number, selectionMode?: SelectionMode): void;
/**
* Sets the start and end positions of a selection in a text field.
* @param start The offset into the text field for the start of the selection.
Expand Down Expand Up @@ -7007,7 +6995,7 @@ declare var HTMLLIElement: {
};

interface HTMLLabelElement extends HTMLElement {
readonly control: HTMLInputElement | null;
readonly control: HTMLElement | null;
/**
* Retrieves a reference to the form that the object is embedded in.
*/
Expand Down Expand Up @@ -7115,7 +7103,7 @@ interface HTMLMapElement extends HTMLElement {
/**
* Retrieves a collection of the area objects defined for the given map object.
*/
readonly areas: HTMLAreasCollection;
readonly areas: HTMLCollection;
/**
* Sets or retrieves the name of the object.
*/
Expand Down Expand Up @@ -8287,7 +8275,7 @@ interface HTMLTableElement extends HTMLElement {
* Removes the specified row (tr) from the element and from the rows collection.
* @param index Number that specifies the zero-based position in the rows collection of the row to remove.
*/
deleteRow(index?: number): void;
deleteRow(index: number): void;
/**
* Deletes the tFoot element and its contents from the table.
*/
Expand Down Expand Up @@ -8355,7 +8343,7 @@ interface HTMLTableRowElement extends HTMLElement {
* Removes the specified cell from the table row, as well as from the cells collection.
* @param index Number that specifies the zero-based position of the cell to remove from the table row. If no value is provided, the last cell in the cells collection is deleted.
*/
deleteCell(index?: number): void;
deleteCell(index: number): void;
/**
* Creates a new cell in the table row, and adds the cell to the cells collection.
* @param index Number that specifies where to insert the cell in the tr. The default value is -1, which appends the new cell to the end of the cells collection.
Expand Down Expand Up @@ -8392,7 +8380,7 @@ interface HTMLTableSectionElement extends HTMLElement {
* Removes the specified row (tr) from the element and from the rows collection.
* @param index Number that specifies the zero-based position in the rows collection of the row to remove.
*/
deleteRow(index?: number): void;
deleteRow(index: number): void;
/**
* Creates a new row (tr) in the table, and adds the row to the rows collection.
* @param index Number that specifies where to insert the row in the rows collection. The default value is -1, which appends the new row to the end of the rows collection.
Expand Down
4 changes: 4 additions & 0 deletions baselines/dom.iterable.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ interface HTMLCollectionOf<T extends Element> {
[Symbol.iterator](): IterableIterator<T>;
}

interface HTMLFormElement {
[Symbol.iterator](): IterableIterator<Element>;
}

interface HTMLSelectElement {
[Symbol.iterator](): IterableIterator<Element>;
}
Expand Down
134 changes: 97 additions & 37 deletions inputfiles/addedTypes.json
Original file line number Diff line number Diff line change
Expand Up @@ -751,17 +751,6 @@
"extends": "Array<IDBValidKey>",
"no-interface-object": "1"
},
"HTMLInputElement": {
"name": "HTMLInputElement",
"properties": {
"property": {
"minLength": {
"name": "minLength",
"override-type": "number"
}
}
}
},
"HTMLIFrameElement": {
"name": "HTMLIFrameElement",
"properties": {
Expand Down Expand Up @@ -1504,20 +1493,6 @@
}
}
},
"HTMLFormElement": {
"name": "HTMLFormElement",
"methods": {
"method": {
"reportValidity": {
"name": "reportValidity",
"exposed": "Window",
"override-signatures": [
"reportValidity(): boolean"
]
}
}
}
},
"OES_vertex_array_object": {
"name": "OES_vertex_array_object",
"exposed": "Window",
Expand Down Expand Up @@ -2010,18 +1985,6 @@
},
"no-interface-object": "1"
},
"HTMLLabelElement": {
"name": "HTMLLabelElement",
"properties": {
"property": {
"control": {
"name": "control",
"read-only": 1,
"override-type": "HTMLInputElement | null"
}
}
}
},
"HTMLObjectElement": {
"name": "HTMLObjectElement",
"properties": {
Expand Down Expand Up @@ -2111,6 +2074,13 @@
},
"no-interface-object": "1"
},
"HTMLAreaElement": {
"element": [
{
"name": "area"
}
]
},
"HTMLBaseElement": {
"element": [
{
Expand All @@ -2132,6 +2102,13 @@
}
]
},
"HTMLFormElement": {
"element": [
{
"name": "form"
}
]
},
"HTMLHeadElement": {
"element": [
{
Expand All @@ -2153,6 +2130,21 @@
}
]
},
"HTMLInputElement": {
"properties": {
"property": {
"labels": {
"override-type": "NodeListOf<HTMLLabelElement> | null"
}
}
},
"element": [
{

"name": "input"
}
]
},
"HTMLLinkElement": {
"properties": {
"property": {
Expand All @@ -2168,13 +2160,27 @@
}
]
},
"HTMLLabelElement": {
"element": [
{
"name": "label"
}
]
},
"HTMLLIElement": {
"element": [
{
"name": "li"
}
]
},
"HTMLMapElement": {
"element": [
{
"name": "map"
}
]
},
"HTMLMenuElement": {
"element": [
{
Expand Down Expand Up @@ -2235,6 +2241,33 @@
}
]
},
"HTMLTableCaptionElement": {
"element": [
{
"name": "caption"
}
]
},
"HTMLTableCellElement": {
"element": [
{
"name": "td"
},
{
"name": "th"
}
]
},
"HTMLTableColElement": {
"element": [
{
"name": "col"
},
{
"name": "colgroup"
}
]
},
"HTMLTableDataCellElement": {
"name": "HTMLTableDataCellElement",
"extends": "HTMLTableCellElement",
Expand All @@ -2247,6 +2280,13 @@
}
]
},
"HTMLTableElement": {
"element": [
{
"name": "table"
}
]
},
"HTMLTableHeaderCellElement": {
"name": "HTMLTableHeaderCellElement",
"extends": "HTMLTableCellElement",
Expand All @@ -2265,6 +2305,26 @@
}
]
},
"HTMLTableRowElement": {
"element": [
{
"name": "tr"
}
]
},
"HTMLTableSectionElement": {
"element": [
{
"name": "tbody"
},
{
"name": "tfoot"
},
{
"name": "thead"
}
]
},
"HTMLTitleElement": {
"element": [
{
Expand Down
6 changes: 0 additions & 6 deletions inputfiles/comments.json
Original file line number Diff line number Diff line change
Expand Up @@ -1576,15 +1576,9 @@
"reset": {
"comment": "/**\r\n * Fires when the user resets a form.\r\n */"
},
"item": {
"comment": "/**\r\n * Retrieves a form object or an object from an elements collection.\r\n * @param name Variant of type Number or String that specifies the object or collection to retrieve. If this parameter is a Number, it is the zero-based index of the object. If this parameter is a string, all objects with matching name or id properties are retrieved, and a collection is returned if more than one match is made.\r\n * @param index Variant of type Number that specifies the zero-based index of the object to retrieve when a collection is returned.\r\n */"
},
"submit": {
"comment": "/**\r\n * Fires when a FORM is about to be submitted.\r\n */"
},
"namedItem": {
"comment": "/**\r\n * Retrieves a form object or an object from an elements collection.\r\n */"
},
"checkValidity": {
"comment": "/**\r\n * Returns whether a form will validate when it is submitted, without having to submit it.\r\n */"
}
Expand Down
11 changes: 11 additions & 0 deletions inputfiles/idl/HTML - Forms.commentmap.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"form-elements": "Returns an HTMLFormControlsCollection of the form controls in the form (excluding image\nbuttons for historical reasons).",
"form-length": "Returns the number of form controls in the form (excluding image buttons for historical\nreasons).",
"form-submit": "Submits the form.",
"form-reset": "Resets the form.",
"form-checkvalidity": "Returns true if the form's controls are all valid; otherwise, returns false.",
"form-reportvalidity": "Returns true if the form's controls are all valid; otherwise, returns false and informs the user.",
"label-control": "Returns the form control that is associated with this element.",
"label-form": "Returns the form owner of the form control that is associated with this\nelement.\nReturns null if there isn't one.",
"lfe-labels": "Returns a NodeList of all the label elements that the form control\nis associated with."
}
Loading