Skip to content

Commit d42f963

Browse files
authored
Move element[s]FromPoint to DocumentOrShadowRoot (#1123)
* Remove redundant Text#assignedSlot Slottable already defines it. * Move element[s]FromPoint to DocumentOrShadowRoot
1 parent 93a9848 commit d42f963

File tree

4 files changed

+44
-26
lines changed

4 files changed

+44
-26
lines changed

baselines/dom.generated.d.ts

+7-8
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

@@ -13348,7 +13348,6 @@ declare var SubtleCrypto: {
1334813348

1334913349
/** The textual content of Element or Attr. If an element has no markup within its content, it has a single child implementing Text that contains the element's text. However, if the element contains markup, it is parsed into information items and Text nodes that form its children. */
1335013350
interface Text extends CharacterData, Slottable {
13351-
readonly assignedSlot: HTMLSlotElement | null;
1335213351
/** Returns the combined data of all direct Text node siblings. */
1335313352
readonly wholeText: string;
1335413353
/** Splits data at the given offset and returns the remainder as Text node. */

inputfiles/addedTypes.jsonc

+22-15
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,26 @@
2929
]
3030
}
3131
},
32+
"DocumentOrShadowRoot": {
33+
// Manually moved from Document
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": [
@@ -581,8 +601,7 @@
581601
]
582602
}
583603
}
584-
},
585-
604+
}
586605
},
587606
"EventListenerObject": {
588607
"name": "EventListenerObject",
@@ -595,7 +614,7 @@
595614
]
596615
}
597616
}
598-
},
617+
}
599618
},
600619
"Document": {
601620
"methods": {
@@ -748,18 +767,6 @@
748767
]
749768
}
750769
},
751-
"Text": {
752-
"name": "Text",
753-
"properties": {
754-
"property": {
755-
"assignedSlot": {
756-
"name": "assignedSlot",
757-
"readonly": true,
758-
"overrideType": "HTMLSlotElement | null"
759-
}
760-
}
761-
}
762-
},
763770
"TextTrackList": {
764771
"events": {
765772
"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)