Changeset 200441 in webkit
- Timestamp:
- May 4, 2016, 5:05:47 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r200435 r200441 1 2016-05-04 Aaron Chu <aaron_chu@apple.com> 2 3 AX: Nonfunctional controls appear before every HTML5 video when using VoiceOver 4 https://bugs.webkit.org/show_bug.cgi?id=153089 5 <rdar://problem/24050668> 6 7 Reviewed by Dean Jackson. 8 9 * media/video-controls-show-on-kb-or-ax-event-expected.txt: 10 * media/video-controls-show-on-kb-or-ax-event.html: 11 12 A Layout Test to make sure showControls Button in media player is hidden by default. 13 1 14 2016-05-04 Dean Jackson <dino@apple.com> 2 15 -
trunk/LayoutTests/media/video-controls-show-on-kb-or-ax-event-expected.txt
r188182 r200441 1 This tests that, after the video controls fade out, they can be shown when VoiceOver or a keyboard user clicks the hidden "Show Controls" button. 1 This tests: 2 1. Initially, toolbar is visible, "Show Controls" button is not. 3 2. After the video controls fade out, they can be shown when VoiceOver or a keyboard user clicks the invisible "Show Controls" button. 4 3. When the video is paused, the controls become visible and the "Show Controls" button is hidden. 2 5 3 6 PASS 7 PASS 8 PASS 9 PASS 10 PASS 11 PASS 12 PASS 13 PASS 4 14 5 6 -
trunk/LayoutTests/media/video-controls-show-on-kb-or-ax-event.html
r188213 r200441 1 <body >1 <body onload="initialChecksBeforePlay()"> 2 2 <p> 3 This tests that, after the video controls fade out, they can be shown when VoiceOver or a keyboard user clicks the hidden "Show Controls" button. 3 This tests:<br> 4 1. Initially, toolbar is visible, "Show Controls" button is not.<br> 5 2. After the video controls fade out, they can be shown when VoiceOver or a keyboard user clicks the invisible "Show Controls" button.<br> 6 3. When the video is paused, the controls become visible and the "Show Controls" button is hidden.<br> 4 7 </p> 8 9 <video id="video" controls onplaying="testPlaying()" onpause="testPausing()" src="content/long-test.mp4"></video><br> 10 5 11 <p id="result"> 6 12 FAIL: Test did not run.<br> 7 13 </p> 8 <video id="video" controls autoplay onplaying="playing()" src="content/long-test.mp4"></video><br>9 14 <script> 10 15 if (window.testRunner) { … … 13 18 } 14 19 15 function playing() { 20 var result = document.getElementById("result"); 21 result.innerHTML = ""; 22 // Initially, the showControls Button should be hidden. 23 var root = internals.shadowRoot(document.getElementById("video")); 24 var button = root.firstChild.querySelector('button'); 25 var controls = root.firstChild.querySelector('[role="toolbar"]'); 26 var video = document.getElementById('video'); 16 27 17 // Mouse over the video then mouse out to hide controls more quickly. 18 eventSender.mouseMoveTo(100,100); 19 eventSender.mouseMoveTo(1,1); 28 function isElementHidden(elem) { 29 return (elem.hidden && getComputedStyle(elem).display === 'none') 30 } 31 function initialChecksBeforePlay() { 32 // Before we start, check to make sure toolbar is in place and showControlsbutton is hidden. 33 result.innerHTML += (!isElementHidden(controls))? 'PASS<br>': 'FAIL: Controls are not available at the beginning.<br>'; 34 result.innerHTML += (isElementHidden(button))? 'PASS<br>': 'FAIL: "Show Controls" button is not hidden initially.<br>'; 20 35 36 video.play(); 37 } 38 39 function testPlaying() { 40 // Make sure we are getting the updated root and button. 41 root = internals.shadowRoot(document.getElementById("video")); 42 43 // We give it a 100ms buffer for the video to set all the properties before sending mouse events. 44 setTimeout(function () { 45 // Mouse over the video then mouse out to hide controls more quickly. 46 eventSender.mouseMoveTo(150,150); 47 eventSender.mouseMoveTo(0,0); 48 }, 100); 49 50 // 300ms after the mouse events, all UI changes should complete and we can start making assertions. 21 51 setTimeout(function() { 22 var result = document.getElementById("result"); 23 result.innerHTML = ""; 24 var root = internals.shadowRoot(document.getElementById("video")) 25 26 var button = root.firstChild.querySelector('button'); 27 if (button) { 52 // Make sure we are getting the latest copy of the element. 53 controls = root.firstChild.querySelector('[role="toolbar"]'); 54 result.innerHTML += !controls? 'PASS<br>': 'FAIL: Toolbar still around after mouseout.<br>'; 55 56 // Make sure we are getting the latest copy of the element. 57 button = root.firstChild.querySelector('button'); 58 result.innerHTML += !isElementHidden(button)? 'PASS<br>': 'FAIL: Button should be visible.<br>'; 59 60 if(button && !isElementHidden(button)) { 28 61 button.focus(); 29 eventSender.keyDown(' '); // Use keyboard to press the selected button.30 } else 31 result.innerHTML += 'FAIL: "Show Controls" button is not available.<br>';62 eventSender.keyDown(' '); 63 } else 64 result.innerHTML += 'FAIL: "Show Controls" button is hidden or unavailable.<br>'; 32 65 33 // Verifies the toolbar is back in the DOM. 34 var controls = root.firstChild.querySelector('[role="toolbar"]'); 35 result.innerHTML += controls ? 'PASS': 'FAIL: Test ending, but toolbar is not visible.'; 66 // Make sure we are getting the latest copy of the element. 67 controls = root.firstChild.querySelector('[role="toolbar"]'); 68 result.innerHTML += controls? 'PASS<br>': 'FAIL: Toolbar should exist<br>'; 69 70 eventSender.mouseMoveTo(150,150); 71 eventSender.mouseMoveTo(0,0); 72 73 setTimeout(function () { 74 controls = root.firstChild.querySelector('[role="toolbar"]'); 75 result.innerHTML += !controls? 'PASS<br>': 'FAIL: Toolbar should not exist<br>'; 76 // We are done testing playing state, moving on to testing the paused state. 77 video.pause(); 78 }, 300); 79 }, 400); 80 } 81 82 function testPausing() { 83 // We are giving 100ms + 300s buffer for the video to set its properties and make UI changes. 84 setTimeout(function () { 85 controls = root.firstChild.querySelector('[role="toolbar"]'); 86 result.innerHTML += controls? 'PASS<br>': 'FAIL: Toolbar should exist<br>'; 87 88 button = root.firstChild.querySelector('button'); 89 result.innerHTML += isElementHidden(button)? 'PASS<br>': 'FAIL: Button should not be visible.<br>'; 36 90 37 91 testRunner.notifyDone(); 38 }, 300) // Wait for video toolbar to hide.92 }, 400); 39 93 } 40 94 </script> -
trunk/Source/WebCore/ChangeLog
r200435 r200441 1 2016-05-04 Aaron Chu <aaron_chu@apple.com> 2 3 AX: Nonfunctional controls appear before every HTML5 video when using VoiceOver 4 https://bugs.webkit.org/show_bug.cgi?id=153089 5 <rdar://problem/24050668> 6 7 Reviewed by Dean Jackson. 8 9 Test: media/video-controls-show-on-kb-or-ax-event.html 10 11 * Modules/mediacontrols/mediaControlsApple.js: 12 (Controller): 13 (Controller.prototype.createControls): 14 (Controller.prototype.updateControls): 15 (Controller.prototype.handlePlayButtonClicked): 16 (Controller.prototype.setPlaying): 17 (Controller.prototype.showShowControlsButton): 18 (Controller.prototype.showControls): 19 (Controller.prototype.hideControls): 20 * Modules/mediacontrols/mediaControlsiOS.js: 21 (ControllerIOS.prototype.addStartPlaybackControls): 22 (ControllerIOS.prototype.handleStartPlaybackButtonTouchEnd): 23 (ControllerIOS.prototype.showControls): 24 25 Fix to make sure the showControls button in a media player behaves correctly. 26 1 27 2016-05-04 Dean Jackson <dino@apple.com> 2 28 -
trunk/Source/WebCore/Modules/mediacontrols/mediaControlsApple.js
r197005 r200441 14 14 this.statusHidden = true; 15 15 this.hasWirelessPlaybackTargets = false; 16 this.canToggleShowControlsButton = false; 16 17 this.isListeningForPlaybackTargetAvailabilityEvent = false; 17 18 this.currentTargetIsWireless = false; … … 513 514 var showControlsButton = this.showControlsButton = document.createElement('button'); 514 515 showControlsButton.setAttribute('pseudo', '-webkit-media-show-controls'); 515 showControlsButton.hidden = true;516 this.showShowControlsButton(false); 516 517 showControlsButton.setAttribute('aria-label', this.UIString('Show Controls')); 517 518 this.listenFor(showControlsButton, 'click', this.handleShowControlsClick); … … 648 649 this.controls.panel.classList.remove(this.ClassNames.hidden); 649 650 this.resetHideControlsTimer(); 651 this.showShowControlsButton(false); 650 652 } else { 651 653 this.controls.panel.classList.remove(this.ClassNames.show); 652 654 this.controls.panel.classList.add(this.ClassNames.hidden); 655 this.showShowControlsButton(true); 653 656 } 654 657 }, … … 988 991 handlePlayButtonClicked: function(event) 989 992 { 990 if (this.canPlay()) 993 if (this.canPlay()) { 994 this.canToggleShowControlsButton = true; 991 995 this.video.play(); 992 else996 } else 993 997 this.video.pause(); 994 998 return true; … … 1497 1501 this.controls.playButton.setAttribute('aria-label', this.UIString('Pause')); 1498 1502 this.resetHideControlsTimer(); 1503 this.canToggleShowControlsButton = true; 1499 1504 } 1500 1505 }, … … 1516 1521 }, 1517 1522 1523 showShowControlsButton: function (shouldShow) { 1524 this.showControlsButton.hidden = !shouldShow; 1525 if (shouldShow) 1526 this.showControlsButton.focus(); 1527 }, 1528 1518 1529 showControls: function(focusControls) 1519 1530 { … … 1529 1540 this.controls.playButton.focus(); 1530 1541 } 1531 this.show ControlsButton.hidden = true;1542 this.showShowControlsButton(false); 1532 1543 }, 1533 1544 … … 1542 1553 if (this.controls.panelBackground) 1543 1554 this.controls.panelBackground.classList.remove(this.ClassNames.show); 1544 this.show ControlsButton.hidden = false;1555 this.showShowControlsButton(this.isPlayable() && this.isPlaying && this.canToggleShowControlsButton); 1545 1556 }, 1546 1557 -
trunk/Source/WebCore/Modules/mediacontrols/mediaControlsiOS.js
r199213 r200441 148 148 addStartPlaybackControls: function() { 149 149 this.base.appendChild(this.controls.startPlaybackButton); 150 this.showShowControlsButton(false); 150 151 }, 151 152 … … 442 443 443 444 this.video.play(); 445 this.canToggleShowControlsButton = true; 444 446 this.updateControls(); 445 447 … … 523 525 this.base.appendChild(this.controls.inlinePlaybackPlaceholder); 524 526 this.base.appendChild(this.controls.panelContainer); 527 this.showShowControlsButton(false); 525 528 } 526 529 },
Note:
See TracChangeset
for help on using the changeset viewer.