Bug 208542

Summary: Web Inspector: AXI: annotate tab panels
Product: WebKit Reporter: Nikita Vasilyev <nvasilyev>
Component: Web InspectorAssignee: Nikita Vasilyev <nvasilyev>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, hi, inspector-bugzilla-changes, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
hi: review+, hi: commit-queue-
Patch none

Description Nikita Vasilyev 2020-03-03 15:44:33 PST
With tab panels annotated, VoiceOver reads tab name the 1st time focusing on any element within it.

Steps:
1. Open Elements tab
2. Focus on any DOM tree outline item

Expected:
VoiceOver read the selected tree outline item and then "Elements, tab panel".
After that, changing focus to any other element within the Elements tab doesn't not result VoiceOver reading "Elements, tab panel" again.

Actual:
VoiceOver read the selected tree outline item — nothing about the Elements tab.
Comment 1 Nikita Vasilyev 2020-03-03 15:56:19 PST
Created attachment 392344 [details]
Patch
Comment 2 Radar WebKit Bug Importer 2020-03-03 15:56:43 PST
<rdar://problem/60017450>
Comment 3 Devin Rousso 2020-03-05 16:06:23 PST
Comment on attachment 392344 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=392344&action=review

r=me

> Source/WebInspectorUI/ChangeLog:3
> +        Web Inspector: AXI: annotate tab panels

Please add an explanation as to why `role="main"` is not sufficient, and why `role="tabpanel"` is better.

> Source/WebInspectorUI/UserInterface/Base/Main.js:1822
> +    WI._contentElement.ariaLabel = WI.tabBar.selectedTabBarItem?.title || "";

Rather than check `WI.tabBar.selectedTabBarItem` more than once, why not pull it out into a variable and share it with the check below?
```
    let selectedTabBarItem = WI.tabBar.selectedTabBarItem;
    if (selectedTabBarItem) {
        WI._contentElement.ariaLabel = selectedTabBarItem.title || "";

        if (selectedTabBarItem.representedObject.constructor.shouldSaveTab())
            WI._selectedTabIndexSetting.value = WI.tabBar.tabBarItems.indexOf(selectedTabBarItem);
```
Comment 4 Nikita Vasilyev 2020-03-05 16:43:01 PST
Created attachment 392647 [details]
Patch
Comment 5 WebKit Commit Bot 2020-03-05 19:57:35 PST
Comment on attachment 392647 [details]
Patch

Clearing flags on attachment: 392647

Committed r257965: <https://trac.webkit.org/changeset/257965>
Comment 6 WebKit Commit Bot 2020-03-05 19:57:37 PST
All reviewed patches have been landed.  Closing bug.