Skip to content

Fixed #242025 - Added nonce #503

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 5 commits into from
Jun 19, 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
22 changes: 20 additions & 2 deletions baselines/dom.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,10 @@ interface FocusNavigationOrigin {
originWidth?: number;
}

interface FocusOptions {
preventScroll?: boolean;
}

interface GainOptions extends AudioNodeOptions {
gain?: number;
}
Expand Down Expand Up @@ -5162,6 +5166,12 @@ interface ElementCSSInlineStyle {
readonly style: CSSStyleDeclaration;
}

interface ElementContentEditable {
contentEditable: string;
inputMode: string;
readonly isContentEditable: boolean;
}

interface ElementCreationOptions {
is?: string;
}
Expand Down Expand Up @@ -6131,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;
Expand Down Expand Up @@ -6221,7 +6231,7 @@ interface HTMLElement extends Element, ElementCSSInlineStyle {
blur(): void;
click(): void;
dragDrop(): boolean;
focus(): void;
focus(options?: FocusOptions): void;
msGetInputContext(): MSInputMethodContext;
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
Expand Down Expand Up @@ -7695,6 +7705,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;
Expand Down
47 changes: 42 additions & 5 deletions inputfiles/addedTypes.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -1961,7 +1998,7 @@
},
"element": [
{

"name": "input"
}
]
Expand Down Expand Up @@ -2112,7 +2149,7 @@
{
"name": "caption"
}
]
]
},
"HTMLTableCellElement": {
"element": [
Expand All @@ -2122,7 +2159,7 @@
{
"name": "th"
}
]
]
},
"HTMLTableColElement": {
"element": [
Expand Down Expand Up @@ -2151,7 +2188,7 @@
{
"name": "table"
}
]
]
},
"HTMLTableHeaderCellElement": {
"name": "HTMLTableHeaderCellElement",
Expand All @@ -2176,7 +2213,7 @@
{
"name": "tr"
}
]
]
},
"HTMLTableSectionElement": {
"element": [
Expand Down
11 changes: 11 additions & 0 deletions inputfiles/idl/HTML - User interaction.commentmap.json
Original file line number Diff line number Diff line change
@@ -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)."
}
9 changes: 9 additions & 0 deletions inputfiles/idl/HTML - User interaction.widl
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
dictionary FocusOptions {
boolean preventScroll = false;
};

interface mixin ElementContentEditable {
[CEReactions] attribute DOMString contentEditable;
readonly attribute boolean isContentEditable;
[CEReactions] attribute DOMString inputMode;
};
4 changes: 4 additions & 0 deletions inputfiles/idlSources.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
13 changes: 13 additions & 0 deletions inputfiles/overridingTypes.json
Original file line number Diff line number Diff line change
Expand Up @@ -897,6 +897,19 @@
}
}
},
"HTMLElement": {
"implements": ["HTMLOrSVGElement"],
"methods": {
"method": {
"focus": {
"name": "focus",
"override-signatures": [
"focus(options?: FocusOptions): void"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so why is this needed?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

]
}
}
}
},
"SVGElement": {
"name": "SVGElement",
"properties": {
Expand Down