Bug 171790 - AX: Video/Audio Player Controls missing group container.
Summary: AX: Video/Audio Player Controls missing group container.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: Safari 9
Hardware: All All
: P2 Normal
Assignee: Aaron Chu
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-05-07 03:46 PDT by Aaron Chu
Modified: 2017-06-12 15:37 PDT (History)
7 users (show)

See Also:


Attachments
Patch (9.01 KB, patch)
2017-05-07 04:02 PDT, Aaron Chu
no flags Details | Formatted Diff | Diff
Patch (9.31 KB, patch)
2017-06-06 16:48 PDT, Aaron Chu
no flags Details | Formatted Diff | Diff
Patch (9.32 KB, patch)
2017-06-06 17:00 PDT, Aaron Chu
no flags Details | Formatted Diff | Diff
Patch (22.06 KB, patch)
2017-06-08 01:04 PDT, Aaron Chu
no flags Details | Formatted Diff | Diff
Patch (21.21 KB, patch)
2017-06-08 10:29 PDT, Aaron Chu
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews107 for mac-elcapitan-wk2 (1.10 MB, application/zip)
2017-06-08 11:35 PDT, Build Bot
no flags Details
Patch (20.59 KB, patch)
2017-06-09 08:43 PDT, Aaron Chu
no flags Details | Formatted Diff | Diff
Patch for landing (20.51 KB, patch)
2017-06-12 14:52 PDT, Aaron Chu
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Aaron Chu 2017-05-07 03:46:22 PDT
<rdar://problem/32008994>
Comment 1 Aaron Chu 2017-05-07 04:02:54 PDT
Created attachment 309320 [details]
Patch
Comment 2 James Craig 2017-05-16 00:19:08 PDT
Comment on attachment 309320 [details]
Patch

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

> Source/WebCore/Modules/modern-media-controls/controls/media-controls.js:67
> +        if (value)
> +            this.controlsBar.element.setAttribute("aria-label", UIString("Audio Player"));
> +        else
> +            this.controlsBar.element.setAttribute("aria-label", UIString("Video Controls"));
> +    }

This is the place where I think it's appropriate to use aria-roledescription instead of aria-label. Since this is WebKit UI only, VoiceOver users are going to learn it quickly, and there is little benefit to hearing the generic "group" on predictable UI. The label could (eventually) come from a user-generated attribute on the shadow root <video> element. e.g. "foobar, video controls" 

Nit: the strings should be "… Player" or "… Controls" but not a mix of both.
Comment 3 James Craig 2017-05-16 00:21:26 PDT
(In reply to James Craig from comment #2)

> Nit: the strings should be "… Player" or "… Controls" but not a mix of both.

Looking back, I see those inconsistent strings came from me. ;-)
Comment 4 Aaron Chu 2017-06-06 16:48:39 PDT
Created attachment 312138 [details]
Patch
Comment 5 chris fleizach 2017-06-06 16:54:30 PDT
Comment on attachment 312138 [details]
Patch

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

> Source/WebCore/English.lproj/modern-media-controls-localized-strings.js:4
> +    "Audio Player": "Audio Controls",

these should be the same
Comment 6 Aaron Chu 2017-06-06 17:00:19 PDT
Created attachment 312139 [details]
Patch
Comment 7 Antoine Quint 2017-06-07 01:09:31 PDT
Comment on attachment 312139 [details]
Patch

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

> Source/WebCore/Modules/modern-media-controls/controls/media-controls.js:64
> +    set isAudio(value)

There already is a "shouldUseAudioLayout" property defined on InlineMediaControls, which is set from AudioSupport. We should promote it to MediaControls and augment it to perform the work you're doing here.
Comment 8 Aaron Chu 2017-06-08 01:04:03 PDT
Created attachment 312283 [details]
Patch
Comment 9 Antoine Quint 2017-06-08 06:54:40 PDT
Comment on attachment 312283 [details]
Patch

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

> Source/WebCore/Modules/modern-media-controls/controls/inline-media-controls.js:71
> +            this.bottomControlsBar.element.setAttribute("aria-label", UIString("Audio Controls"));

I don't quite follow these changes. Why do we do anything when the value doesn't change? Is it to set the aria-label for the default case? If so, I think this should be handled in the constructor. The code here would fail to set the "Video Controls" string if "shouldUseAudioLayout" goes from true to false.
Comment 10 Aaron Chu 2017-06-08 10:29:51 PDT
Created attachment 312318 [details]
Patch
Comment 11 Build Bot 2017-06-08 11:35:53 PDT
Comment on attachment 312318 [details]
Patch

Attachment 312318 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.webkit.org/results/3895159

New failing tests:
fast/mediastream/getUserMedia-grant-persistency.html
Comment 12 Build Bot 2017-06-08 11:35:55 PDT
Created attachment 312329 [details]
Archive of layout-test-results from ews107 for mac-elcapitan-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews107  Port: mac-elcapitan-wk2  Platform: Mac OS X 10.11.6
Comment 13 Antoine Quint 2017-06-09 00:35:37 PDT
Comment on attachment 312318 [details]
Patch

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

> Source/WebCore/Modules/modern-media-controls/controls/inline-media-controls.js:69
> +            this.bottomControlsBar.element.setAttribute("aria-label", UIString("Audio Controls"));

You should update the "aria-label" regardless of the value of `flag`:

this.bottomControlsBar.element.setAttribute("aria-label", flag ? UIString("Audio Controls") : UIString("Video Controls"));

I think the easiest thing is to split this in a dedicated method like so:

_updateBottomControlsBarLabel()
{
    this.bottomControlsBar.element.setAttribute("aria-label", this._shouldUseAudioLayout ? UIString("Audio Controls") : UIString("Video Controls"));
}

and call this in the constructor and in the `shouldUseAudioLayout` setter once the ivar has been set.
Comment 14 Aaron Chu 2017-06-09 08:43:51 PDT
Created attachment 312436 [details]
Patch
Comment 15 Antoine Quint 2017-06-09 19:04:16 PDT
Comment on attachment 312436 [details]
Patch

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

> Source/WebCore/Modules/modern-media-controls/controls/inline-media-controls.js:245
> +    updateBottomControlsBarLabel() {

This should be a private method, please move it down to a Private block and add a `_` prefix.
Comment 16 Aaron Chu 2017-06-12 14:52:43 PDT
Created attachment 312701 [details]
Patch for landing
Comment 17 WebKit Commit Bot 2017-06-12 15:37:10 PDT
Comment on attachment 312701 [details]
Patch for landing

Clearing flags on attachment: 312701

Committed r218145: <http://trac.webkit.org/changeset/218145>
Comment 18 WebKit Commit Bot 2017-06-12 15:37:12 PDT
All reviewed patches have been landed.  Closing bug.