Issue #2047075 by Caecus, mgifford, jessebeach, larowlan: Mark invalid form field with [aria-invalid=true].
parent
aac3160d50
commit
5e30494edb
|
@ -4842,6 +4842,7 @@ function _form_set_attributes(&$element, $class = array()) {
|
|||
}
|
||||
if (isset($element['#parents']) && form_get_error($element) !== NULL && !empty($element['#validated'])) {
|
||||
$element['#attributes']['class'][] = 'error';
|
||||
$element['#attributes']['aria-invalid'] = 'true';
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -248,6 +248,9 @@ class FormTest extends WebTestBase {
|
|||
// Check the page for the error class on the textfield.
|
||||
$this->assertFieldByXPath('//input[contains(@class, "error")]', FALSE, 'Error input form element class found.');
|
||||
|
||||
// Check the page for the aria-invalid attribute on the textfield.
|
||||
$this->assertFieldByXPath('//input[contains(@aria-invalid, "true")]', FALSE, 'Aria invalid attribute found.');
|
||||
|
||||
// Submit again with required fields set and verify that there are no
|
||||
// error messages.
|
||||
$edit = array(
|
||||
|
|
Loading…
Reference in New Issue