You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 30, 2021. It is now read-only.
The problem appears to be located in the associated_label_has_text function, which constructs a regular expression for the innerHTML of the label element, but omits a second capture group for text / HTML nodes to the right of the input element. So a rudimentary fix would look something like the following:
publicstaticfunctionassociated_label_has_text($e, $content_dom)
{
...
// 2.The element $e is contained by a"label" element
if ($e->parent()->tag == "label")
{
$pattern = "/(.*)". preg_quote($e->outertext, '/') ."(.*)/";
preg_match($pattern, $e->parent->innertext, $matches);
if (strlen(trim($matches[1])) > 0) returntrue;
if (strlen(trim($matches[2])) > 0) returntrue;
}
...returnfalse;
}
The text was updated successfully, but these errors were encountered:
In the algorithm for Rule 204 - All input elements, type of "radio" have a label containing text, steps 7 and 8 state:
input
element is contained by alabel
elementHowever, your detection for text inside the label is limited to text preceding the input. So the following element will validate as valid:
But this element will not:
Since the WAI recommends that all left-to-right languages place text to the right of radio buttons and checkboxes, in LTR languages, this check results in a false positive.
The problem appears to be located in the
associated_label_has_text
function, which constructs a regular expression for the innerHTML of the label element, but omits a second capture group for text / HTML nodes to the right of the input element. So a rudimentary fix would look something like the following:The text was updated successfully, but these errors were encountered: