Bug 171715 - AX: Media Controls: Missing labels for the Time Labels.
Summary: AX: Media Controls: Missing labels for the Time Labels.
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-04 23:22 PDT by Aaron Chu
Modified: 2017-06-09 01:02 PDT (History)
6 users (show)

See Also:


Attachments
Patch (8.27 KB, patch)
2017-05-06 21:31 PDT, Aaron Chu
no flags Details | Formatted Diff | Diff
Patch (8.27 KB, patch)
2017-05-08 18:00 PDT, Aaron Chu
no flags Details | Formatted Diff | Diff
Patch (6.67 KB, patch)
2017-06-07 01:14 PDT, Aaron Chu
no flags Details | Formatted Diff | Diff
Patch (6.61 KB, patch)
2017-06-07 17:41 PDT, Aaron Chu
no flags Details | Formatted Diff | Diff
Patch (6.40 KB, patch)
2017-06-08 10:42 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-04 23:22:58 PDT
rdar://problem/32005192
Comment 1 Radar WebKit Bug Importer 2017-05-04 23:23:29 PDT
<rdar://problem/32009214>
Comment 2 Aaron Chu 2017-05-06 21:31:43 PDT
Created attachment 309317 [details]
Patch
Comment 3 chris fleizach 2017-05-08 17:07:37 PDT
Comment on attachment 309317 [details]
Patch

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

> Source/WebCore/ChangeLog:9
> +        Added descriptive labels to elapsed nad remaining time labels in modern media controls. 

nad -> and

> Source/WebCore/Modules/modern-media-controls/controls/time-label.js:37
> +            this.element.setAttribute("aria-roledescription", timerDescription); 

is role-description appropriate here? I would have thought remaining/elapsed would be more appropriate as the labels
Comment 4 Aaron Chu 2017-05-08 17:30:10 PDT
Comment on attachment 309317 [details]
Patch

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

>> Source/WebCore/Modules/modern-media-controls/controls/time-label.js:37
>> +            this.element.setAttribute("aria-roledescription", timerDescription); 
> 
> is role-description appropriate here? I would have thought remaining/elapsed would be more appropriate as the labels

I think so, because the label would be the time itself, remaining/elapsed serve to describe the timer.
Comment 5 Aaron Chu 2017-05-08 18:00:03 PDT
Created attachment 309450 [details]
Patch
Comment 6 James Craig 2017-05-09 23:30:31 PDT
<rdar://problem/32005192>
Comment 7 James Craig 2017-05-10 00:05:32 PDT
Comment on attachment 309450 [details]
Patch

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

> Source/WebCore/Modules/modern-media-controls/controls/time-label.js:37
> +            this.element.setAttribute("aria-roledescription", timerDescription); 

Let's use aria-label rather than roledescription here.

This seems like a solid attempt at reducing verbosity, but I believe it'd have some fallout. In a context where role description was unsupported (maybe Orca/Atk? or iTunes on Windows?), there would no way to distinguish the two timers.

> Source/WebCore/Modules/modern-media-controls/controls/time-label.js:65
> +                this.element.setAttribute("aria-label", formattedTime);

I think this label would duplicate the contents, so you'd hear something like "0:23, 0:23" in some browser+screenreader combinations (timers should speak both their label and value)

I believe the previous version used:
<span role="timer" aria-label="Remaining">0:23</span>

> LayoutTests/media/modern-media-controls/time-control/time-control.html:36
> +shouldBeEqualToString("timeControl.elapsedTimeLabel.element.getAttribute('aria-roledescription')", "Elapsed");
> +shouldBeEqualToString("timeControl.elapsedTimeLabel.element.getAttribute('role')", "timer");
>  shouldBe("timeControl.children[1]", "timeControl.scrubber");
>  shouldBe("timeControl.children[2]", "timeControl.remainingTimeLabel");
> +shouldBeEqualToString("timeControl.remainingTimeLabel.element.getAttribute('aria-roledescription')", "Remaining");
> +shouldBeEqualToString("timeControl.remainingTimeLabel.element.getAttribute('role')", "timer");

See if you can validate the accessible note properties here rather than the DOM attributes.
Comment 8 Aaron Chu 2017-06-06 17:06:38 PDT
<rdar://problem/32537359 >
Comment 9 Aaron Chu 2017-06-07 01:14:35 PDT
Created attachment 312166 [details]
Patch
Comment 10 Antoine Quint 2017-06-07 01:32:20 PDT
Comment on attachment 312166 [details]
Patch

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

> Source/WebCore/Modules/modern-media-controls/controls/time-label.js:74
> +            this.element.setAttribute("aria-label", `${ariaLabel}: ${timeAsString}`);

You can use `const` for these two since they don't change.

> LayoutTests/media/modern-media-controls/time-label/time-label.html:18
> +timeLabel.element.setAttribute("id", "elasped");

This is fine but you can shorten this to `timeLabel.element.id = "elapsed"`.

> LayoutTests/media/modern-media-controls/time-label/time-label.html:27
> +remainingTimeLabel.element.setAttribute("id", "remaining");

Same here about using the "id" property directly.

> LayoutTests/media/modern-media-controls/time-label/time-label.html:52
> +    finishMediaControlsTest(); 

Please remove that extra white space.
Comment 11 Aaron Chu 2017-06-07 17:41:33 PDT
Created attachment 312260 [details]
Patch
Comment 12 Antoine Quint 2017-06-08 06:58:52 PDT
Comment on attachment 312260 [details]
Patch

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

> LayoutTests/media/modern-media-controls/time-label/time-label.html:51
> +    

Remove this extra white space when committing.
Comment 13 Aaron Chu 2017-06-08 10:42:46 PDT
Created attachment 312319 [details]
Patch
Comment 14 WebKit Commit Bot 2017-06-09 01:02:08 PDT
Comment on attachment 312319 [details]
Patch

Clearing flags on attachment: 312319

Committed r217965: <http://trac.webkit.org/changeset/217965>
Comment 15 WebKit Commit Bot 2017-06-09 01:02:10 PDT
All reviewed patches have been landed.  Closing bug.