W3C home > Mailing lists > Public > public-pointer-events@w3.org > January to March 2013

Mapping for devices that don't support hover and CSS :hover

From: Rick Byers <rbyers@google.com>
Date: Wed, 23 Jan 2013 11:02:35 -0500
Message-ID: <CAFUtAY8SEew9dnHO2SGRsuWb3f3qyAMk4rcjBHFVMXGD2639tg@mail.gmail.com>
To: public-pointer-events@w3.org
Hi,
The spec describes in detail how to generate mouseover/mouseout events etc.
for touch (
https://dvcs.w3.org/hg/pointerevents/raw-file/tip/pointerEvents.html#mapping-for-devices-that-do-not-support-hover),
but doesn't say where in this process the :hover CSS pseudo-class is
applied.  Should this be precisely specified here?

I'm wondering about scenarios where a page wants to provide additional
functionality for mouse hover only (eg. a pop-up box with some shortcut
buttons like on http://www.google.com/weeklyads/walmart/).  How do they
ensure this doesn't show up for devices that don't actually support hover?
 If the effects are triggered by events this is easy - they just need to
use pointerover/pointerout events instead and check the pointerType.  But
what if the effects are triggered using the :hover pseudo-class?

One option would be to say that they can apply/remove their own class in
pointerover/pointerout event handlers, and have appropriate CSS rules so
that this class overrides the rule with :hover.  But this will only work
reliably if UAs trigger the :hover pseudo-class after dispatching
pointerover, and remove it before dispatching pointerout.

Thanks,
   Rick
Received on Wednesday, 23 January 2013 16:03:23 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:17:04 GMT