RE: proposed change: links inside label elements

+1

 

Emmanuelle Gutiérrez y Restrepo

Patrono y Directora General

Fundación Sidar - Acceso Universal

Email:  <mailto:coordina@sidar.org> coordina@sidar.org

Personal:  <mailto:Emmanuelle@sidar.org> Emmanuelle@sidar.org

Web:  <http://sidar.org> http://sidar.org

 

De: Steve Faulkner [mailto:faulkner.steve@gmail.com] 
Enviado el: lunes, 13 de enero de 2014 12:45
Para: HTMLWG WG
Asunto: proposed change: links inside label elements

 

Currently the HTML spec allows links to be inside label elements [1]:

example:




<label for="test">
<a href="http://google.com">google</a></label>


 
<input id="test" type="checkbox"> 
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
[2]
http://www.w3.org/html/wg/drafts/html/master/forms.html#labelable-elements
[3]
http://www.w3.org/html/wg/drafts/html/master/dom.html#interactive-content-0

feedback welcome!

--


Regards

SteveF

HTML 5.1 <http://www.w3.org/html/wg/drafts/html/master/> 

Received on Monday, 13 January 2014 12:40:19 UTC