Closed
Bug 682790
Opened 13 years ago
Closed 13 years ago
ignore implicit label association when it's associated explicitly
Categories
(Core :: Disability Access APIs, defect)
Core
Disability Access APIs
Tracking
()
RESOLVED
FIXED
mozilla10
People
(Reporter: surkov, Assigned: surkov)
References
(Blocks 2 open bugs)
Details
(Keywords: access, Whiteboard: [good first bug])
Attachments
(1 file)
6.44 KB,
patch
|
MarcoZ
:
review+
|
Details | Diff | Splinter Review |
If @for attribute (explicit label association) is used then don't create relations for label content (implicit association).
See http://www.w3.org/TR/html4/interact/forms.html#h-17.9.1
"for = idref [CS]
This attribute explicitly associates the label being defined with another control. When present, the value of this attribute must be the same as the value of the id attribute of some other control in the same document. When absent, the label being defined is associated with the element's contents. "
Example,
<label for="btn"><input type="button" id="btn" value="button"></label>
This results in duped name and accessible relations.
Assignee | ||
Comment 1•13 years ago
|
||
the fix should be resided in AccIterator.cpp HTMLLabelIterator::Next(), we shouldn't pick up implicit association if @for attribute is presented on label.
mochitest: name/test_general.html and relations/test_general.html under label section, couple examples is enough:
<label for="btn"><input type="button" id="btn" value="button"></label>
<label for="btn"><input type="button" value="button2"></label>
Comment 2•13 years ago
|
||
Is this a dup of bug 669312?
Assignee | ||
Comment 4•13 years ago
|
||
(In reply to James Teh [:Jamie] from comment #2)
> Is this a dup of bug 669312?
right, thank you, Jamie.
Assignee | ||
Comment 5•13 years ago
|
||
this bug can be seen
1) http://www.html5accessibility.com/tests/form-labels.html (example from bug 669312)
2) facebook.com (log in button)
Comment 6•13 years ago
|
||
(In reply to alexander surkov from comment #0)
> If @for attribute (explicit label association) is used then don't create
> relations for label content (implicit association).
>
> See http://www.w3.org/TR/html4/interact/forms.html#h-17.9.1
>
> "for = idref [CS]
> This attribute explicitly associates the label being defined with
> another control. When present, the value of this attribute must be the same
> as the value of the id attribute of some other control in the same document.
> When absent, the label being defined is associated with the element's
> contents. "
>
> Example,
> <label for="btn"><input type="button" id="btn" value="button"></label>
> This results in duped name and accessible relations.
Marco asked me in the dupe of this bug whether I have seen this pattern used in the wild (https://bugzilla.mozilla.org/show_bug.cgi?id=669312#c1) I have recently noticed it on Google sites:(https://sites.google.com/)
example:
<label for="search-site"><input type="checkbox" onclick="JOT_postEvent('onSearchConfigChange');" id="search-site" jotid="search-site"> this site</label>
Assignee | ||
Comment 7•13 years ago
|
||
Attachment #560878 -
Flags: review?(marco.zehe)
Comment 8•13 years ago
|
||
Comment on attachment 560878 [details] [diff] [review]
patch
r=me, thanks!
Attachment #560878 -
Flags: review?(marco.zehe) → review+
Assignee | ||
Comment 9•13 years ago
|
||
Comment 10•13 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla10
Comment 11•5 years ago
|
||
You need to log in
before you can comment on or make changes to this bug.
Description
•