Bug 163658 - AX: link to container with fragment identifier that has tabindex results in container not being read and ignored by VoiceOver
Summary: AX: link to container with fragment identifier that has tabindex results in c...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: Safari 10
Hardware: iPhone / iPad iOS 10
: P2 Normal
Assignee: Nobody
Keywords: InRadar
Depends on:
Blocks: 159753
  Show dependency treegraph
Reported: 2016-10-19 03:05 PDT by Patrick H. Lauke
Modified: 2022-02-08 23:09 PST (History)
5 users (show)

See Also:

Test case (5.52 KB, text/html)
2016-10-19 03:05 PDT, Patrick H. Lauke
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick H. Lauke 2016-10-19 03:05:03 PDT
Created attachment 292058 [details]
Test case

Due to focus management issues in some browsers, one common approach for skip links is to link to a container with an id that also has an explicit tabindex attribute, making it focusable.

<a href="#content">Skip to main content</a>
<div id="content" tabindex="-1">...</div>

However, it seems that this sort of (fairly common) skip link pattern breaks in iOS10/VoiceOver/Safari. Specifically, it seems that if the target container has a tabindex attribute, VoiceOver does move the accessibility focus to the container, but announces nothing. But more worryingly, it then seems to ignore that entire target container - swiping left/right simply jumps over that container as if it wasn't in the document at all (though if you swipe long enough to get into the Safari UI and back, it seems to usually sort itself out again).

This is making fairly common skip links (for instance, those used in Bootstrap-based sites, if they follow the advice given in the BS documentation) completely unusable.

See attached test case and the video at https://www.youtube.com/watch?v=JUlSav9Nm_4 (the first skip link works, but the other two skip links - to a <div id="..." tabindex="0"> and <div id="..." tabindex="-1"> - exhibit this broken behavior)
Comment 1 Radar WebKit Bug Importer 2016-10-19 03:05:18 PDT
Comment 2 Patrick H. Lauke 2016-10-19 05:18:03 PDT
Possibly worth noting: the reason why authors do set explicit tabindex is, among other things, this https://bugs.webkit.org/show_bug.cgi?id=116046 (to force keyboard interaction with skip links to work correctly)
Comment 3 James Craig 2016-10-19 08:27:19 PDT
Relating bug 158430
Comment 4 Keegan 2017-06-29 17:01:31 PDT
I am finding that even if the target does not have a tabindex attribute, VoiceOver highlights the target but does not read it, and then it ignores the target container completely.

Test case: https://codepen.io/keeganstreet/pen/VWyGyv
Comment 5 Brent Fulgham 2022-02-08 23:09:53 PST
This is actually being tracked under: