Skip to content

Commit c6f72e4

Browse files
author
Luke Wright
committed
Part of fix for squizlabs#110.
We should no longer be failing Label attributes for not having a "for" attribute, now that different methods of association are permitted.
1 parent 5f1b62c commit c6f72e4

File tree

1 file changed

+2
-4
lines changed
  • Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_3

1 file changed

+2
-4
lines changed

Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_3/1_3_1.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ var HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_3_1_3_1 = {
106106
this._labelNames = {};
107107
var labels = top.getElementsByTagName('label');
108108
for (var i = 0; i < labels.length; i++) {
109-
if ((labels[i].hasAttribute('for') === true) && (labels[i].getAttribute('for') !== '')) {
109+
if (labels[i].getAttribute('for') !== null) {
110110
var labelFor = labels[i].getAttribute('for');
111111
if ((this._labelNames[labelFor]) && (this._labelNames[labelFor] !== null)) {
112112
this._labelNames[labelFor] = null;
@@ -136,9 +136,7 @@ var HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_3_1_3_1 = {
136136
}
137137
}
138138
}
139-
} else {
140-
HTMLCS.addMessage(HTMLCS.ERROR, labels[i], 'Label found without a "for" attribute, and therefore not explicitly associated with a form control.', 'H44.NoForAttr');
141-
}//end if
139+
}
142140
}//end for
143141
},
144142

0 commit comments

Comments
 (0)