fizzstudio / svg-aria-test

Testing and reaching parity between HTML and SVG handling of ARIA
MIT License
0 stars 3 forks source link

SVG primitives and graphics-document #24

Open frankelavsky opened 3 years ago

frankelavsky commented 3 years ago

I want to be able to use role=graphics-document region in an SVG structure as well as role=graphics-object group and role=graphics-symbol img. These are based off of the WAI-ARIA Graphics Module.

We will need to develop scaffolding for this and also test these semantics across screen readers and browsers.

Notes: parent structure fallback is an unknown. It is possible that some fallbacks (such as region instead of document may produce better/worse outcomes). In addition, testing in isolation (without fallbacks) is recommended.

We would expect:

frankelavsky commented 3 years ago

Should we add a toggle to add/remove the role fallbacks? I feel like it might be important for testing, because the role fallbacks might actually be helping to compensate for issues that might arise with the base roles from the graphics module.

frankelavsky commented 2 years ago

Hi @shepazu, we need some clarification before testing: if a fallback role is supplied, is it correct for a screen reader to announce BOTH roles or only the first valid role?

When the role is "graphics-object group" which is correct role for a screen reader to announce: "graphics-object group" or "graphics-object"?

Voiceover (for example) does "graphics-object group" for our g elements and "image" for our child elements. Notably, Voiceover does "image" whether or not we supply fallbacks. This is very tricky to determine what is the correct treatment here!

CC'ing @shelbyelavsky for testing, since this will affect everything she does on this one.

shepazu commented 2 years ago

Should we add a toggle to add/remove the role fallbacks? I feel like it might be important for testing, because the role fallbacks might actually be helping to compensate for issues that might arise with the base roles from the graphics module.

Both scenarios should be tested. Rather than having a toggle, which adds complexity to the test framework, I suggest simply making 2 different versions of the test, one with fallbacks and one without. These could either be in the same file, or, more cleanly, in different files that refer/link to one another.

shepazu commented 2 years ago

Hi @shepazu, we need some clarification before testing: if a fallback role is supplied, is it correct for a screen reader to announce BOTH roles or only the first valid role?

When the role is "graphics-object group" which is correct role for a screen reader to announce: "graphics-object group" or "graphics-object"?

Voiceover (for example) does "graphics-object group" for our g elements and "image" for our child elements. Notably, Voiceover does "image" whether or not we supply fallbacks. This is very tricky to determine what is the correct treatment here!

CC'ing @shelbyelavsky for testing, since this will affect everything she does on this one.

To my understanding, an SR should only announce a single role, that is, the first one it understands. If it does understand (i.e. implement) graphics-object, then it should announce graphics-object; if it doesn't understand (i.e. implement) graphics-object, then it should announce group.

_Note that this is also the intent and interpretation by Steve Faulkner, who I trust implicitly; but also note that this may or may not be the behavior of SRs, at least as of 2015, as noted in that link. This is also described (obliquely) in the W3C spec._

We can test this with the behavior on an HTML element, with graphics-object group, or with another more well-known ARIA role like role="switch checkbox" (as mentioned by Faulkner). We may even want to have a small test for just that, to set baseline behavior for fallback treatment.

shelbyelavsky commented 2 years ago

I'm adding the recorded test videos for each browser/screen reader combinations here for easy access.

NVDA and Chrome

https://user-images.githubusercontent.com/98043076/156835042-b1ef1420-5484-4474-990c-cfdd7eb3e9b6.mp4

NVDA and Firefox

https://user-images.githubusercontent.com/98043076/156835048-a7fbec88-272e-4950-97d8-4d47ab49e14b.mp4

VoiceOver and Safari

https://user-images.githubusercontent.com/98043076/156835064-52c07616-ec7f-48af-993f-57a70e8a7650.mp4

JAWS and Chrome

https://user-images.githubusercontent.com/98043076/156835013-f2eb0274-b5c3-49d8-bd94-f5c895db3bf2.mp4