Skip to content

Commit 3a14e08

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 3a14e08

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

baselines/dom.generated.d.ts

+2
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+
ownerDocument: Document;
4698+
getElementById(elementId: string): HTMLElement | null;
46974699
}
46984700

46994701
declare var DocumentFragment: {

inputfiles/overridingTypes.jsonc

+21
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+
"read-only": 1,
674+
"type": "Document"
675+
}
676+
}
677+
}
678+
},
658679
"Node": {
659680
"name": "Node",
660681
"methods": {

0 commit comments

Comments
 (0)