This change is related to #2121775: Make the markup associated with the required star on field items silent.
Previously, a required field was indicated by a star (asterisk) character appended to the label of a field.
With the previous code, a screen reader would have read the title field label like this:
title star required edit-text
Note that the word "star" is pronounced because it is a character in the abbr
element. So we have changed the abbr
element to a span
element and hidden it with aria-hidden
. Now the title field label is read like this:
title required edit-text
The theme_form_required_marker
theme function has been changed in this patch. Specifically:
function theme_form_required_marker($variables) {
$attributes = array(
'class' => 'form-required',
- 'title' => t('This field is required.'),
+ 'aria-hidden' => 'true',
);
- return '<abbr' . new Attribute($attributes) . '>*</abbr>';
+ return '<span' . new Attribute($attributes) . '>*</span>';
}
CSS targeting just the class .form-required
will not need to be changed. If you referenced the HTML element as well such as abbr.form-required
, you can either remove the reference to the HTML element or change it to a span
.