[Modern Media Controls] Add rewind and fast-forward support
authorgraouts@webkit.org <graouts@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 Dec 2016 22:36:50 +0000 (22:36 +0000)
committergraouts@webkit.org <graouts@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 Dec 2016 22:36:50 +0000 (22:36 +0000)
commit8e09ea3db80902b80aba518c52c3f94af8a0cf97
treec12d793971627294459e8d108833bbe04721f9c9
parentf887560c1387577e5312b38de2a550646ea8508d
[Modern Media Controls] Add rewind and fast-forward support
https://bugs.webkit.org/show_bug.cgi?id=165294

Reviewed by Dean Jackson.

We implement support for rewinding and fast-forwarding the media by pressing dedicated
buttons in fullscreen on macOS. We introduce a new SeekButton class that the existing
RewindButton and ForwardButton classes now extend and which provides handling of
"mousedown" and "mouseup" events to indicate that a button is being pressed to the
UI delegate.

We also introduce a new SeekSupport class from which SeekBackwardSupport and
SeekForwardSupport inherit to integrate with those controls and update the media
time.

Tests: media/modern-media-controls/layout-node/layout-node-parent-of-type.html
       media/modern-media-controls/seek-backward-support/seek-backward-support.html
       media/modern-media-controls/seek-forward-support/seek-forward-support.html

* Modules/modern-media-controls/controls/forward-button.js:
* Modules/modern-media-controls/controls/layout-node.js:
(LayoutNode.prototype.parentOfType):
* Modules/modern-media-controls/controls/rewind-button.js:
* Modules/modern-media-controls/controls/seek-button.js: Added.
(SeekButton):
(SeekButton.prototype.handleEvent):
(SeekButton.prototype._didStartPressing):
(SeekButton.prototype._didStopPressing):
(SeekButton.prototype._notifyDelegateOfPressingState):
* Modules/modern-media-controls/js-files:
* Modules/modern-media-controls/media/media-controller.js:
(MediaController.prototype._updateControlsIfNeeded):
* Modules/modern-media-controls/media/seek-backward-support.js: Added.
(SeekBackwardSupport.prototype.get control):
(SeekBackwardSupport.prototype.get multiplier):
(SeekBackwardSupport):
* Modules/modern-media-controls/media/seek-forward-support.js: Added.
(SeekForwardSupport.prototype.get control):
(SeekForwardSupport.prototype.get multiplier):
(SeekForwardSupport):
* Modules/modern-media-controls/media/seek-support.js: Added.
(SeekSupport.prototype.get multiplier):
(SeekSupport.prototype.buttonPressedStateDidChange):
(SeekSupport.prototype._startSeeking):
(SeekSupport.prototype._stopSeeking):
(SeekSupport.prototype._seek):
(SeekSupport):
* WebCore.xcodeproj/project.pbxproj:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209271 268f45cc-cd09-0410-ab3c-d52691b4dbfc
22 files changed:
LayoutTests/ChangeLog
LayoutTests/media/modern-media-controls/forward-button/forward-button.html
LayoutTests/media/modern-media-controls/layout-node/layout-node-parent-of-type-expected.txt [new file with mode: 0644]
LayoutTests/media/modern-media-controls/layout-node/layout-node-parent-of-type.html [new file with mode: 0644]
LayoutTests/media/modern-media-controls/rewind-button/rewind-button.html
LayoutTests/media/modern-media-controls/seek-backward-support/seek-backward-support-expected.txt [new file with mode: 0644]
LayoutTests/media/modern-media-controls/seek-backward-support/seek-backward-support.html [new file with mode: 0644]
LayoutTests/media/modern-media-controls/seek-forward-support/seek-forward-support-expected.txt [new file with mode: 0644]
LayoutTests/media/modern-media-controls/seek-forward-support/seek-forward-support.html [new file with mode: 0644]
LayoutTests/platform/ios-simulator/TestExpectations
LayoutTests/platform/mac/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/Modules/modern-media-controls/controls/forward-button.js
Source/WebCore/Modules/modern-media-controls/controls/layout-node.js
Source/WebCore/Modules/modern-media-controls/controls/rewind-button.js
Source/WebCore/Modules/modern-media-controls/controls/seek-button.js [new file with mode: 0644]
Source/WebCore/Modules/modern-media-controls/js-files
Source/WebCore/Modules/modern-media-controls/media/media-controller.js
Source/WebCore/Modules/modern-media-controls/media/seek-backward-support.js [new file with mode: 0644]
Source/WebCore/Modules/modern-media-controls/media/seek-forward-support.js [new file with mode: 0644]
Source/WebCore/Modules/modern-media-controls/media/seek-support.js [new file with mode: 0644]
Source/WebCore/WebCore.xcodeproj/project.pbxproj