Skip to content
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

[cssom-view] ShadowRoot should also have elementFromPoint and elementsFromPoint #5886

Open
foolip opened this issue Jan 22, 2021 · 4 comments

Comments

@foolip
Copy link
Member

foolip commented Jan 22, 2021

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.

cc @annevk @mfreed7 @rniwa

@annevk
Copy link
Member

annevk commented Jan 22, 2021

See #556 (comment) onward.

@Haprog
Copy link

Haprog commented Dec 13, 2021

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.

@rniwa
Copy link

rniwa commented Sep 14, 2023

We should also add caretPositionFromPoint to ShadowRoot as well.

@sanketj
Copy link
Member

sanketj commented Sep 5, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants