[cssom-view] ShadowRoot should also have elementFromPoint and elementsFromPoint
foolip opened this issue · 5 comments
https://drafts.csswg.org/cssom-view/#extensions-to-the-document-interface defines elementFromPoint and elementsFromPoint methods on Document, but Chromium, Gecko and WebKit all have these members in the DocumentOrShadowRoot mixin:
https://chromium.googlesource.com/chromium/src/+/5aded22f34131a7d136f7fff2b6b28b8387ad961/third_party/blink/renderer/core/dom/document_or_shadow_root.idl
https://hg.mozilla.org/mozilla-central/file/a2507ffc9d4db5109a491d91f4c4c1e5a8dd0e2e/dom/webidl/DocumentOrShadowRoot.webidl
https://trac.webkit.org/browser/webkit/trunk/Source/WebCore/dom/DocumentOrShadowRoot.idl?rev=271743
The net effect is that they're on ShadowRoot, not just Document, but that no spec seems to capture this.
See #556 (comment) onward.
The Shadow DOM spec used to declare that DocumentOrShadowRoot is extended with elementFromPoint and elementsFromPoint. Here's the latest web archive snapshot that still says so: https://web.archive.org/web/20180228173001/http://www.w3.org/TR/shadow-dom/
It seems that was since changed to a short page that basically just says:
Shadow DOM specification is being incorporated into to the DOM specification, HTML specification, CSS Scoping Module Level 1, UI Events specification, and other relevant specifications.
I guess that was related to WICG/webcomponents#661 but I'm also very confused by where did that definition go.
The only current spec mentioning elementFromPoint and elementsFromPoint that I could find now is the CSSOM View Module draft that specifies them on the Document only.
We should also add caretPositionFromPoint to ShadowRoot as well.
Supporting shadow DOM content in elementFromPoint/elementsFromPoint came up again during the TAG review for caretPositionFromPoint: w3ctag/design-reviews#949. In terms of API consistency, updating elementFromPoint/elementsFromPoint makes total sense. Do we have any signals about developers wanting this?
Supporting shadow DOM content in
elementFromPoint/elementsFromPointcame up again during the TAG review forcaretPositionFromPoint: w3ctag/design-reviews#949. In terms of API consistency, updatingelementFromPoint/elementsFromPointmakes total sense. Do we have any signals about developers wanting this?
Filed #10992 to cover this.