W3C home > Mailing lists > Public > public-html@w3.org > May 2011

:hover and :active interaction with labels

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Mon, 09 May 2011 23:45:18 -0400
Message-ID: <4DC8B4CE.20508@mit.edu>
To: HTML WG <public-html@w3.org>
Consider this testcase:

   <!DOCTYPE html>
   <style>
     input { color: black; }
     input:hover { color: white; }
   </style>
   <label for="x">Hover me</label>
   <input id="x" type="button" value="A button">

Observed behavior in browsers is that hovering the label puts the button 
into :hover state in WebKit but not in Gecko, Presto, or Trident. 
Similar for :active.

However for controls that have native themed hover/active state, at 
least Gecko and Trident _do_ put the control into that native themed 
state when the label is hovered or activated.  They just don't change 
the actual CSS-exposed :hover and :active state.

See discussion in https://bugzilla.mozilla.org/show_bug.cgi?id=426082 
where we implemented the current Gecko behavior.

I would like to change the Gecko behavior here to match WebKit's, both 
because it would eliminate this weird dichotomy between native theme 
state and CSS state and because frankly it happens to be simpler to 
implement given some other changes I'm making.  ;)

Should the spec describe behavior here?  Would Opera and Microsoft be 
willing to match WebKit and Gecko on this?

-Boris
Received on Tuesday, 10 May 2011 03:45:47 UTC

This archive was generated by hypermail 2.3.1 : Monday, 29 September 2014 09:39:24 UTC