[html5] Question on label as a part of interactive content

Jukka K. Korpela jukka.k.korpela at kolumbus.fi
Wed Jul 2 05:28:54 PDT 2014


2014-07-02 15:07, S Partha wrote:
> As per the spec 
> http://dev.w3.org/html5/spec-preview/content-models.html#interactive-content, 
> label element is marked as interactive without any exceptions. Label 
> elements are still considered interactive, even if they don't have any 
> labeled control. Is there a specific reason to treat labels this way?

The <label> element is meant for labeling controls. I think we should 
rather ask why a <label> element without a labeled control is permitted 
at all. Maybe the answer is that a page may have a <label> element that 
has no labeled control at the start, or in some other phase, but then 
becomes associated with a labeled control.

Since a <label> element without labeled control is anomalous (though 
apparently used by some people who have not understood its purpose and 
intended use), it sounds reasonable to simplify rules so that <label> is 
always treated as interactive. It is true that some other elements have 
conditions like “if the ... attribute is present”, but these are simpler 
“if it has a labeled control” (which would need to be decided by looking 
at the @for attribute, if present, *and* the content of the <label> 
element).

-- 
Yucca, http://www.cs.tut.fi/~jkorpela/



More information about the Help mailing list