WICG / aom

Accessibility Object Model
http://wicg.github.io/aom/
Other
569 stars 59 forks source link

Confirmation of Action: (ariaNotify) general feedback for consideration #187

Open travisleithead opened 2 years ago

travisleithead commented 2 years ago

The following is re-posted with permission from @aleventhal:

I had some thoughts about ariaNotify based on my previous experience in helping to create the properties used by ARIA live regions.

(Thanks for the feedback @aleventhal!)

travisleithead commented 2 years ago

I love the idea of being more explicit about the intentions for when and how to interrupt, combine together, etc. rather than relying on a general sense of assertiveness or politeness and leaving the defintion largely up to implementers.

I also love the 'earcons' idea that could help make a set of common notifications consistent across the user's experience from site to site.

On the name: glad you like it. I appreciate the clear associate with aria, a.k.a., the API is intended for assistive technology use cases. If we change the name, I would still like to preserve some connection to accessibility so that authors don't confuse this for some other kind of general purpose notification API.

aleventhal commented 2 years ago

We should also describe how we imagine the Braille interface to work. One of the big problems with live regions is that Braille is not always supported, and when it is, it's not necessarily helpful. For example, I believe in VoiceOver, the live region message shows on the Braille display temporarily and then disappears. There's no way to get it back after it's gone.

Another useful thing might be to explain good/bad uses of this. E.g. should it be used for error messages during form input?

brennanyoung commented 2 years ago

Just a few bullets from me.

jugglinmike commented 2 years ago

From the proposal's "Considerations & Open Issues" section:

What about supporting non-textual cues? We think other platform capabilities (like <audio>.play()) can be used to handle non-textual output, and that non-textual based messages don't need to be handled by this API.

This doesn't seem like a viable option given the concerns about fingerprinting. If authors are intentionally prevented from learning if/how this information is being consumed, then they can't be expected to integrate it with other platform features.

The considerations behind media playback (e.g. resource loading and decoding capabilities) would tend to complicate this proposal in a way that doesn't seem justified, yet. @brennanyoung's thoughts on semantic icons, above, make so-called "earcons" seem like a more tractable answer. (Thanks also for the reminder about the inaccuracy of that term.)

the ARIA WG did not want to use an "important" indicator, because it was felt that developers would not know when to use it (or importantly not use it), e.g. developers would always feel that their content was important. We wanted to have something that was more descriptive of what would happen, and ended up on polite/assertive.

@aleventhal Do you think this could be mitigated through word choice? To me, the term "priority" seems substantially more likely to communicate the presence of trade-offs.

Reusing the values of the aria-live content attribute value may be an opportunity to improve coherence with the existing platform, both in terms of API and expected behavior:

-document.ariaNotify( "Text bolded", { priority: "important" } );
+document.ariaNotify( "Text bolded", { priority: "assertive" } );
+document.ariaNotify( "Text bolded", { priority: "polite" } );

If a richer priority gradient is warranted, then we could still tie in to that convention with enum values:

document.ariaNotify( "Text bolded", { priority: 8 } );
document.ariaNotify( "Text bolded", { priority: document.ariaNotify.ASSERTIVE } ); // initialized to `1`
document.ariaNotify( "Text bolded", { priority: document.ariaNotify.POLITE } ); // initialized to `2`
jugglinmike commented 2 years ago

Elsewhere, @zcorpan pointed out how enums are generally discouraged in web API design these days. If the priority and the existing content attribute really are correlated, and if there really is a need for a large gradient of priorities, then another way to "bridge the gap" would be to accept a mixed type: either a number OR "assertive" OR "polite". The downside is that authors couldn't intuit how the string values related to numeric ones.

aleventhal commented 2 years ago

@jugglinmike I think we should mitigate the problems with importance, and lack of functionality with polite/assertive, by having some of the options described at the top of this issue:

These are just ideas of what the author could provide:

Maybe we could talk about it on a call sometime.

sartang commented 2 years ago

This came up in the following code-review (https://chromium-review.googlesource.com/c/chromium/src/+/3453306):

What should we do for nodes that are not connected to the main document (generally these won't have a representation in the accessibility tree). Simplest example is document.createElement('div').ariaNotify()