Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

all-caps button labels are misread by screen-readers #6003

Closed
cfm opened this issue Jun 17, 2021 · 2 comments
Closed

all-caps button labels are misread by screen-readers #6003

cfm opened this issue Jun 17, 2021 · 2 comments
Assignees
Labels
a11y Issues related to accessibility

Comments

@cfm
Copy link
Member

cfm commented Jun 17, 2021

Description

For example: A button labeled ADD USER will be announced by a screen-reader as an initialism to be spelled out: "A.D.D. user".

<button type="submit" id="add-user">
<img src="{{ url_for('static', filename='icons/plus.png') }}" class="icon" width="13" height="15" alt="">
{{ gettext('ADD USER') }}
</button>

Steps to Reproduce

For this example:

  1. Navigate to the Admin Interface of the Journalist Interface.
  2. Activate a screen-reader.

Expected Behavior

The button visually labeled ADD USER is announced as "add user".

Actual Behavior

The button visually labeled ADD USER is announced as "A.D.D. user".

Comments

Labels capitalized explicitly in #1538 can be reverted to title case (pending #5821) and then styled with the text-transform property.

@cfm cfm added the a11y Issues related to accessibility label Jun 17, 2021
@cfm cfm self-assigned this Jun 17, 2021
@eloquence
Copy link
Member

Note there are i18n arguments against text-transform, see #1587 (comment)

@cfm
Copy link
Member Author

cfm commented Jul 15, 2021

After further research:

  1. Per Deprecate use of CSS text-transform: uppercase #1587 (comment): the localization argument against text-transform stands. (Thanks for referring me, @eloquence.)
  2. Where testing demonstrates that screen-readers may misread a specific label in all caps, we can override it with aria-label, at the cost of adding an extra string to translate. For example:
 <button type="submit" id="add-user" aria-label="{{ gettext('Add User') }}"> 
   {{ gettext('ADD USER') }} 
 </button> 
  1. In general, however, and in the absence of a specific misreading, we should avoid micromanaging the accessibility tree.

I'll close this general tracking issue and address specific instances as I encounter them in the course of #5986 and #5987.

