- From: zac-semolina-solutions via GitHub <sysbot+gh@w3.org>
- Date: Wed, 21 Aug 2024 10:21:13 +0000
- To: public-css-archive@w3.org
I recently found myself needing to write an engine-independent `DocumentOrShadowRoot.elementsFromPoint()` method. See https://github.com/semolina-solutions/layer-aware-pointer-events/blob/211c8c1c983f641e45e374f0d56040670ccd869e/lib/index.ts#L223. While I'm naive to the internal implementation details in each engine, I found that Gecko's `elementsFromPoint()` output differs in two ways at the time of writing: 1. Gecko will return elements only within that DOM, rather from the `html` element. 2. When an element with `pointer-events: none` styling is queried from its Shadow DOM in Gecko, it will always be included in the resulting list, despite itself not being a potential event target. Whether or not elements in open shadow DOMs should be included in higher-level `elementsFromPoint()` calls is somewhat arbitrary IMO, although including them would avoid needing to repeatedly and expensively query from each shadow root to build up the full picture. It'd be advantageous to have a `deep = true` setting to pierce through all open shadow DOMs below. It'd be nice however to address difference no. 2, i.e. the inconsistency of a shadow root host element being included in the `ShadowRoot.elementsFromPoint()` when it's styled to ignore pointer events. It's good that it's included queries of higher-level DOMs, because it indicates that "there's _something_ in this shadow DOM that is reactive to pointer events". -- GitHub Notification of comment by zac-semolina-solutions Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/556#issuecomment-2301694648 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Wednesday, 21 August 2024 10:21:14 UTC