W3C home > Mailing lists > Public > www-style@w3.org > June 2013

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

From: Alan Stearns <stearns@adobe.com>
Date: Thu, 13 Jun 2013 06:18:31 -0700
To: W3C WWW Style <www-style@w3.org>
Message-ID: <CDDE6A58.2BEFC%stearns@adobe.com>
Hey all,

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,

Alan

[1] http://lists.w3.org/Archives/Public/www-style/2012Oct/0808.html
[2] http://wiki.csswg.org/spec/css3-regions/user-event-handling
Received on Thursday, 13 June 2013 13:18:56 UTC

This archive was generated by hypermail 2.3.1 : Thursday, 13 June 2013 13:18:56 UTC