Diff
Modified: trunk/LayoutTests/ChangeLog (217964 => 217965)
--- trunk/LayoutTests/ChangeLog 2017-06-09 06:12:51 UTC (rev 217964)
+++ trunk/LayoutTests/ChangeLog 2017-06-09 08:02:04 UTC (rev 217965)
@@ -1,3 +1,15 @@
+2017-06-09 Aaron Chu <[email protected]>
+
+ AX: Media Controls: Missing labels for the Time Labels.
+ https://bugs.webkit.org/show_bug.cgi?id=171715
+ <rdar://problem/32009214>
+
+ Reviewed by Antoine Quint.
+
+ Modified existing test case to accommodate testing for time label description.
+
+ * media/modern-media-controls/time-label/time-label.html:
+
2017-06-08 Yoav Weiss <[email protected]>
[preload] Mandatory `as` value and related spec alignments
Modified: trunk/LayoutTests/media/modern-media-controls/time-label/time-label.html (217964 => 217965)
--- trunk/LayoutTests/media/modern-media-controls/time-label/time-label.html 2017-06-09 06:12:51 UTC (rev 217964)
+++ trunk/LayoutTests/media/modern-media-controls/time-label/time-label.html 2017-06-09 08:02:04 UTC (rev 217965)
@@ -15,6 +15,7 @@
shouldBeEqualToString("timeLabel.element.className", "time-label");
timeLabel.value = 1;
+timeLabel.element.id = "elasped";
const timeLabelWithNegativeValue = new TimeLabel;
timeLabelWithNegativeValue.value = -61;
@@ -22,10 +23,16 @@
const timeLabelWithHours = new TimeLabel;
timeLabelWithHours.value = 3661;
+const remainingTimeLabel = new TimeLabel(TimeLabel.Types.Remaining);
+remainingTimeLabel.element.id = "remaining";
+
let style;
+let elaspedLabel;
+let remainingLabel;
scheduler.frameDidFire = function()
{
document.body.appendChild(timeLabel.element);
+ document.body.appendChild(remainingTimeLabel.element);
style = window.getComputedStyle(timeLabel.element);
shouldBeEqualToString("style.position", "absolute");
@@ -32,6 +39,10 @@
shouldBeEqualToString("style.fontFamily", "-apple-system-monospaced-numbers");
shouldBeEqualToString("style.fontSize", "14px");
+ elaspedLabel = accessibilityController.accessibleElementById('elasped').description.split(": ")[1];
+ remainingLabel = accessibilityController.accessibleElementById('remaining').description.split(": ")[1];
+ shouldBeEqualToString("elaspedLabel", "Elapsed");
+ shouldBeEqualToString("remainingLabel", "Remaining");
timeLabel.element.remove();
shouldBeEqualToString("timeLabel.element.textContent", "00:01");
Modified: trunk/Source/WebCore/ChangeLog (217964 => 217965)
--- trunk/Source/WebCore/ChangeLog 2017-06-09 06:12:51 UTC (rev 217964)
+++ trunk/Source/WebCore/ChangeLog 2017-06-09 08:02:04 UTC (rev 217965)
@@ -1,3 +1,21 @@
+2017-06-09 Aaron Chu <[email protected]>
+
+ AX: Media Controls: Missing labels for the Time Labels.
+ https://bugs.webkit.org/show_bug.cgi?id=171715
+ <rdar://problem/32009214>
+
+ Reviewed by Antoine Quint.
+
+ Added aria-label to describe time labels in media controls.
+
+ * Modules/modern-media-controls/controls/slider.js:
+ (Slider.prototype.set inputAccessibleLabel):
+ (Slider.prototype._formatTime): Deleted.
+ * Modules/modern-media-controls/controls/time-label.js:
+ (TimeLabel.prototype.commitProperty):
+ * Modules/modern-media-controls/main.js:
+ (formatTimeToString):
+
2017-06-08 Carlos Garcia Campos <[email protected]>
Unreviewed. Fix unused parameter warning after r217955.
Modified: trunk/Source/WebCore/Modules/modern-media-controls/controls/slider.js (217964 => 217965)
--- trunk/Source/WebCore/Modules/modern-media-controls/controls/slider.js 2017-06-09 06:12:51 UTC (rev 217964)
+++ trunk/Source/WebCore/Modules/modern-media-controls/controls/slider.js 2017-06-09 08:02:04 UTC (rev 217965)
@@ -56,7 +56,7 @@
set inputAccessibleLabel(timeValue)
{
- this._input.element.setAttribute("aria-valuetext", this._formatTime(timeValue));
+ this._input.element.setAttribute("aria-valuetext", formatTimeToString(timeValue));
}
get disabled()
@@ -106,16 +106,6 @@
// Protected
- _formatTime(timeInSeconds)
- {
- const time = formatTimeByUnit(timeInSeconds);
- const timeStrings = [unitizeTime(time.minutes, "Minute"), unitizeTime(time.seconds, "Second")];
- if (time.hours > 0)
- timeStrings.unshift(unitizeTime(time.hours, "Hour"));
-
- return timeStrings.join(" ");
- }
-
handleEvent(event)
{
switch (event.type) {
Modified: trunk/Source/WebCore/Modules/modern-media-controls/controls/time-label.js (217964 => 217965)
--- trunk/Source/WebCore/Modules/modern-media-controls/controls/time-label.js 2017-06-09 06:12:51 UTC (rev 217964)
+++ trunk/Source/WebCore/Modules/modern-media-controls/controls/time-label.js 2017-06-09 08:02:04 UTC (rev 217965)
@@ -69,6 +69,9 @@
{
if (propertyName === "value") {
this.element.textContent = this._formattedTime();
+ const timeAsString = formatTimeToString(this.value);
+ const ariaLabel = (this._type === TimeLabel.Types.Remaining) ? UIString("Remaining") : UIString("Elapsed");
+ this.element.setAttribute("aria-label", `${ariaLabel}: ${timeAsString}`);
if (this.parent instanceof TimeControl)
this.parent.updateScrubberLabel();
}
Modified: trunk/Source/WebCore/Modules/modern-media-controls/main.js (217964 => 217965)
--- trunk/Source/WebCore/Modules/modern-media-controls/main.js 2017-06-09 06:12:51 UTC (rev 217964)
+++ trunk/Source/WebCore/Modules/modern-media-controls/main.js 2017-06-09 08:02:04 UTC (rev 217965)
@@ -66,3 +66,13 @@
return `${value} ${returnedUnit}`;
}
+
+function formatTimeToString(timeInSeconds)
+{
+ const time = formatTimeByUnit(timeInSeconds);
+ const timeStrings = [unitizeTime(time.minutes, "Minute"), unitizeTime(time.seconds, "Second")];
+ if (time.hours > 0)
+ timeStrings.unshift(unitizeTime(time.hours, "Hour"));
+
+ return timeStrings.join(" ");
+}