Skip to content

Add HTMLElement-returning getElementById to DocumentFragment #1071

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 1 commit into from
Jul 17, 2021
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
2 changes: 2 additions & 0 deletions baselines/dom.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4694,6 +4694,8 @@ interface DocumentAndElementEventHandlers {

/** A minimal document object that has no parent. It is used as a lightweight version of Document that stores a segment of a document structure comprised of nodes just like a standard document. The key difference is that because the document fragment isn't part of the active document tree structure, changes made to the fragment don't affect the document, cause reflow, or incur any performance impact that can occur when changes are made. */
interface DocumentFragment extends Node, NonElementParentNode, ParentNode {
readonly ownerDocument: Document;
getElementById(elementId: string): HTMLElement | null;
}

declare var DocumentFragment: {
Expand Down
21 changes: 21 additions & 0 deletions inputfiles/overridingTypes.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,27 @@
}
}
},
"DocumentFragment": {
"methods": {
"method": {
"getElementById": {
"name": "getElementById",
"overrideSignatures": [
"getElementById(elementId: string): HTMLElement | null"
]
}
}
},
"properties": {
"property": {
"ownerDocument": {
"name": "ownerDocument",
"readonly": 1,
"type": "Document"
}
}
}
},
"Node": {
"name": "Node",
"methods": {
Expand Down