Skip to content

Commit 0f4a1bd

Browse files
authored
Add HTMLElement-returning getElementById to DocumentFragment (#1071)
This is copying what `document.getElementById` and `document.body.ownerDocument` currently looks like. Regressed by b598925.
1 parent 2daa986 commit 0f4a1bd

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
@@ -4724,6 +4724,8 @@ interface DocumentAndElementEventHandlers {
47244724

47254725
/** 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. */
47264726
interface DocumentFragment extends Node, NonElementParentNode, ParentNode {
4727+
readonly ownerDocument: Document;
4728+
getElementById(elementId: string): HTMLElement | null;
47274729
}
47284730

47294731
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)