Skip to content

Commit db0deea

Browse files
committed
Move element[s]FromPoint to DocumentOrShadowRoot
1 parent 30465db commit db0deea

File tree

4 files changed

+42
-10
lines changed

4 files changed

+42
-10
lines changed

baselines/dom.generated.d.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -4394,13 +4394,6 @@ interface Document extends Node, DocumentAndElementEventHandlers, DocumentOrShad
43944394
* @param filter A custom NodeFilter function to use.
43954395
*/
43964396
createTreeWalker(root: Node, whatToShow?: number, filter?: NodeFilter | null): TreeWalker;
4397-
/**
4398-
* Returns the element for the specified x coordinate and the specified y coordinate.
4399-
* @param x The x-offset
4400-
* @param y The y-offset
4401-
*/
4402-
elementFromPoint(x: number, y: number): Element | null;
4403-
elementsFromPoint(x: number, y: number): Element[];
44044397
/**
44054398
* Executes a command on the current document, current selection, or the given range.
44064399
* @param commandId String that specifies the command to execute. This command can be any of the command identifiers that can be executed in script.
@@ -4558,6 +4551,13 @@ interface DocumentOrShadowRoot {
45584551
readonly pointerLockElement: Element | null;
45594552
/** Retrieves a collection of styleSheet objects representing the style sheets that correspond to each instance of a link or style object in the document. */
45604553
readonly styleSheets: StyleSheetList;
4554+
/**
4555+
* Returns the element for the specified x coordinate and the specified y coordinate.
4556+
* @param x The x-offset
4557+
* @param y The y-offset
4558+
*/
4559+
elementFromPoint(x: number, y: number): Element | null;
4560+
elementsFromPoint(x: number, y: number): Element[];
45614561
getAnimations(): Animation[];
45624562
}
45634563

inputfiles/addedTypes.jsonc

+20
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,26 @@
2929
]
3030
}
3131
},
32+
"DocumentOrShadowRoot": {
33+
// Manually moved from DocumentOrShadowRoot
34+
// See https://github.com/w3c/csswg-drafts/issues/5886 and https://github.com/w3c/csswg-drafts/issues/556
35+
"methods": {
36+
"method": {
37+
"elementFromPoint": {
38+
"name": "elementFromPoint",
39+
"overrideSignatures": [
40+
"elementFromPoint(x: number, y: number): Element | null"
41+
]
42+
},
43+
"elementsFromPoint": {
44+
"name": "elementsFromPoint",
45+
"overrideSignatures": [
46+
"elementsFromPoint(x: number, y: number): Element[]"
47+
]
48+
}
49+
}
50+
}
51+
},
3252
"GlobalEventHandlers": {
3353
"events": {
3454
"event": [

inputfiles/comments.json

+7-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22
"mixins": {
33
"mixin": {
44
"DocumentOrShadowRoot": {
5+
"methods": {
6+
"method": {
7+
"elementFromPoint": {
8+
"comment": "Returns the element for the specified x coordinate and the specified y coordinate.\n@param x The x-offset\n@param y The y-offset"
9+
}
10+
}
11+
},
512
"properties": {
613
"property": {
714
"styleSheets": {
@@ -752,9 +759,6 @@
752759
"execCommand": {
753760
"comment": "Executes a command on the current document, current selection, or the given range.\n@param commandId String that specifies the command to execute. This command can be any of the command identifiers that can be executed in script.\n@param showUI Display the user interface, defaults to false.\n@param value Value to assign."
754761
},
755-
"elementFromPoint": {
756-
"comment": "Returns the element for the specified x coordinate and the specified y coordinate.\n@param x The x-offset\n@param y The y-offset"
757-
},
758762
"write": {
759763
"comment": "Writes one or more HTML expressions to a document in the specified window.\n@param content Specifies the text and HTML tags to write."
760764
},

inputfiles/removedTypes.jsonc

+8
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,14 @@
6464
}
6565
},
6666
"Document": {
67+
"methods": {
68+
"method": {
69+
// Manually moved to DocumentOrShadowRoot
70+
// See https://github.com/w3c/csswg-drafts/issues/5886 and https://github.com/w3c/csswg-drafts/issues/556
71+
"elementFromPoint": null,
72+
"elementsFromPoint": null
73+
}
74+
},
6775
"implements": ["GeometryUtils"]
6876
},
6977
"Element": {

0 commit comments

Comments
 (0)