This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
see also: https://www.w3.org/WAI/PF/Group/track/issues/754 Do we use label elements that contain controls? Maybe only if the control is the first child of the label? <label>I have a <input type=”checkbox” />checkbox and a <button>button</button> here</label> I don’t think the label containing these controls makes sense to be the name for either, and definitely not both. Please add a concrete definition of when to use parent <label> elements.
> Do we use label elements that contain controls? Maybe only if the control is > the first child of the label? Your intuition matches the HTML5.1 nightly [1]. If a <label> element has no @for attribute, then the "... the first such descendant in tree order is the label element's labeled control." One of the spec's examples is: <label><input type=checkbox name=lost> Lost</label> The accessible name of the checkbox accessible for the above is "Lost". Based on that, in your example, the <label> applies only to the checkbox <input>. Repeating your example here: <label>I have a <input type=”checkbox” />checkbox and a <button>button</button> here</label> The accessible name for the checkbox accessible is "I have a checkbox and a button here". Since the <label> does not apply to the (enclosed) <button>, then its accessible name should be "button". FWIW, FF produces "I have a checkbox and a button here" as the accessible name for *both* the checkbox and the button. [1] http://www.w3.org/html/wg/drafts/html/master/single-page.html#the-label-element
btw, I filed a bug for firefox issue https://bugzilla.mozilla.org/show_bug.cgi?id=1226000
I think the a11y spec should refer to the HTML spec, saying that labelled control takes its accessible name from its label element [1], and related with it by certain accessible relations. [1] http://www.w3.org/html/wg/drafts/html/master/single-page.html#labeled-control
HTML AAM is no longer an ARIA Deliverable. If you wish to pursue this issue please file at https://github.com/w3c/html-aam/issues