Re: [cssom-view][css-ui] elementsFromPoint() and pointer-events:paint-order

On Thu, Jun 13, 2013 at 3:18 PM, Alan Stearns <stearns@adobe.com> wrote:
> We've discussed adding an elementsFromPoint() method in the recent past
> [1] and it's relevant to the topic I brought up in Tokyo last week about
> event handling in fragment containers.
>
> There are several related use-cases:
>
> 1. Connecting a fragment container with a user event [2]
> 2. Finding a not-topmost element under the cursor
> 3. Avoiding hover-at-a-distance for positioned children
>
> I suggest adding an elementsFromPoint() method to cssom-view that returns
> all the elements under a particular point sorted in paint order (top to
> bottom). People use various hacks for this today (removing topmost
> elements or setting pointer-events:none on them to reveal the elements
> underneath, then restoring the stack) that could be avoided by using this
> new method.
>
> Then I suggest adding a new value to the pointer-events property (in
> whatever level of css-ui it lands) with a provisional name of paint-order.
> If the target of a user event has a computed value of 'paint-order' for
> the pointer-events property, then user events (including CSS hover
> styling) would bubble through the same stack of elements returned by
> elementsFromPoint(). This would give us a true hover for positioned
> elements painted outside their parent's box, and allow fragment containers
> to respond to user events on their fragment content.

Thanks for bringing this up, Alan.  This is what was provisionally
decided on at the face-to-face, and it would be great to get more
implementor feedback on it.

+1, by the way.

~TJ

Received on Thursday, 13 June 2013 22:23:44 UTC