Skip to content

Commit eaccd6e

Browse files
committed
Add HTMLElement-returning getElementById to DocumentFragment
This is copying what `document.getElementById` and `document.body.ownerDocument` currently looks like. Regressed by b598925.
1 parent ca77744 commit eaccd6e

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

baselines/dom.generated.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4694,6 +4694,8 @@ interface DocumentAndElementEventHandlers {
46944694

46954695
/** 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. */
46964696
interface DocumentFragment extends Node, NonElementParentNode, ParentNode {
4697+
readonly ownerDocument: Document;
4698+
getElementById(elementId: string): HTMLElement | null;
46974699
}
46984700

46994701
declare var DocumentFragment: {

inputfiles/overridingTypes.jsonc

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -655,6 +655,27 @@
655655
}
656656
}
657657
},
658+
"DocumentFragment": {
659+
"methods": {
660+
"method": {
661+
"getElementById": {
662+
"name": "getElementById",
663+
"overrideSignatures": [
664+
"getElementById(elementId: string): HTMLElement | null"
665+
]
666+
}
667+
}
668+
},
669+
"properties": {
670+
"property": {
671+
"ownerDocument": {
672+
"name": "ownerDocument",
673+
"readonly": 1,
674+
"type": "Document"
675+
}
676+
}
677+
}
678+
},
658679
"Node": {
659680
"name": "Node",
660681
"methods": {

0 commit comments

Comments
 (0)