Skip to content

Add ShadowRoot global object #603

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
Jan 24, 2019
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
15 changes: 10 additions & 5 deletions baselines/dom.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1452,6 +1452,11 @@ interface ServiceWorkerMessageEventInit extends EventInit {
source?: ServiceWorker | MessagePort | null;
}

interface ShadowRootInit {
delegatesFocus?: boolean;
mode: ShadowRootMode;
}

interface StereoPannerOptions extends AudioNodeOptions {
pan?: number;
}
Expand Down Expand Up @@ -4858,7 +4863,7 @@ interface Element extends Node, ParentNode, NonDocumentTypeChildNode, ChildNode,
/**
* Creates a shadow root for element and returns it.
*/
attachShadow(shadowRootInitDict: ShadowRootInit): ShadowRoot;
attachShadow(init: ShadowRootInit): ShadowRoot;
/**
* Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise.
*/
Expand Down Expand Up @@ -14599,10 +14604,10 @@ interface ShadowRoot extends DocumentFragment, DocumentOrShadowRoot {
readonly mode: ShadowRootMode;
}

interface ShadowRootInit {
delegatesFocus?: boolean;
mode: "open" | "closed";
}
declare var ShadowRoot: {
prototype: ShadowRoot;
new(): ShadowRoot;
};

interface Slotable {
readonly assignedSlot: HTMLSlotElement | null;
Expand Down
51 changes: 12 additions & 39 deletions inputfiles/addedTypes.json
Original file line number Diff line number Diff line change
Expand Up @@ -693,12 +693,6 @@
"override-signatures": [
"insertAdjacentText(where: InsertPosition, text: string): void"
]
},
"attachShadow": {
"name": "attachShadow",
"override-signatures": [
"attachShadow(shadowRootInitDict: ShadowRootInit): ShadowRoot"
]
}
}
},
Expand All @@ -712,11 +706,6 @@
"slot": {
"name": "slot",
"override-type": "string"
},
"shadowRoot": {
"name": "shadowRoot",
"read-only": 1,
"override-type": "ShadowRoot | null"
}
}
}
Expand Down Expand Up @@ -1081,40 +1070,14 @@
},
"ShadowRoot": {
"name": "ShadowRoot",
"extends": "DocumentFragment",
"exposed": "Window",
"properties": {
"property": {
"host": {
"name": "host",
"read-only": 1,
"override-type": "Element"
},
"innerHTML": {
"name": "innerHTML",
"override-type": "string"
}
}
},
"no-interface-object": "1"
},
"ShadowRootInit": {
"name": "ShadowRootInit",
"exposed": "Window",
"properties": {
"property": {
"mode": {
"name": "mode",
"override-type": "\"open\" | \"closed\""
},
"delegatesFocus": {
"name": "delegatesFocus",
"override-type": "boolean",
"required": 0
"type": "DOMString"
}
}
},
"no-interface-object": "1"
}
},
"SpeechRecognition": {
"events": {
Expand Down Expand Up @@ -2052,6 +2015,16 @@
}
}
},
"ShadowRootInit": {
"members": {
"member": {
"delegatesFocus": {
"name": "delegatesFocus",
"type": "boolean"
}
}
}
},
"WorkerOptions": {
"name": "WorkerOptions",
"members": {
Expand Down