Title: [203669] trunk
Revision
203669
Author
n_w...@apple.com
Date
2016-07-24 12:53:53 -0700 (Sun, 24 Jul 2016)

Log Message

AX: Video Controls: Volume cannot be adjusted using VO.
https://bugs.webkit.org/show_bug.cgi?id=160107

Reviewed by Dean Jackson.

Source/WebCore:

The volume slider in video tag had 0.01 step which caused the screen reader adjusting it slowly.
Changed the step to 0.05 and added the aria-valuetext attribute to the slider, so that the value
is spoken in percentage.

Test: accessibility/mac/video-volume-slider-accessibility.html

* Modules/mediacontrols/mediaControlsApple.js:
(Controller.prototype.createControls):
(Controller.prototype.handleVolumeSliderInput):
(Controller.prototype.updateVolume):

LayoutTests:

* accessibility/mac/video-volume-slider-accessibility-expected.txt: Added.
* accessibility/mac/video-volume-slider-accessibility.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (203668 => 203669)


--- trunk/LayoutTests/ChangeLog	2016-07-24 18:59:29 UTC (rev 203668)
+++ trunk/LayoutTests/ChangeLog	2016-07-24 19:53:53 UTC (rev 203669)
@@ -1,3 +1,13 @@
+2016-07-24  Nan Wang  <n_w...@apple.com>
+
+        AX: Video Controls: Volume cannot be adjusted using VO.
+        https://bugs.webkit.org/show_bug.cgi?id=160107
+
+        Reviewed by Dean Jackson.
+
+        * accessibility/mac/video-volume-slider-accessibility-expected.txt: Added.
+        * accessibility/mac/video-volume-slider-accessibility.html: Added.
+
 2016-07-24  David Kilzer  <ddkil...@apple.com>
 
         REGRESSION (r203106): Crash in WebCore::MathMLElement::parseMathMLLength()

Added: trunk/LayoutTests/accessibility/mac/video-volume-slider-accessibility-expected.txt (0 => 203669)


--- trunk/LayoutTests/accessibility/mac/video-volume-slider-accessibility-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/accessibility/mac/video-volume-slider-accessibility-expected.txt	2016-07-24 19:53:53 UTC (rev 203669)
@@ -0,0 +1,12 @@
+
+This tests that video tag's volume slider has percentage value description and 0.05 step.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS slider.valueDescription is 'AXValueDescription: 100%'
+PASS slider.intValue.toFixed(2) is '0.95'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/accessibility/mac/video-volume-slider-accessibility.html (0 => 203669)


--- trunk/LayoutTests/accessibility/mac/video-volume-slider-accessibility.html	                        (rev 0)
+++ trunk/LayoutTests/accessibility/mac/video-volume-slider-accessibility.html	2016-07-24 19:53:53 UTC (rev 203669)
@@ -0,0 +1,50 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src=""
+<style>
+div.absolute {
+    position: absolute;
+    top: 0px;
+    left: 0px;
+    width: 400px;
+    height: 200px;
+    border: 1px solid #73AD21;
+}
+</style>
+</head>
+
+<body id="body">
+
+<div class="absolute" id="container" tabindex=0 id="region" title="region">
+<video id="video" width="400" height="200" controls>
+  <source src="" type="video/mp4">
+  Test Video.
+</video>
+</div>
+
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+
+    description("This tests that video tag's volume slider has percentage value description and 0.05 step.");
+
+    if (window.accessibilityController) {
+    
+          var video = accessibilityController.accessibleElementById("container").childAtIndex(0);
+          var slider = video.childAtIndex(0).childAtIndex(6);
+          
+          // First make sure the value description is in percentage.
+          shouldBe("slider.valueDescription", "'AXValueDescription: 100%'");
+          
+          // Then decrement the slider and check the step is 0.05.
+          slider.decrement();
+          shouldBe("slider.intValue.toFixed(2)", "'0.95'");
+}
+
+</script>
+
+<script src=""
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (203668 => 203669)


--- trunk/Source/WebCore/ChangeLog	2016-07-24 18:59:29 UTC (rev 203668)
+++ trunk/Source/WebCore/ChangeLog	2016-07-24 19:53:53 UTC (rev 203669)
@@ -1,3 +1,21 @@
+2016-07-24  Nan Wang  <n_w...@apple.com>
+
+        AX: Video Controls: Volume cannot be adjusted using VO.
+        https://bugs.webkit.org/show_bug.cgi?id=160107
+
+        Reviewed by Dean Jackson.
+
+        The volume slider in video tag had 0.01 step which caused the screen reader adjusting it slowly.
+        Changed the step to 0.05 and added the aria-valuetext attribute to the slider, so that the value
+        is spoken in percentage. 
+
+        Test: accessibility/mac/video-volume-slider-accessibility.html
+
+        * Modules/mediacontrols/mediaControlsApple.js:
+        (Controller.prototype.createControls):
+        (Controller.prototype.handleVolumeSliderInput):
+        (Controller.prototype.updateVolume):
+
 2016-07-24  David Kilzer  <ddkil...@apple.com>
 
         REGRESSION (r203106): Crash in WebCore::MathMLElement::parseMathMLLength()

Modified: trunk/Source/WebCore/Modules/mediacontrols/mediaControlsApple.js (203668 => 203669)


--- trunk/Source/WebCore/Modules/mediacontrols/mediaControlsApple.js	2016-07-24 18:59:29 UTC (rev 203668)
+++ trunk/Source/WebCore/Modules/mediacontrols/mediaControlsApple.js	2016-07-24 19:53:53 UTC (rev 203669)
@@ -475,7 +475,7 @@
         volume.type = 'range';
         volume.min = 0;
         volume.max = 1;
-        volume.step = .01;
+        volume.step = .05;
         this.listenFor(volume, 'input', this.handleVolumeSliderInput);
         this.listenFor(volume, 'mousedown', this.handleVolumeSliderMouseDown);
         this.listenFor(volume, 'mouseup', this.handleVolumeSliderMouseUp);
@@ -1163,6 +1163,7 @@
             this.controls.muteButton.setAttribute('aria-label', this.UIString('Mute'));
         }
         this.video.volume = this.controls.volume.value;
+        this.controls.volume.setAttribute('aria-valuetext', this.controls.volume.value * 100 + '%');
         this.drawVolumeBackground();
     },
 
@@ -2083,6 +2084,7 @@
             this.controls.muteButton.classList.remove(this.ClassNames.muted);
             this.controls.volume.value = this.video.volume;
         }
+        this.controls.volume.setAttribute('aria-valuetext', this.controls.volume.value * 100 + '%');
         this.drawVolumeBackground();
     },
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to