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 role=button #23

Open frankelavsky opened 2 years ago

frankelavsky commented 2 years ago

I want to be able to use role=button in combination with aria-pressed=true||false on an SVG primitive. NOTE: I also want to be able to use aria-selected as well but we will only be testing role=button for now (which is not compatible with aria-selected).

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

Notes: parent structure above the button is also an unknown. It is possible that some parent semantics will affect button and aria-pressed performance.

Should we use region -> group -> button? Figure -> group -> button? Graphics-document -> graphics-object -> button? Menu? Tree? Grid? Treegrid?

How do we make these elements accessible to keyboard-only users (users that do not leverage a screen reader)? tab-index, wrapped in an <a> element, javascript and custom keypress handling?

Expectations:

frankelavsky commented 2 years ago

I would ideally expect all possible combinations to work unless there is something somewhere that notes otherwise. I am also very curious how a text SVG primitive will perform across testing cases.

frankelavsky commented 2 years ago

This example should be ready for an initial pass of testing. One thing we want to consider as well: javascript-driven interactivity/navigation and not just a bunch of tab indices. But to keep the scope of testing small, we will just use tab index.

frankelavsky commented 2 years ago

I removed the dropdown in 499a8092d7396eba562d73fb53c0d7503b603314, but we may want to bring it back for this particular test based on the results of other tests. I also simplified the semantics/roles for this test as well in 32a46fbac4ccd75f2e304b450f3e7b2f2884952a.

frankelavsky commented 2 years ago

It is possible that tabindex is helping SRs navigate/recognize SVG elements with role=button -- we may want to consider including a toggle to add or remove the tabindex attribute from elements. If this works without any hiccups in testing, then I have some unanswered questions. Several other charting libraries out there utilize tabindex=-1, which could indicate that the attribute may be required even when javascript is used for navigation. Cc'ing @shepazu

shelbyelavsky commented 2 years ago

@frankelavsky After our conversation about the test and my initial findings, I was wondering if you could update the "Interaction instructions" to be more specific? For example,

"Move into the chart using TAB for keyboard only. If using a screen reader, navigate as normal. Then press SPACEBAR on an element to select it."

shelbyelavsky commented 2 years ago

@frankelavsky Hi! Mentioning the bug we found in the code that needs to be fixed. The aria pressed attribute is toggling on the parent element in the HTML section.

frankelavsky commented 2 years ago

Hi @shelbyelavsky, the issue with toggling should be fixed now. Thanks for the heads up!

shelbyelavsky commented 2 years ago

I'm noting here that there is a difference in behavior for the role=button test environment if you press TAB versus using a screen reader's built in navigation keys. It produces different results.

Since our goal is to focus on how SRs interact and explore SVGs, I will only be testing/recording using each screen reader's default arrow keys to navigate.

shelbyelavsky commented 2 years ago

Important note with VoiceOver and Safari: Pressing SPACE versus pressing VoiceOver's Control+Option+SPACE produces slightly different results. While they are similar - VO states "selected" when using their key press setting.

Therefore, I am using VoiceOver's default Control+Option+SPACE for selecting/interacting with the toggleable buttons during my tests.

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/161120396-13196f9e-db42-473b-9b4c-f8016fa501bb.mp4

https://user-images.githubusercontent.com/98043076/161120408-fa909f03-ae7f-4eee-8c9e-5bffa43bf916.mp4

NVDA and Firefox

https://user-images.githubusercontent.com/98043076/161120427-5ef6252b-4f2b-46fa-9b6c-a85c4ef42478.mp4

VoiceOver and Safari

https://user-images.githubusercontent.com/98043076/161120445-0ab8259a-e399-452a-ba8c-39b22b3d1f78.mp4

JAWS and Chrome

https://user-images.githubusercontent.com/98043076/161120328-2bef237b-feb4-48e3-961d-f850b6293c03.mp4

https://user-images.githubusercontent.com/98043076/161120349-3bfee67b-de28-4db7-be99-bc4699be4e02.mp4