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

Fix the sidebar meta boxes toggle aria-expanded reporting for Firefox+NVDA #1556

Closed
afercia opened this issue Jun 28, 2017 · 1 comment
Closed
Labels
[Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes).

Comments

@afercia
Copy link
Contributor

afercia commented Jun 28, 2017

See #1387 and #1388, then reverted in #1537.
Firefox and NVDA don't announce the aria-expanded state change (expanded/collapsed) on the sidebar meta boxes toggles. The previous attempt to fix this with HTML/CSS broke the icon buttons when used in other context, my bad.

However, it would be great to find an alternative workaround, since Firefox/NVDA users don't get absolutely any feedback when the aria-expanded state changes. Yes, this is a mix of browser and screen reader bug and, ideally, it should be fixed upstream. Unfortunately, the tickets related to the Firefox bug appear to be pending since a few years and I'm afraid a resolution won't happen so soon.

Fully understanding the issue is a good first step, some references:
nvaccess/nvda#5247
nvaccess/nvda#6401
https://bugzilla.mozilla.org/show_bug.cgi?id=659886
https://bugzilla.mozilla.org/show_bug.cgi?id=1285862

In a few words, when Firefox repaints some elements, for example because some CSS generated or SVG icon changes, it also updates the complete set of accessible properties (the "accessible") exposed to screen readers. It shouldn't do this.
Quoting from nvaccess/nvda#6401

Firefox is regenerating the accessible for that button when it expands/collapses. So, instead of firing a stateChange, it fires focus on a "new" accessible. See Mozilla bugs 659886 and 1285862.
If it were a stateChange, NVDA would report it. Instead, NVDA suppresses reporting the focus event because it's at the same position in the document (and not doing this would result in a lot of duplication when moving around).

Based on this, I've experimented what seems to me a logical workaround: just make the two events happen at a different time. Slightly delaying the aria-expanded state update, seems to fix it because the "accessible" regeneration happen first, and then Firefox fires a stateChange.

PR incoming soon.

@afercia afercia added the [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). label Jun 28, 2017
@afercia
Copy link
Contributor Author

afercia commented Dec 8, 2017

Just tested again with NVDA 2017.3 and both Firefox ESR and Firefox 57, seems this works correctly now.

@afercia afercia closed this as completed Dec 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes).
Projects
None yet
Development

No branches or pull requests

1 participant