Bug 400876 - Warnings not read by screenreader (VoiceOver)
Summary: Warnings not read by screenreader (VoiceOver)
Status: RESOLVED WONTFIX
Alias: None
Product: Orion (Archived)
Classification: ECD
Component: OrionHub (show other bugs)
Version: unspecified   Edit
Hardware: Macintosh Mac OS X
: P3 normal (vote)
Target Milestone: 4.0 M2   Edit
Assignee: Ken Walker CLA
QA Contact:
URL:
Whiteboard:
Keywords: accessibility
Depends on:
Blocks:
 
Reported: 2013-02-14 23:23 EST by Sarah Hong CLA
Modified: 2015-05-05 16:18 EDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sarah Hong CLA 2013-02-14 23:23:19 EST
Warnings on sign up page are not read out by screenreader
e.g. “passwords does not match”
“user already exists”
“login is incorrect”
Comment 1 Carolyn MacLeod CLA 2013-02-15 15:06:55 EST
The element that contains the error/warning message needs to be marked up as a "live region". It needs the following attribute:
   aria-live="assertive"

I'm not sure, but it might also need:
   aria-atomic="true"

Here's some doc describing what live regions are:
http://www.w3.org/WAI/PF/aria-practices/#LiveRegions
Comment 2 Ken Walker CLA 2013-03-15 12:21:51 EDT
Sarah, regarding the pull request

https://github.com/eclipse/orion.client/pull/23/files#r3126386

Could you please add a comment here like this:

e.g., I assert that I authored 100% of the content of this contribution and have the rights to donate the content to Eclipse under the EPL
Comment 3 Sarah Hong CLA 2013-03-23 16:26:26 EDT
I assert that I authored 100% of the content of this contribution and have the rights to donate the content to Eclipse under the EPL
Comment 4 Carolyn MacLeod CLA 2013-03-26 17:02:38 EDT
Sarah, did you test this? It doesn't fix the problem on Windows. The parent 
<div id="errorWin"> already had aria-live="assertive" aria-atomic="true"
so I'm not sure if making the the child
<div id="errorMessage"> have aria-live="assertive" would make any difference.
Does it work on Mac?

Interestingly, this was broken before, and then it was fixed by Max in bug 368856, and then it became broken again at some point when the <tr> was changed to a <div> and LoginWindow.html moved from server to client. (Anton, did anything else related to the "errorWin" and "errorMessage" elements change at that time?) 

Sarah, can you research aria live regions a bit more, and see if you can find a working example where the text of a <div> is changed and the live region is spoken?  I am wondering if it has anything to do with the fact that the parent <div> starts out with style="visibility: hidden;" and then this is set to style="" in order to show the parent <div> when there is an error?
Comment 5 Carolyn MacLeod CLA 2013-04-17 01:05:28 EDT
After discussion with Sarah in email, we decided that the only way to get this working on Mac was to insert a "hack" that does not follow the ARIA spec.
Articles [1] and [2], below, show that it is complicated to get this right for all browsers and all screen readers.

The following did work for me on Windows:
- in LoginWindow.html: 
    <div id="errorWin" class="orion-error" style="visibility: hidden;" aria-hidden="true"> 
        <div id="errorMessage" role="alert" aria-atomic="true" aria-live="assertive">&nbsp;</div> 
    </div> 

- in LoginWindow.js: 
    function showErrorMessage(msg) { 
        if (typeof msg !== "undefined") { 
            document.getElementById("errorMessage").textContent = msg; 
        } 
        var errorWin = document.getElementById("errorWin"); 
        errorWin.style.visibility = ''; 
        errorWin.setAttribute("aria-hidden", false); 
    } 

    function hideErrorMessage() { 
        document.getElementById("errorMessage").textContent = "\u00a0"; 
        var errorWin = document.getElementById("errorWin"); 
        errorWin.style.visibility = 'hidden'; 
        errorWin.setAttribute("aria-hidden", true); 
    }

...although, I have since read [3] that "aria-hidden" is not that helpful, and it is better to use the new HTML5.1 'hidden' attribute. For example, instead of:
    <div id="errorWin" class="orion-error" style="visibility: hidden;" aria-hidden="true">...</div>
use the following because it is now more widely supported:
    <div id="errorWin" class="orion-error" hidden>...</div>


[1]: http://blog.paciellogroup.com/2012/06/html5-accessibility-chops-aria-rolealert-browser-support/ 
[2]: http://viewplus.com/downloads/htmltests/accessibility/live-hack.html 
[3]: http://www.html5accessibility.com/tests/hidden.html
Comment 6 Carolyn MacLeod CLA 2013-04-17 01:09:24 EDT
For now, I think we should just put working Windows code in and assume that this problem will be fixed in a newer version of VoiceOver.
I will put together a patch similar to the code in comment 5.
Comment 7 John Arthorne CLA 2015-05-05 16:18:21 EDT
Closing as part of a mass clean up of inactive bugs. Please reopen if this problem still occurs or is relevant to you. For more details see:


https://dev.eclipse.org/mhonarc/lists/orion-dev/msg03444.html