W3C home > Mailing lists > Public > www-style@w3.org > October 2012

Re: [css4-selectors] Hovering and user intent

From: Simon Fraser <smfr@me.com>
Date: Wed, 24 Oct 2012 09:53:57 -0700
Cc: www-style@w3.org
Message-id: <79DCEB28-024F-44EF-898E-3E2F944D2BCA@me.com>
To: "Eric A. Meyer" <eric@meyerweb.com>
A related question is whether elements that end up under the mouse pointer when scrolling should be considered to be hovered.

WebKit is currently experimenting with throttling hover updates while scrolling, in order to improve scrolling performance.


On Oct 23, 2012, at 7:51 pm, Eric A. Meyer <eric@meyerweb.com> wrote:

> Greetings,
>   There's an inconsistency in browser behavior that's always bugged me, which is the way browsers treat hovering.  According to <http://dev.w3.org/csswg/selectors4/#the-hover-pseudo> (as well as earlier versions back to original CSS2, with minor variations in punctuation):
>   "The :hover pseudo-class applies while the user designates an element with a pointing device, but does not necessarily activate it."
> This seems to vaguely argue for :hover only applying if there is evidence of user intent; i.e., the mouse pointer is moving.  That's how most browsers currently behave.  Gecko, at least for a good many versions now, does not.  See this testcase by Kyle Weems:
>   <http://cssquirrel.com/testcases/css-animation-hover/>
> (I am told the described Gecko behavior may not be true in recent builds of Gecko, but I'm not clear if that's intentional or not.)
>   I think most people-- I've seen this in many cases-- assume that hovering always means that the pointer is over the element, regardless of how the two came to be in that state.  In this mental model, the pointer is like a helicopter and the element is like a flatbed truck.  The helicopter hovers over the truck whether it flies over the truck or the truck is driven under it.
>   I understand that the only-check-when-moving behavior of most browsers is probably a performance optimization, but it clashes with author expectations.  The specification, as I say, vaguely implies that author expectations should be subverted here, but that's quite possibly reading too much into the text.
>   I propose the text be clarified to say what should happen if an unmoving pointer is within the bounds of an element with a :hover style.  The actual text depends on what the WG intends to be the right outcome in this case, though.  What is the preferred outcome?
> -- 
> Eric A. Meyer (eric@meyerweb.com)     http://meyerweb.com/
Received on Wednesday, 24 October 2012 16:54:33 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:22 UTC