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

Re: :hover and :active interaction with labels

From: Maciej Stachowiak <mjs@apple.com>
Date: Tue, 10 May 2011 00:45:19 -0700
Cc: HTML WG <public-html@w3.org>
Message-id: <AE0DD741-368E-4047-B390-9847B3DB6CB5@apple.com>
To: Boris Zbarsky <bzbarsky@mit.edu>

On May 9, 2011, at 8:45 PM, Boris Zbarsky wrote:

> 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?

Here's the bug where the functionality was added to WebKit: <https://bugs.webkit.org/show_bug.cgi?id=3244>. Note that we similarly propagate :active from the label to the control. Apparently at the time we thought all this followed from HTML4 requirements for label.

Received on Tuesday, 10 May 2011 07:45:50 UTC

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