Pressing the space bar while watching a fullscreen video doesn't play or pause
https://bugs.webkit.org/show_bug.cgi?id=180033
<rdar://problem/
33610443>
Reviewed by Eric Carlson.
Source/WebCore:
We register a "keydown" event to track when the space bar is pressed, and if the media is playing
in fullscreen, we toggle playback. This does not interfere with full keyboard access since activating
one of the media controls using the keyboard will not let the events we register for be dispatched
this far along the event dispatch phase.
Test: media/modern-media-controls/media-controller/media-controller-space-bar-toggle-playback.html
* Modules/modern-media-controls/media/media-controller.js:
(MediaController):
(MediaController.prototype.togglePlayback): Add a catch() statement since calling play() could sometime
lead to some extraneous unhandled promise console logging that pollutes test output.
(MediaController.prototype.handleEvent):
LayoutTests:
Adding a new macOS-only test that checks that pressing the space bar while playing fullscreen
pauses the media and resumes it when pressing the space bar again.
* media/modern-media-controls/media-controller/media-controller-space-bar-toggle-playback-expected.txt: Added.
* media/modern-media-controls/media-controller/media-controller-space-bar-toggle-playback.html: Added.
* media/video-test.js:
(runWithKeyDown): Update the key to not be space since this would cause media to be paused when entering fullscreen.
* platform/ios-simulator/TestExpectations:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225265
268f45cc-cd09-0410-ab3c-
d52691b4dbfc