Problem/Motivation

The required star indicates to sighted individuals that a field is required. The star itself is an <abbr> tag with hidden text that indicates that this star means that a field is required.

Screenshot of the Article creation form. The title field is visible with an asterisk to the right of the Title field label. A callout indicates that the field title is read as title star.

When navigating a form with a screen reader, the star character is read, not the <abbr> tag title. So the Title field is read as: "Title star".

Screenshot of the Article creation form. The title field is visible with an asterisk to the right of the Title field label

When the required star was introduced, we didn't have a good way to indicate requireness on a form item to non-visual user agents. We do now though with aria-required (documentation for aria-required).

So, we can now visually mark the field as required without the added text because the aria-required attribute will indicate to screen reading user agents the requiredness of the field.

Proposed resolution

Remove theme_form_required_marker and just use CSS to indicate a required field.

Remaining tasks

Propose a patch

User interface changes

We will no longer have awkwardly labeled required form items when being read by screen reading user agents.

API changes

The theme_form_required_marker theme function will be eliminated.

Original report by @jessebeach

Comments

jessebeach’s picture

Title: Remove the markup associated with the required star on field items: render the star with CSS instead » Make the markup associated with the required star on field items silent
Status: Active » Needs review
StatusFileSize
new1.04 KB

I took a slightly different path with this issue -- namely, changing as little code as possible.

I've just added an aria-hidden attribute to the required marker and removed the title attribute. The title doesn't get read by screen reading user agents. But the star character does, so using aria-hidden makes it silent. Now, instead of this being read for the required title of a node:

title star required edit-text

this gets read:

title required edit-text.

Status: Needs review » Needs work

The last submitted patch, make-star-silent-2121775-1.patch, failed testing.

Bojhan’s picture

Ahh, the test fails should be relatively easy to resolve they are all kinda weird assertions.

mgifford’s picture

There were other options considered for D7 other than *, but it is a commonly understood one http://simplyaccessible.com/article/required-fields-right/

It might be nicer to have (required) to be read aloud, but since we do have access to required elements from HTML5, we could consider other indicators too.

anandkp’s picture

Assigned: Unassigned » anandkp

Hi @everyone!

I'd love to take a gander at this! I've done some A11y in the past. I feel that this particular information is best served as real text for assistive tech. and hidden by CSS for visual users.

Will come up with a patch in a day or so.

Thanks!

jessebeach’s picture

In the example given in the issue description, with the patch applied, VoiceOver reads the field as:

Title required edit-text

Because the field has the label "Title", it has the HTML5 required attribute, the aria-required="true" equivalent, and it is an input of type text.

I feel that if we put text here, we're going to compete with the native Accessibility API that uses the HTML5 required attribute to indicate requiredness.

The required attribute and the aria-required attributes, in combo, function in all major screen readers: http://john.foliot.ca/required-inputs/

In sum, I don't think we need to make this issue more complicated. I just want screen readers to stop say "{label} star" and just say "{label}" whenever they read a required field.

Reviews to that end would be helpful. @alexpott brought up "qwerty" issue here. Namely, that perhaps screen reader users have gotten accustom to the bad pattern of hearing "star" spoken and using that to find required fields. If that's the case, I really hope we can retire that bad pattern and just use the standard required attributes from here on out.

jessebeach’s picture

Status: Needs work » Needs review
StatusFileSize
new3.69 KB
new3.17 KB

I fixed the tests. They were checking against specific markup. Simple fixes.

anandkp’s picture

Hi @jessebeach!

I'd totally forgotten about the HTML5 "required" attribute! I totally agree with you, that will serve the needs here the best.

Regarding the "qwerty" issue, I agree that it's a non-issue because having the required attribute makes screen readers announce that a field is required and that's pretty clear.

I'm working off of Ubuntu currently with only Orca installed. I'll give the pattern a try and see what I hear then report back.

Thanks!

anandkp’s picture

Assigned: anandkp » Unassigned

Hi again!

Try as I could, Orca on Ubuntu 13.04 is unresponsive. It reads what it wants to and refuses to do anything I'd like it to. The modifier key (by default, INS and/or KB_Insert) + space didn't activate the GUI settings.

I found an issue logged about the exact same problem I'm facing here: http://askubuntu.com/questions/320505/cannot-find-orca-gui-based-setting....

Since I can't do anything more to help out with this, I'm unassigning this issue from myself.

Thanks for your efforts on this @jessebeach!

mgifford’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new517.31 KB

I tested this in VoiceOver and it behaves as expected. It removes the mention of a * but clearly says that it is required text. I've attached a screenshot that shows what VoiceOver is telling me.

This has not been tested with NVDA or JAWS, but it should work the same way as HTML5 is definitely the bigger standard.

EDIT: @anandps - thanks for trying to test this with Orca. Very little testing has been done with that. I would have thought that http://www.chromevox.com would work with Linux, but if it does they don't talk about it.

alexpott’s picture

Title: Make the markup associated with the required star on field items silent » Change notice: Make the markup associated with the required star on field items silent
Priority: Normal » Major
Status: Reviewed & tested by the community » Active
Issue tags: +Needs change record

Nice fix - saw this in action @BADcamp - also this fixes the semantically incorrect use of abbr - * is not an abbreviation of required!

As we're changing markup we need a change notice.

Committed b5525ad and pushed to 8.x. Thanks!

jessebeach’s picture

It's on my todo list to write a change notice for this.

jessebeach’s picture

Status: Active » Fixed

Change notice added: https://drupal.org/node/2148315

jessebeach’s picture

Title: Change notice: Make the markup associated with the required star on field items silent » Make the markup associated with the required star on field items silent
yched’s picture

Nitpick: the title of the change notice reads as if we removed the star visually as well - which we haven't, right ?

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

xjm’s picture

Issue tags: -Needs change record

I updated the title of the change record for clarity and made it reference this issue.