Skip to content

Move element[s]FromPoint to DocumentOrShadowRoot #1123

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions baselines/dom.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4394,13 +4394,6 @@ interface Document extends Node, DocumentAndElementEventHandlers, DocumentOrShad
* @param filter A custom NodeFilter function to use.
*/
createTreeWalker(root: Node, whatToShow?: number, filter?: NodeFilter | null): TreeWalker;
/**
* Returns the element for the specified x coordinate and the specified y coordinate.
* @param x The x-offset
* @param y The y-offset
*/
elementFromPoint(x: number, y: number): Element | null;
elementsFromPoint(x: number, y: number): Element[];
/**
* Executes a command on the current document, current selection, or the given range.
* @param commandId String that specifies the command to execute. This command can be any of the command identifiers that can be executed in script.
Expand Down Expand Up @@ -4558,6 +4551,13 @@ interface DocumentOrShadowRoot {
readonly pointerLockElement: Element | null;
/** Retrieves a collection of styleSheet objects representing the style sheets that correspond to each instance of a link or style object in the document. */
readonly styleSheets: StyleSheetList;
/**
* Returns the element for the specified x coordinate and the specified y coordinate.
* @param x The x-offset
* @param y The y-offset
*/
elementFromPoint(x: number, y: number): Element | null;
elementsFromPoint(x: number, y: number): Element[];
getAnimations(): Animation[];
}

Expand Down Expand Up @@ -13348,7 +13348,6 @@ declare var SubtleCrypto: {

/** 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. */
interface Text extends CharacterData, Slottable {
readonly assignedSlot: HTMLSlotElement | null;
/** Returns the combined data of all direct Text node siblings. */
readonly wholeText: string;
/** Splits data at the given offset and returns the remainder as Text node. */
Expand Down
37 changes: 22 additions & 15 deletions inputfiles/addedTypes.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,26 @@
]
}
},
"DocumentOrShadowRoot": {
// Manually moved from Document
// See https://github.com/w3c/csswg-drafts/issues/5886 and https://github.com/w3c/csswg-drafts/issues/556
"methods": {
"method": {
"elementFromPoint": {
"name": "elementFromPoint",
"overrideSignatures": [
"elementFromPoint(x: number, y: number): Element | null"
]
},
"elementsFromPoint": {
"name": "elementsFromPoint",
"overrideSignatures": [
"elementsFromPoint(x: number, y: number): Element[]"
]
}
}
}
},
"GlobalEventHandlers": {
"events": {
"event": [
Expand Down Expand Up @@ -581,8 +601,7 @@
]
}
}
},

}
},
"EventListenerObject": {
"name": "EventListenerObject",
Expand All @@ -595,7 +614,7 @@
]
}
}
},
}
},
"Document": {
"methods": {
Expand Down Expand Up @@ -748,18 +767,6 @@
]
}
},
"Text": {
"name": "Text",
"properties": {
"property": {
"assignedSlot": {
"name": "assignedSlot",
"readonly": true,
"overrideType": "HTMLSlotElement | null"
}
}
}
},
"TextTrackList": {
"events": {
"event": [
Expand Down
10 changes: 7 additions & 3 deletions inputfiles/comments.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
"mixins": {
"mixin": {
"DocumentOrShadowRoot": {
"methods": {
"method": {
"elementFromPoint": {
"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"
}
}
},
"properties": {
"property": {
"styleSheets": {
Expand Down Expand Up @@ -752,9 +759,6 @@
"execCommand": {
"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."
},
"elementFromPoint": {
"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"
},
"write": {
"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."
},
Expand Down
8 changes: 8 additions & 0 deletions inputfiles/removedTypes.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,14 @@
}
},
"Document": {
"methods": {
"method": {
// Manually moved to DocumentOrShadowRoot
// See https://github.com/w3c/csswg-drafts/issues/5886 and https://github.com/w3c/csswg-drafts/issues/556
"elementFromPoint": null,
"elementsFromPoint": null
}
},
"implements": ["GeometryUtils"]
},
"Element": {
Expand Down