@cfm cfm closed this as completed Jul 15, 2021
cfm added a commit that referenced this issue Jul 27, 2021
Adds explicit ARIA-LABEL attributes to elements whose strings are in
all caps to support idiomatic translation (cf. #5821, #6003).

thread: #6041 (comment)
cfm added a commit that referenced this issue Jul 27, 2021
Adds explicit title-case ARIA-LABEL attributes to elements whose strings
are in all caps to support idiomatic translation (cf. #5821, #6003).

thread: #6041 (comment)
cfm added a commit that referenced this issue Jul 27, 2021
Adds explicit title-case ARIA-LABEL attributes to elements whose strings
are in all caps to support idiomatic translation (cf. #5821, #6003).

thread: #6041 (comment)
cfm added a commit that referenced this issue Jul 27, 2021
Adds explicit title-case ARIA-LABEL attributes to elements whose strings
are in all caps to support idiomatic translation (cf. #5821, #6003).

thread: #6041 (comment)
cfm added a commit that referenced this issue Aug 9, 2021
addresses review feedback

Corrects 876bfa2's removal of these decorative IMGs without replacing
their semantic content.

thread: #6041 (comment)
squash/fixup: 876bfa2

addresses review feedback

Adds explicit title-case ARIA-LABEL attributes to elements whose strings
are in all caps to support idiomatic translation (cf. #5821, #6003).

thread: #6041 (comment)

addresses review feedback

Refactors MAIN.index-row rather than wrapping the whole DIV.grid in
MAIN.

thread: #6041 (comment)
squash/fixup: 80547cd

removes stray ARIA-LABELS (per review feedback)

thread: #6041 (comment)

addresses review feedback

LABEL[for="codename"] was marked HIDDEN to prevent redundant narration
in screen readers.  Refactoring the LABEL to an H2 that ARIA-labels
the containing section streamlines the narration and makes for a
more-logical outline.

thread: #6041 (comment)
squash/fixup: ae56f49

refactors SECTION#codename-hint as DETAILS (per review feedback)

::{before,after} pseudo-elements must be used to style the
expand/collapse links ("Show"/"Hide", respectively) because under DIR="ltr"
the ::marker pseudo-element will be displayed to the left of the
SUMMARY.

thread: #6041 (comment)
squash/fixup: 1f69640

adds "button" role to non-navigating links (per review feedback)

thread: #6041 (comment)

undoes autoformatting

squash/fixup: 1f69640

fixes tests for refactored DETAILS#codename-hint

squash/fixup: c8baf3d

fixes unclosed ARIA-LABEL attribute (per review feedback)

thread: #6041 (comment)
squash/fixup: d6116a2

refactors TIME as H3 of reply ARTICLE (per review feedback)

Each reply now consists of an ARTICLE automatically labeled by its H3 TIME.  These implicit ARIA semantics are more fluent than those marked explicitly in 1f69640.

thread: #6041 (comment)
squash/fixup: 1f69640

refactors OUTPUTs as MARKs or Ps (per review feedback)

Some "browser / screen reader pairings may not announce or make
available the accessible name of the output, even though its a labelable
element"[1], apparently including Orca (i.e., on Tails).  These elements
give the next-best semantics without implying a live region.

[1]: https://www.scottohara.me/blog/2019/07/10/the-output-element.html

thread: #6041 (review)
squash/fixup: 1f69640
squash/fixup: f37fc17
squash/fixup: ae56f49
cfm added a commit that referenced this issue Aug 16, 2021
addresses review feedback

Corrects 876bfa2's removal of these decorative IMGs without replacing
their semantic content.

thread: #6041 (comment)
squash/fixup: 876bfa2

addresses review feedback

Adds explicit title-case ARIA-LABEL attributes to elements whose strings
are in all caps to support idiomatic translation (cf. #5821, #6003).

thread: #6041 (comment)

addresses review feedback

Refactors MAIN.index-row rather than wrapping the whole DIV.grid in
MAIN.

thread: #6041 (comment)
squash/fixup: 80547cd

removes stray ARIA-LABELS (per review feedback)

thread: #6041 (comment)

addresses review feedback

LABEL[for="codename"] was marked HIDDEN to prevent redundant narration
in screen readers.  Refactoring the LABEL to an H2 that ARIA-labels
the containing section streamlines the narration and makes for a
more-logical outline.

thread: #6041 (comment)
squash/fixup: ae56f49

refactors SECTION#codename-hint as DETAILS (per review feedback)

::{before,after} pseudo-elements must be used to style the
expand/collapse links ("Show"/"Hide", respectively) because under DIR="ltr"
the ::marker pseudo-element will be displayed to the left of the
SUMMARY.

thread: #6041 (comment)
squash/fixup: 1f69640

adds "button" role to non-navigating links (per review feedback)

thread: #6041 (comment)

undoes autoformatting

squash/fixup: 1f69640

fixes tests for refactored DETAILS#codename-hint

squash/fixup: c8baf3d

fixes unclosed ARIA-LABEL attribute (per review feedback)

thread: #6041 (comment)
squash/fixup: d6116a2

refactors TIME as H3 of reply ARTICLE (per review feedback)

Each reply now consists of an ARTICLE automatically labeled by its H3 TIME.  These implicit ARIA semantics are more fluent than those marked explicitly in 1f69640.

thread: #6041 (comment)
squash/fixup: 1f69640

refactors OUTPUTs as MARKs or Ps (per review feedback)

Some "browser / screen reader pairings may not announce or make
available the accessible name of the output, even though its a labelable
element"[1], apparently including Orca (i.e., on Tails).  These elements
give the next-best semantics without implying a live region.

[1]: https://www.scottohara.me/blog/2019/07/10/the-output-element.html

thread: #6041 (review)
squash/fixup: 1f69640
squash/fixup: f37fc17
squash/fixup: ae56f49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a11y Issues related to accessibility
Projects
None yet
Development

No branches or pull requests

2 participants