W3C home > Mailing lists > Public > whatwg@whatwg.org > November 2014

Re: [whatwg] relationship between labeled control and label for :active and :hover pseudos

From: Florian Rivoal <florian@rivoal.net>
Date: Thu, 27 Nov 2014 00:57:07 +0100
Message-Id: <E0547142-C54B-4135-8260-BD5DE3A01A28@rivoal.net>
To: whatwg@lists.whatwg.org, Boris Zbarsky <bzbarsky@MIT.EDU>, Ryosuke Niwa <rniwa@apple.com>

>> On 10 Nov 2014, at 15:23, Florian Rivoal <florian@rivoal.net> wrote:
>> I suggest making this propagation of the :hover and :active state between label and labeled control bidirectional for both :hover and :active.

> On 10 Nov 2014, at 16:38, Boris Zbarsky <bzbarsky@MIT.EDU> wrote:
> "The label", or "the labels"?
> The problem of "hover the control if the label is hovered" is simple: the label already has a reference to the control it's labeling; when an element enters hover state you at worst have to deal with one other element (plus their ancestors) entering hover state.
> And even that gets a bit complicated given the "ancestors" thing.
> The backreference, however, is a one-to-many relationship, which makes things quite complicated, or fairly slow, or both, when multiple labels label the same form control.  So I would be a bit careful here.

> On 14 Nov 2014, at 21:34, Ryosuke Niwa <rniwa@apple.com> wrote:
> I don’t find it compelling to natively support this behavior in the browser.

As selectors is a CSS topic as much as an HTML one, I brought this to the CSS working group (mailing list then telecon) for further discussion to see if its members thought this was worth pursuing or not before coming back here.

The group made a resolution agreeing that :hover and :active should be made to propagate bidirectionally between labels and labeled controls, as the behaviour was found useful, and the performance question not problematic.

Since you raised specific concerns about performance, Microsoft, who already implements this, went through their bug database to check: “there is not a single bug filed against IE regarding performance issues by tying the the label to the labeled control”.

I also made a test case with a silly amount of labels plus some nesting. I am running IE(10) in a VM, and there’s no noticeable delay. http://jsbin.com/juzusopapu/1/watch?html,css,output

Out of people who explicitly gave opinions, Google (Tab Atkins), Microsoft (Greg Whitworth), and Fantasai were for it, while Mozilla (David Baron & Tantek Çelik) were fine with in. No one raised objections.

 - Florian
Received on Wednesday, 26 November 2014 23:57:34 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:09:32 UTC