Re: [csswg-drafts] [cssom-view] elementFromPoint and elementsFromPoint interop issues (#12907)

I think the recent resolution in #556 is relevant here.

Those APIs are now specified in terms of DOM retargeting, rather than simply exposing the raw hit-test result directly.

Because of that, I don't think `display: contents` can be viewed purely as “this element has no box, so it must be skipped”.

In particular, when hit testing lands on a text node / text sequence whose nearest element ancestor is a display: contents element, there seem to be multiple reasonable interpretations:

- skip the `display: contents` element and continue climbing to the nearest ancestor with a box (e.g. `body`)
- map the hit-tested text node to its nearest exposed `Element`, even if that element itself does not generate a box

I also agree that should remain `true`.
```js
document.elementsFromPoint(x, y).includes(document.elementFromPoint(x, y))
```



-- 
GitHub Notification of comment by zp1996
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/12907#issuecomment-4412481704 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Saturday, 9 May 2026 12:08:10 UTC