Bug 208542 - Web Inspector: AXI: annotate tab panels
Summary: Web Inspector: AXI: annotate tab panels
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Nikita Vasilyev
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-03-03 15:44 PST by Nikita Vasilyev
Modified: 2020-03-05 19:57 PST (History)
4 users (show)

See Also:


Attachments
Patch (2.62 KB, patch)
2020-03-03 15:56 PST, Nikita Vasilyev
hi: review+
hi: commit-queue-
Details | Formatted Diff | Diff
Patch (3.10 KB, patch)
2020-03-05 16:43 PST, Nikita Vasilyev
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.