Description
I recently asked on Mastodon if folks knew the element(s)FromPoint()
methods and whether they'd want them to be able to traverse shadow roots: https://mas.to/@patrickbrosset/113236606097090887
Some replies to my "Do you wish it would across Shadow DOM boundaries "question:
In my use case, whether I want it to cross Shadow DOM boundaries would depend on how "thick" the custom elements are. If thin, I wouldn't care. If they encompassed too much in the page, then yeah I'd want a more fine-grained approach.
YES
ABSOLUTELY YES
I'm not sure whether it should cross shadow boundaries on its own. I could maybe see an option, so you had to do work to get through, but didn't need to write your own recursive method.
I think I’d want to be explicit about getting any element from within a shadow root, so maybe if there was an option to include shadow roots.
Absolutely yes! Eventually, it could be a parameter option, like
document.elementsFromPoint({ composed: true })
or similar.
Note that caretPositionFromPoint
already works this way: https://developer.mozilla.org/en-US/docs/Web/API/Document/caretPositionFromPoint#shadowroots
Also, during the TAG review for caretPositionFromPoint
@LeaVerou said (w3ctag/design-reviews#949 (comment)):
I would reiterate that elementFromPoint() could also be expanded in the same way for consistency (and I suspect there are plenty of use cases for that too).
Metadata
Metadata
Assignees
Type
Projects
Status