Re: proposed change: links inside label elements

Hi, Steve and all

I'm coming a little late to the discussion (after a little reaction on
twitter), but I think it is a real usability *and* accessibility
problem to have links inside labels. Worst if it is done only for
styling purposes (so the link is "glued" together to the label??).
There's other ways to do that without troubling the user.

It is specially hard to keyboard users and it would create confusion
even to the developer to decide what must happen when the  is
triggered. We send the user to the link target or we
check/select/focus the input?

As Steve said, we cannot avoid developers to do as they wish, but we
can set rules that go toward logic and not just toward "let's do the
easy way". It should be a bug, IMHO

Cheers,
Angela

----- Original Message -----
From: "Steve Faulkner" 
To:"HTMLWG WG" 
Cc:
Sent:Tue, 14 Jan 2014 10:56:08 +0000
Subject:Re: proposed change: links inside label elements

Thanks to all for the feedback on the proposal.

I agree that restricting the use of links inside labels is not a good
idea.
What I have done is add a note in the spec about the positive effect
for usability/accessibility of labels as it increases hit area of the
labeled control, and that linking label text negates this. 
https://github.com/w3c/html/commit/11c025f70bf7364e37cec508592c99916f92c3c8
[1]

further feedback welcome!

As always note that the above is a change to the editors draft only
for the purpose of review by the WG

--

Regards

SteveF
HTML 5.1 [2]

On 13 January 2014 11:44, Steve Faulkner  wrote:
 Currently the HTML spec allows links to be inside label elements [1]:

example:

google

	This is problematic because the standard behaviour for a label that
is associated with a control is that when 
 clicked/pressed it activates the control (in the example case would
check/uncheck the checkbox), but when as in the example

	the label includes a link, clicking /pressing the label activates the
link not the control.

	I propose to change the spec to disallow links in labels (i.e. make
it an author conformance error). 

	current text:
 CONTENT MODEL:PHRASING CONTENT, BUT WITH NO DESCENDANT LABELABLE
elements [2] unless it is the element's labeled control, and no
descendant label elements. 

	proposed text:

 CONTENT MODEL:PHRASING CONTENT, BUT WITH NO DESCENDANT INTERACTIVE
elements [3] unless it is the element's labeled control, and no
descendant label elements.

[1]
http://www.w3.org/html/wg/drafts/html/master/forms.html#the-label-element
[5]
 [2]
http://www.w3.org/html/wg/drafts/html/master/forms.html#labelable-elements
[6]
[3]
http://www.w3.org/html/wg/drafts/html/master/dom.html#interactive-content-0
[7]

feedback welcome!
--

Regards

SteveF
HTML 5.1 [8]

 

Links:
------
[1]
https://github.com/w3c/html/commit/11c025f70bf7364e37cec508592c99916f92c3c8
[2] http://www.w3.org/html/wg/drafts/html/master/
[3] mailto:faulkner.steve@gmail.com
[4] http://google.com
[5]
http://www.w3.org/html/wg/drafts/html/master/forms.html#the-label-element
[6]
http://www.w3.org/html/wg/drafts/html/master/forms.html#labelable-elements
[7]
http://www.w3.org/html/wg/drafts/html/master/dom.html#interactive-content-0
[8] http://www.w3.org/html/wg/drafts/html/master/

Received on Tuesday, 14 January 2014 16:29:38 UTC