Re: [csswg-drafts] [cssom-view] elementFromPoint, elementsFromPoint, and caretPositionFromPoint should not return an element inside a shadow tree

So the "option to include `display: contents`" would, I guess, run the algorithm normally, then *also* run a display:contents seeker, and return whichever is closer to the starting fragment in flat-tree order?

The display:contents seeker would be something like:

1. Let |frag| be the top-most fragment at |point| that responds to pointer events.
2. Walk |frag|’s inclusive ancestors in the fragment tree until you find a fragment generated by a box-tree node that was generated by a DOM text node or DOM element node. Let |DOM node| be that DOM text node or DOM element node.
4. If |DOM node| is not an element, set |DOM node| to the first of its ancestors that is an element.
5. Return |DOM node|.

Then `nodeFromPoint()` would be the same algorithm, just without step 4.

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

Received on Monday, 29 October 2018 18:51:14 UTC