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>
     input { color: black; }
     input:hover { color: white; }
   <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?

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

This archive was generated by hypermail 2.4.0 : Saturday, 9 October 2021 18:45:37 UTC