From 3c9e48ccd518bde1fa7b086b7df633f3cb21e91a Mon Sep 17 00:00:00 2001 From: "mgquan@myseneca.ca" Date: Wed, 13 Jun 2018 21:59:30 -0400 Subject: [PATCH 1/5] added nonce --- baselines/dom.generated.d.ts | 2 ++ inputfiles/overridingTypes.json | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/baselines/dom.generated.d.ts b/baselines/dom.generated.d.ts index cef316cd7..8acfc09e8 100644 --- a/baselines/dom.generated.d.ts +++ b/baselines/dom.generated.d.ts @@ -7861,6 +7861,7 @@ interface HTMLScriptElement extends HTMLElement { htmlFor: string; integrity: string; noModule: boolean; + nonce: string; referrerPolicy: string; /** * Retrieves the URL to an external file that contains the source code or data. @@ -8046,6 +8047,7 @@ interface HTMLStyleElement extends HTMLElement, LinkStyle { * Sets or retrieves the media type. */ media: string; + nonce: string; /** * Retrieves the CSS language in which the style sheet is written. */ diff --git a/inputfiles/overridingTypes.json b/inputfiles/overridingTypes.json index dd7661e31..0474c87ca 100644 --- a/inputfiles/overridingTypes.json +++ b/inputfiles/overridingTypes.json @@ -235,6 +235,26 @@ } } }, + "HTMLScriptElement": { + "properties": { + "property": { + "nonce": { + "name": "nonce", + "type": "DOMString" + } + } + } + }, + "HTMLStyleElement": { + "properties": { + "property": { + "nonce": { + "name": "nonce", + "type": "DOMString" + } + } + } + }, "SourceBuffer": { "specs": "media-source", "name": "SourceBuffer", From 2a672537e909c14de3b51f78844f86b79b3791b2 Mon Sep 17 00:00:00 2001 From: "mgquan@myseneca.ca" Date: Sat, 16 Jun 2018 09:33:32 -0400 Subject: [PATCH 2/5] moved nonce to HTMLOrSVGElement --- baselines/dom.generated.d.ts | 14 ++++++-- inputfiles/addedTypes.json | 59 ++++++++++++++++++++++++++++++--- inputfiles/overridingTypes.json | 20 ----------- 3 files changed, 66 insertions(+), 27 deletions(-) diff --git a/baselines/dom.generated.d.ts b/baselines/dom.generated.d.ts index 8acfc09e8..53b5fd77b 100644 --- a/baselines/dom.generated.d.ts +++ b/baselines/dom.generated.d.ts @@ -464,6 +464,10 @@ interface FocusNavigationOrigin { originWidth?: number; } +interface FocusOptions { + preventScoll: boolean; +} + interface GainOptions extends AudioNodeOptions { gain?: number; } @@ -7695,6 +7699,14 @@ declare var HTMLOptionsCollection: { new(): HTMLOptionsCollection; }; +interface HTMLOrSVGElement { + readonly dataset: DOMStringMap; + nonce: string; + tabIndex: number; + blur(): void; + focus(options?: FocusOptions): void; +} + interface HTMLOutputElement extends HTMLElement { defaultValue: string; readonly form: HTMLFormElement | null; @@ -7861,7 +7873,6 @@ interface HTMLScriptElement extends HTMLElement { htmlFor: string; integrity: string; noModule: boolean; - nonce: string; referrerPolicy: string; /** * Retrieves the URL to an external file that contains the source code or data. @@ -8047,7 +8058,6 @@ interface HTMLStyleElement extends HTMLElement, LinkStyle { * Sets or retrieves the media type. */ media: string; - nonce: string; /** * Retrieves the CSS language in which the style sheet is written. */ diff --git a/inputfiles/addedTypes.json b/inputfiles/addedTypes.json index 0ecf28e4d..323b537fc 100644 --- a/inputfiles/addedTypes.json +++ b/inputfiles/addedTypes.json @@ -12,6 +12,43 @@ } } }, + "HTMLOrSVGElement": { + "name": "HTMLOrSVGElement", + "properties": { + "property": { + "nonce": { + "name": "nonce", + "type": "DOMString" + }, + "tabIndex": { + "name": "tabIndex", + "type": "long" + }, + "dataset": { + "name": "dataset", + "read-only": 1, + "type": "DOMStringMap" + } + } + }, + "methods": { + "method": { + "blur": { + "name": "blur", + "override-signatures": [ + "blur(): void" + ] + }, + "focus": { + "name": "focus", + "override-signatures": [ + "focus(options?: FocusOptions): void" + ] + } + } + }, + "no-interface-object": "1" + }, "ParentNode": { "name": "ParentNode", "exposed": "Window", @@ -1961,7 +1998,7 @@ }, "element": [ { - + "name": "input" } ] @@ -2112,7 +2149,7 @@ { "name": "caption" } - ] + ] }, "HTMLTableCellElement": { "element": [ @@ -2122,7 +2159,7 @@ { "name": "th" } - ] + ] }, "HTMLTableColElement": { "element": [ @@ -2151,7 +2188,7 @@ { "name": "table" } - ] + ] }, "HTMLTableHeaderCellElement": { "name": "HTMLTableHeaderCellElement", @@ -2176,7 +2213,7 @@ { "name": "tr" } - ] + ] }, "HTMLTableSectionElement": { "element": [ @@ -2327,6 +2364,18 @@ } } }, + "FocusOptions": { + "name": "FocusOptions", + "members": { + "member": { + "preventScoll": { + "name": "preventScoll", + "override-type": "boolean", + "required": 1 + } + } + } + }, "EventInit": { "name": "EventInit", "members": { diff --git a/inputfiles/overridingTypes.json b/inputfiles/overridingTypes.json index 0474c87ca..dd7661e31 100644 --- a/inputfiles/overridingTypes.json +++ b/inputfiles/overridingTypes.json @@ -235,26 +235,6 @@ } } }, - "HTMLScriptElement": { - "properties": { - "property": { - "nonce": { - "name": "nonce", - "type": "DOMString" - } - } - } - }, - "HTMLStyleElement": { - "properties": { - "property": { - "nonce": { - "name": "nonce", - "type": "DOMString" - } - } - } - }, "SourceBuffer": { "specs": "media-source", "name": "SourceBuffer", From 1c8d91b66ce533162629f233a943238521cd7857 Mon Sep 17 00:00:00 2001 From: "mgquan@myseneca.ca" Date: Sat, 16 Jun 2018 19:06:13 -0400 Subject: [PATCH 3/5] added HTMLOrSVGElement to HTMLElement and overrided focus() --- baselines/dom.generated.d.ts | 6 +++--- inputfiles/overridingTypes.json | 13 +++++++++++++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/baselines/dom.generated.d.ts b/baselines/dom.generated.d.ts index 53b5fd77b..e8eeb9837 100644 --- a/baselines/dom.generated.d.ts +++ b/baselines/dom.generated.d.ts @@ -6065,7 +6065,7 @@ declare var HTMLDocument: { new(): HTMLDocument; }; -interface HTMLElementEventMap extends ElementEventMap { +interface HTMLElementEventMap { "abort": UIEvent; "activate": Event; "beforeactivate": Event; @@ -6135,7 +6135,7 @@ interface HTMLElementEventMap extends ElementEventMap { "waiting": Event; } -interface HTMLElement extends Element, ElementCSSInlineStyle { +interface HTMLElement extends Element, HTMLOrSVGElement, ElementCSSInlineStyle { accessKey: string; contentEditable: string; readonly dataset: DOMStringMap; @@ -6225,7 +6225,7 @@ interface HTMLElement extends Element, ElementCSSInlineStyle { blur(): void; click(): void; dragDrop(): boolean; - focus(): void; + focus(options?: FocusOptions): void; msGetInputContext(): MSInputMethodContext; addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; diff --git a/inputfiles/overridingTypes.json b/inputfiles/overridingTypes.json index dd7661e31..f1a1ef864 100644 --- a/inputfiles/overridingTypes.json +++ b/inputfiles/overridingTypes.json @@ -897,6 +897,19 @@ } } }, + "HTMLElement": { + "extends": "Element, HTMLOrSVGElement", + "methods": { + "method": { + "focus": { + "name": "focus", + "override-signatures": [ + "focus(options?: FocusOptions): void" + ] + } + } + } + }, "SVGElement": { "name": "SVGElement", "properties": { From da4f8ce18ab7652874f7bc4007ea24a20a2e8199 Mon Sep 17 00:00:00 2001 From: "mgquan@myseneca.ca" Date: Sun, 17 Jun 2018 22:09:34 -0400 Subject: [PATCH 4/5] moved FocusOptions to idlSources.json --- baselines/dom.generated.d.ts | 12 +++++++++--- inputfiles/addedTypes.json | 12 ------------ .../idl/HTML - User interaction.commentmap.json | 11 +++++++++++ inputfiles/idl/HTML - User interaction.widl | 9 +++++++++ inputfiles/idlSources.json | 4 ++++ inputfiles/overridingTypes.json | 1 - 6 files changed, 33 insertions(+), 16 deletions(-) create mode 100644 inputfiles/idl/HTML - User interaction.commentmap.json create mode 100644 inputfiles/idl/HTML - User interaction.widl diff --git a/baselines/dom.generated.d.ts b/baselines/dom.generated.d.ts index e8eeb9837..c50582b88 100644 --- a/baselines/dom.generated.d.ts +++ b/baselines/dom.generated.d.ts @@ -465,7 +465,7 @@ interface FocusNavigationOrigin { } interface FocusOptions { - preventScoll: boolean; + preventScroll?: boolean; } interface GainOptions extends AudioNodeOptions { @@ -5166,6 +5166,12 @@ interface ElementCSSInlineStyle { readonly style: CSSStyleDeclaration; } +interface ElementContentEditable { + contentEditable: string; + inputMode: string; + readonly isContentEditable: boolean; +} + interface ElementCreationOptions { is?: string; } @@ -6065,7 +6071,7 @@ declare var HTMLDocument: { new(): HTMLDocument; }; -interface HTMLElementEventMap { +interface HTMLElementEventMap extends ElementEventMap { "abort": UIEvent; "activate": Event; "beforeactivate": Event; @@ -6135,7 +6141,7 @@ interface HTMLElementEventMap { "waiting": Event; } -interface HTMLElement extends Element, HTMLOrSVGElement, ElementCSSInlineStyle { +interface HTMLElement extends Element, ElementCSSInlineStyle { accessKey: string; contentEditable: string; readonly dataset: DOMStringMap; diff --git a/inputfiles/addedTypes.json b/inputfiles/addedTypes.json index 323b537fc..b079d76b6 100644 --- a/inputfiles/addedTypes.json +++ b/inputfiles/addedTypes.json @@ -2364,18 +2364,6 @@ } } }, - "FocusOptions": { - "name": "FocusOptions", - "members": { - "member": { - "preventScoll": { - "name": "preventScoll", - "override-type": "boolean", - "required": 1 - } - } - } - }, "EventInit": { "name": "EventInit", "members": { diff --git a/inputfiles/idl/HTML - User interaction.commentmap.json b/inputfiles/idl/HTML - User interaction.commentmap.json new file mode 100644 index 000000000..b54f30e06 --- /dev/null +++ b/inputfiles/idl/HTML - User interaction.commentmap.json @@ -0,0 +1,11 @@ +{ + "click": "Acts as if the element was clicked.", + "document-hasfocus": "Returns true if key events are being routed through or to the document; otherwise, returns\nfalse. Roughly speaking, this corresponds to the document, or a document nested inside this\none, being focused.", + "window-focus": "Moves the focus to the window's browsing context, if any.", + "focus": "Moves the focus to the element.\nIf the element is a browsing context container, moves the focus to the\nnested browsing context instead.\nBy default, this method also scrolls the element into view. Providing the preventScroll option and setting it to true\nprevents this behavior.", + "blur": "Moves the focus to the viewport. Use of this method is discouraged; if you want\nto focus the viewport, call the focus() method on\nthe Document's document element.\nDo not use this method to hide the focus ring if you find the focus ring unsightly. Instead,\nuse a CSS rule to override the 'outline' property, and provide a different way to\nshow what element is focused. Be aware that if an alternative focusing style isn't made\navailable, the page will be significantly less usable for people who primarily navigate pages\nusing a keyboard, or those with reduced vision who use focus outlines to help them navigate the\npage.\nFor example, to hide the outline from links and instead use a yellow background to indicate\nfocus, you could use:\n:link:focus, :visited:focus { outline: none; background: yellow; color: black; }", + "contenteditable": "Returns \"true\", \"false\", or \"inherit\", based on the state of the contenteditable attribute.\nCan be set, to change that state.\nThrows a \"SyntaxError\" DOMException if the new value\nisn't one of those strings.", + "iscontenteditable": "Returns true if the element is editable; otherwise, returns false.", + "spellcheck": "Returns true if the element is to have its spelling and grammar checked; otherwise, returns\nfalse.\nCan be set, to override the default and set the spellcheck content attribute.", + "autocapitalize": "Returns the current autocapitalization state for the element, or an empty string if it hasn't\nbeen set. Note that for input and textarea elements that inherit their\nstate from a form element, this will return the autocapitalization state of the\nform element, but for an element in an editable region, this will not return the\nautocapitalization state of the editing host (unless this element is, in fact, the editing\nhost).\nCan be set, to set the autocapitalize content\nattribute (and thereby change the autocapitalization behavior for the element)." +} diff --git a/inputfiles/idl/HTML - User interaction.widl b/inputfiles/idl/HTML - User interaction.widl new file mode 100644 index 000000000..0cc15d77a --- /dev/null +++ b/inputfiles/idl/HTML - User interaction.widl @@ -0,0 +1,9 @@ +dictionary FocusOptions { + boolean preventScroll = false; +}; + +interface mixin ElementContentEditable { + [CEReactions] attribute DOMString contentEditable; + readonly attribute boolean isContentEditable; + [CEReactions] attribute DOMString inputMode; +}; diff --git a/inputfiles/idlSources.json b/inputfiles/idlSources.json index 96c146c7a..3b9e97eab 100644 --- a/inputfiles/idlSources.json +++ b/inputfiles/idlSources.json @@ -113,6 +113,10 @@ "url": "https://html.spec.whatwg.org/multipage/webstorage.html", "title": "HTML - Web storage" }, + { + "url": "https://html.spec.whatwg.org/multipage/interaction.html", + "title": "HTML - User interaction" + }, { "url": "https://www.w3.org/TR/IndexedDB-2/", "title": "Indexed Database" diff --git a/inputfiles/overridingTypes.json b/inputfiles/overridingTypes.json index f1a1ef864..04b8639b1 100644 --- a/inputfiles/overridingTypes.json +++ b/inputfiles/overridingTypes.json @@ -898,7 +898,6 @@ } }, "HTMLElement": { - "extends": "Element, HTMLOrSVGElement", "methods": { "method": { "focus": { From 81fa7cbf6d48f138f623df857de40f93dabfa9ec Mon Sep 17 00:00:00 2001 From: "mgquan@myseneca.ca" Date: Mon, 18 Jun 2018 20:10:14 -0400 Subject: [PATCH 5/5] implemented HTMLOrSvgElement --- baselines/dom.generated.d.ts | 2 +- inputfiles/overridingTypes.json | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/baselines/dom.generated.d.ts b/baselines/dom.generated.d.ts index c50582b88..f51db41f5 100644 --- a/baselines/dom.generated.d.ts +++ b/baselines/dom.generated.d.ts @@ -6141,7 +6141,7 @@ interface HTMLElementEventMap extends ElementEventMap { "waiting": Event; } -interface HTMLElement extends Element, ElementCSSInlineStyle { +interface HTMLElement extends Element, ElementCSSInlineStyle, HTMLOrSVGElement { accessKey: string; contentEditable: string; readonly dataset: DOMStringMap; diff --git a/inputfiles/overridingTypes.json b/inputfiles/overridingTypes.json index 04b8639b1..b3b6de778 100644 --- a/inputfiles/overridingTypes.json +++ b/inputfiles/overridingTypes.json @@ -898,6 +898,7 @@ } }, "HTMLElement": { + "implements": ["HTMLOrSVGElement"], "methods": { "method": { "focus": {