[Modern Media Controls] Media Controller: scrubbing support
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 28 Oct 2016 09:40:44 +0000 (09:40 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 28 Oct 2016 09:40:44 +0000 (09:40 +0000)
https://bugs.webkit.org/show_bug.cgi?id=163726
<rdar://problem/27989481>

Patch by Antoine Quint <graouts@apple.com> on 2016-10-28
Reviewed by Dean Jackson.

Source/WebCore:

We introduce the ScrubberSupport class which brings support for scrubbing the media
by interacting with the scrubber in the media controls and correctly reflecting
the media's current time as set via the media API.

Tests: media/modern-media-controls/scrubber-support/scrubber-support-click.html
       media/modern-media-controls/scrubber-support/scrubber-support-drag.html
       media/modern-media-controls/scrubber-support/scrubber-support-media-api.html

* Modules/modern-media-controls/js-files:
* Modules/modern-media-controls/media/media-controller.js:
(MediaController):
* Modules/modern-media-controls/media/scrubbing-support.js: Added.
(ScrubbingSupport.prototype.get control):
(ScrubbingSupport.prototype.get mediaEvents):
(ScrubbingSupport.prototype.controlValueWillStartChanging):
(ScrubbingSupport.prototype.controlValueDidChange):
(ScrubbingSupport.prototype.controlValueDidStopChanging):
(ScrubbingSupport.prototype.syncControl):
(ScrubbingSupport):
* WebCore.xcodeproj/project.pbxproj:

LayoutTests:

Adding new tests for ScrubberSupport that test clicking in the scrubber,
dragging the scrubber and setting the media currentTime via the media API.
Also adding the new resource to other MediaController tests.

* http/tests/media/modern-media-controls/skip-back-support/skip-back-support-button-click.html:
* media/modern-media-controls/elapsed-time-support/elapsed-time-support.html:
* media/modern-media-controls/media-controller/media-controller-constructor.html:
* media/modern-media-controls/media-controller/media-controller-resize.html:
* media/modern-media-controls/mute-support/mute-support-button-click.html:
* media/modern-media-controls/mute-support/mute-support-media-api.html:
* media/modern-media-controls/mute-support/mute-support-muted.html:
* media/modern-media-controls/playback-support/playback-support-autoplay.html:
* media/modern-media-controls/playback-support/playback-support-button-click.html:
* media/modern-media-controls/playback-support/playback-support-media-api.html:
* media/modern-media-controls/remaining-time-support/remaining-time-support.html:
* media/modern-media-controls/scrubber-support/scrubber-support-click-expected.txt: Added.
* media/modern-media-controls/scrubber-support/scrubber-support-click.html: Added.
* media/modern-media-controls/scrubber-support/scrubber-support-drag-expected.txt: Added.
* media/modern-media-controls/scrubber-support/scrubber-support-drag.html: Added.
* media/modern-media-controls/scrubber-support/scrubber-support-media-api-expected.txt: Added.
* media/modern-media-controls/scrubber-support/scrubber-support-media-api.html: Added.
* media/modern-media-controls/start-support/start-support-audio.html:
* media/modern-media-controls/start-support/start-support-autoplay.html:
* media/modern-media-controls/start-support/start-support-click-to-start.html:
* media/modern-media-controls/start-support/start-support-error.html:
* media/modern-media-controls/start-support/start-support-fullscreen.html:
* media/modern-media-controls/start-support/start-support-manual-play.html:
* media/modern-media-controls/start-support/start-support-no-source.html:
* platform/ios-simulator/TestExpectations:
* platform/mac/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@208042 268f45cc-cd09-0410-ab3c-d52691b4dbfc

32 files changed:
LayoutTests/ChangeLog
LayoutTests/http/tests/media/modern-media-controls/skip-back-support/skip-back-support-button-click.html
LayoutTests/media/modern-media-controls/elapsed-time-support/elapsed-time-support.html
LayoutTests/media/modern-media-controls/media-controller/media-controller-constructor.html
LayoutTests/media/modern-media-controls/media-controller/media-controller-resize.html
LayoutTests/media/modern-media-controls/mute-support/mute-support-button-click.html
LayoutTests/media/modern-media-controls/mute-support/mute-support-media-api.html
LayoutTests/media/modern-media-controls/mute-support/mute-support-muted.html
LayoutTests/media/modern-media-controls/playback-support/playback-support-autoplay.html
LayoutTests/media/modern-media-controls/playback-support/playback-support-button-click.html
LayoutTests/media/modern-media-controls/playback-support/playback-support-media-api.html
LayoutTests/media/modern-media-controls/remaining-time-support/remaining-time-support.html
LayoutTests/media/modern-media-controls/scrubber-support/scrubber-support-click-expected.txt [new file with mode: 0644]
LayoutTests/media/modern-media-controls/scrubber-support/scrubber-support-click.html [new file with mode: 0644]
LayoutTests/media/modern-media-controls/scrubber-support/scrubber-support-drag-expected.txt [new file with mode: 0644]
LayoutTests/media/modern-media-controls/scrubber-support/scrubber-support-drag.html [new file with mode: 0644]
LayoutTests/media/modern-media-controls/scrubber-support/scrubber-support-media-api-expected.txt [new file with mode: 0644]
LayoutTests/media/modern-media-controls/scrubber-support/scrubber-support-media-api.html [new file with mode: 0644]
LayoutTests/media/modern-media-controls/start-support/start-support-audio.html
LayoutTests/media/modern-media-controls/start-support/start-support-autoplay.html
LayoutTests/media/modern-media-controls/start-support/start-support-click-to-start.html
LayoutTests/media/modern-media-controls/start-support/start-support-error.html
LayoutTests/media/modern-media-controls/start-support/start-support-fullscreen.html
LayoutTests/media/modern-media-controls/start-support/start-support-manual-play.html
LayoutTests/media/modern-media-controls/start-support/start-support-no-source.html
LayoutTests/platform/ios-simulator/TestExpectations
LayoutTests/platform/mac/TestExpectations
Source/WebCore/ChangeLog
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/scrubbing-support.js [new file with mode: 0644]
Source/WebCore/WebCore.xcodeproj/project.pbxproj

index 6016ca4..9995031 100644 (file)
@@ -1,3 +1,42 @@
+2016-10-28  Antoine Quint  <graouts@apple.com>
+
+        [Modern Media Controls] Media Controller: scrubbing support
+        https://bugs.webkit.org/show_bug.cgi?id=163726
+        <rdar://problem/27989481>
+
+        Reviewed by Dean Jackson.
+
+        Adding new tests for ScrubberSupport that test clicking in the scrubber,
+        dragging the scrubber and setting the media currentTime via the media API.
+        Also adding the new resource to other MediaController tests.
+
+        * http/tests/media/modern-media-controls/skip-back-support/skip-back-support-button-click.html:
+        * media/modern-media-controls/elapsed-time-support/elapsed-time-support.html:
+        * media/modern-media-controls/media-controller/media-controller-constructor.html:
+        * media/modern-media-controls/media-controller/media-controller-resize.html:
+        * media/modern-media-controls/mute-support/mute-support-button-click.html:
+        * media/modern-media-controls/mute-support/mute-support-media-api.html:
+        * media/modern-media-controls/mute-support/mute-support-muted.html:
+        * media/modern-media-controls/playback-support/playback-support-autoplay.html:
+        * media/modern-media-controls/playback-support/playback-support-button-click.html:
+        * media/modern-media-controls/playback-support/playback-support-media-api.html:
+        * media/modern-media-controls/remaining-time-support/remaining-time-support.html:
+        * media/modern-media-controls/scrubber-support/scrubber-support-click-expected.txt: Added.
+        * media/modern-media-controls/scrubber-support/scrubber-support-click.html: Added.
+        * media/modern-media-controls/scrubber-support/scrubber-support-drag-expected.txt: Added.
+        * media/modern-media-controls/scrubber-support/scrubber-support-drag.html: Added.
+        * media/modern-media-controls/scrubber-support/scrubber-support-media-api-expected.txt: Added.
+        * media/modern-media-controls/scrubber-support/scrubber-support-media-api.html: Added.
+        * media/modern-media-controls/start-support/start-support-audio.html:
+        * media/modern-media-controls/start-support/start-support-autoplay.html:
+        * media/modern-media-controls/start-support/start-support-click-to-start.html:
+        * media/modern-media-controls/start-support/start-support-error.html:
+        * media/modern-media-controls/start-support/start-support-fullscreen.html:
+        * media/modern-media-controls/start-support/start-support-manual-play.html:
+        * media/modern-media-controls/start-support/start-support-no-source.html:
+        * platform/ios-simulator/TestExpectations:
+        * platform/mac/TestExpectations:
+
 2016-10-27  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
 
         [EFL] Skip media test for a while
index 0475a2e..4eba347 100644 (file)
@@ -30,6 +30,7 @@
 <script src="/modern-media-controls/media/mute-support.js" type="text/javascript"></script>
 <script src="/modern-media-controls/media/playback-support.js" type="text/javascript"></script>
 <script src="/modern-media-controls/media/remaining-time-support.js" type="text/javascript"></script>
+<script src="/modern-media-controls/media/scrubbing-support.js" type="text/javascript"></script>
 <script src="/modern-media-controls/media/skip-back-support.js" type="text/javascript"></script>
 <script src="/modern-media-controls/media/start-support.js" type="text/javascript"></script>
 <script src="/modern-media-controls/media/media-controller.js" type="text/javascript"></script>
index bc047e5..6cc6cc7 100644 (file)
@@ -6,7 +6,6 @@
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/buttons-container.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/icon-service.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/start-button.js" type="text/javascript"></script>
-<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/status-label.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/icon-button.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/play-pause-button.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/skip-back-button.js" type="text/javascript"></script>
@@ -31,6 +30,7 @@
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/mute-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/playback-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/remaining-time-support.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/media/scrubbing-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/skip-back-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/start-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/media-controller.js" type="text/javascript"></script>
index f543c93..fc559ee 100644 (file)
@@ -30,6 +30,7 @@
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/mute-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/playback-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/remaining-time-support.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/media/scrubbing-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/skip-back-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/start-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/media-controller.js" type="text/javascript"></script>
index f18a19b..95fe38d 100644 (file)
@@ -30,6 +30,7 @@
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/mute-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/playback-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/remaining-time-support.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/media/scrubbing-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/skip-back-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/start-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/media-controller.js" type="text/javascript"></script>
index 3f0e3ec..5b40e04 100644 (file)
@@ -30,6 +30,7 @@
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/mute-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/playback-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/remaining-time-support.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/media/scrubbing-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/skip-back-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/start-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/media-controller.js" type="text/javascript"></script>
index 0f12a62..e16be1a 100644 (file)
@@ -30,6 +30,7 @@
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/mute-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/playback-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/remaining-time-support.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/media/scrubbing-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/skip-back-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/start-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/media-controller.js" type="text/javascript"></script>
index f926f7d..5252c32 100644 (file)
@@ -30,6 +30,7 @@
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/mute-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/playback-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/remaining-time-support.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/media/scrubbing-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/skip-back-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/start-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/media-controller.js" type="text/javascript"></script>
index 4b305f6..05e3681 100644 (file)
@@ -6,7 +6,6 @@
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/buttons-container.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/icon-service.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/start-button.js" type="text/javascript"></script>
-<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/status-label.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/icon-button.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/play-pause-button.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/skip-back-button.js" type="text/javascript"></script>
@@ -31,6 +30,7 @@
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/mute-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/playback-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/remaining-time-support.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/media/scrubbing-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/skip-back-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/start-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/media-controller.js" type="text/javascript"></script>
index 1433f59..0b41984 100644 (file)
@@ -6,7 +6,6 @@
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/buttons-container.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/icon-service.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/start-button.js" type="text/javascript"></script>
-<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/status-label.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/icon-button.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/play-pause-button.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/skip-back-button.js" type="text/javascript"></script>
@@ -31,6 +30,7 @@
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/mute-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/playback-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/remaining-time-support.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/media/scrubbing-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/skip-back-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/start-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/media-controller.js" type="text/javascript"></script>
index bb72a8c..deee526 100644 (file)
@@ -6,7 +6,6 @@
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/buttons-container.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/icon-service.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/start-button.js" type="text/javascript"></script>
-<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/status-label.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/icon-button.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/play-pause-button.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/skip-back-button.js" type="text/javascript"></script>
@@ -31,6 +30,7 @@
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/mute-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/playback-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/remaining-time-support.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/media/scrubbing-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/skip-back-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/start-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/media-controller.js" type="text/javascript"></script>
index af1cd95..9d5e611 100644 (file)
@@ -6,7 +6,6 @@
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/buttons-container.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/icon-service.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/start-button.js" type="text/javascript"></script>
-<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/status-label.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/icon-button.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/play-pause-button.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/skip-back-button.js" type="text/javascript"></script>
@@ -31,6 +30,7 @@
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/mute-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/playback-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/remaining-time-support.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/media/scrubbing-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/skip-back-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/start-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/media-controller.js" type="text/javascript"></script>
diff --git a/LayoutTests/media/modern-media-controls/scrubber-support/scrubber-support-click-expected.txt b/LayoutTests/media/modern-media-controls/scrubber-support/scrubber-support-click-expected.txt
new file mode 100644 (file)
index 0000000..c01c029
--- /dev/null
@@ -0,0 +1,10 @@
+Testing the ScrubberSupport behavior when clicking the scrubber.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS media.currentTime is 3.1872
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/media/modern-media-controls/scrubber-support/scrubber-support-click.html b/LayoutTests/media/modern-media-controls/scrubber-support/scrubber-support-click.html
new file mode 100644 (file)
index 0000000..7ed98be
--- /dev/null
@@ -0,0 +1,102 @@
+<link rel="stylesheet" href="../../../../Source/WebCore/Modules/modern-media-controls/controls/airplay-button.css">
+<link rel="stylesheet" href="../../../../Source/WebCore/Modules/modern-media-controls/controls/button.css">
+<link rel="stylesheet" href="../../../../Source/WebCore/Modules/modern-media-controls/controls/buttons-container.css">
+<link rel="stylesheet" href="../../../../Source/WebCore/Modules/modern-media-controls/controls/icon-button.css">
+<link rel="stylesheet" href="../../../../Source/WebCore/Modules/modern-media-controls/controls/macos-inline-media-controls.css">
+<link rel="stylesheet" href="../../../../Source/WebCore/Modules/modern-media-controls/controls/media-controls.css">
+<link rel="stylesheet" href="../../../../Source/WebCore/Modules/modern-media-controls/controls/placard.css">
+<link rel="stylesheet" href="../../../../Source/WebCore/Modules/modern-media-controls/controls/scrubber.css">
+<link rel="stylesheet" href="../../../../Source/WebCore/Modules/modern-media-controls/controls/slider.css">
+<link rel="stylesheet" href="../../../../Source/WebCore/Modules/modern-media-controls/controls/start-button.css">
+<link rel="stylesheet" href="../../../../Source/WebCore/Modules/modern-media-controls/controls/time-label.css">
+<link rel="stylesheet" href="../../../../Source/WebCore/Modules/modern-media-controls/controls/volume-slider.css">
+<script src="../../../resources/js-test-pre.js"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/scheduler.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/layout-node.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/layout-item.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/button.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/buttons-container.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/icon-service.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/start-button.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/icon-button.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/play-pause-button.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/skip-back-button.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/airplay-button.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/pip-button.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/fullscreen-button.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/mute-button.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/tracks-button.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/slider.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/volume-slider.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/scrubber.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/time-label.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/time-control.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/placard.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/airplay-placard.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/pip-placard.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/media-controls.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/macos-media-controls.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/macos-inline-media-controls.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/media/media-controller-support.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/media/elapsed-time-support.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/media/mute-support.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/media/playback-support.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/media/remaining-time-support.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/media/scrubbing-support.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/media/skip-back-support.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/media/start-support.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/media/media-controller.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/main.js" type="text/javascript"></script>
+<body>
+<style type="text/css" media="screen">
+    
+    video, #host {
+        position: absolute;
+        top: 0;
+        left: 0;
+    }
+
+    video {
+        width: 800px;
+        height: 240px;
+    }
+    
+</style>
+<video src="../../content/test.mp4"></video>
+<div id="host"></div>
+<script type="text/javascript">
+
+window.jsTestIsAsync = true;
+
+description("Testing the <code>ScrubberSupport</code> behavior when clicking the scrubber.");
+
+iconService.directoryPath = "../../../../Source/WebCore/Modules/modern-media-controls/images";
+
+const container = document.querySelector("div#host");
+const media = document.querySelector("video");
+const mediaController = createControls(container, media, null);
+
+mediaController.controls.showsStartButton = false;
+
+media.addEventListener("canplaythrough", () => {
+
+    media.addEventListener("timeupdate", () => {
+        shouldBe("media.currentTime", "3.1872");
+        container.remove();
+        media.remove();
+        finishJSTest();
+    });
+
+    const input = mediaController.controls.timeControl.scrubber.children[1].element;
+    const bounds = input.getBoundingClientRect();
+    const centerX = bounds.left + bounds.width / 2;
+    const centerY = bounds.top + bounds.height / 2;
+
+    eventSender.mouseMoveTo(centerX, centerY);
+    eventSender.mouseDown();
+    eventSender.mouseUp();
+});
+
+</script>
+<script src="../../../resources/js-test-post.js"></script>
+</body>
diff --git a/LayoutTests/media/modern-media-controls/scrubber-support/scrubber-support-drag-expected.txt b/LayoutTests/media/modern-media-controls/scrubber-support/scrubber-support-drag-expected.txt
new file mode 100644 (file)
index 0000000..65d1ef0
--- /dev/null
@@ -0,0 +1,11 @@
+Testing the ScrubberSupport behavior when dragging the scrubber.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS media.currentTime is media.duration / 2
+PASS media.currentTime is 0
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/media/modern-media-controls/scrubber-support/scrubber-support-drag.html b/LayoutTests/media/modern-media-controls/scrubber-support/scrubber-support-drag.html
new file mode 100644 (file)
index 0000000..335b366
--- /dev/null
@@ -0,0 +1,117 @@
+<link rel="stylesheet" href="../../../../Source/WebCore/Modules/modern-media-controls/controls/airplay-button.css">
+<link rel="stylesheet" href="../../../../Source/WebCore/Modules/modern-media-controls/controls/button.css">
+<link rel="stylesheet" href="../../../../Source/WebCore/Modules/modern-media-controls/controls/buttons-container.css">
+<link rel="stylesheet" href="../../../../Source/WebCore/Modules/modern-media-controls/controls/icon-button.css">
+<link rel="stylesheet" href="../../../../Source/WebCore/Modules/modern-media-controls/controls/macos-inline-media-controls.css">
+<link rel="stylesheet" href="../../../../Source/WebCore/Modules/modern-media-controls/controls/media-controls.css">
+<link rel="stylesheet" href="../../../../Source/WebCore/Modules/modern-media-controls/controls/placard.css">
+<link rel="stylesheet" href="../../../../Source/WebCore/Modules/modern-media-controls/controls/scrubber.css">
+<link rel="stylesheet" href="../../../../Source/WebCore/Modules/modern-media-controls/controls/slider.css">
+<link rel="stylesheet" href="../../../../Source/WebCore/Modules/modern-media-controls/controls/start-button.css">
+<link rel="stylesheet" href="../../../../Source/WebCore/Modules/modern-media-controls/controls/time-label.css">
+<link rel="stylesheet" href="../../../../Source/WebCore/Modules/modern-media-controls/controls/volume-slider.css">
+<script src="../../../resources/js-test-pre.js"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/scheduler.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/layout-node.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/layout-item.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/button.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/buttons-container.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/icon-service.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/start-button.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/icon-button.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/play-pause-button.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/skip-back-button.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/airplay-button.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/pip-button.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/fullscreen-button.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/mute-button.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/tracks-button.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/slider.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/volume-slider.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/scrubber.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/time-label.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/time-control.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/placard.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/airplay-placard.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/pip-placard.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/media-controls.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/macos-media-controls.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/macos-inline-media-controls.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/media/media-controller-support.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/media/elapsed-time-support.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/media/mute-support.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/media/playback-support.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/media/remaining-time-support.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/media/scrubbing-support.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/media/skip-back-support.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/media/start-support.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/media/media-controller.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/main.js" type="text/javascript"></script>
+<body>
+<style type="text/css" media="screen">
+    
+    video, #host {
+        position: absolute;
+        top: 0;
+        left: 0;
+    }
+
+    video {
+        width: 800px;
+        height: 240px;
+    }
+    
+</style>
+<video src="../../content/test.mp4" autoplay></video>
+<div id="host"></div>
+<script type="text/javascript">
+
+window.jsTestIsAsync = true;
+
+description("Testing the <code>ScrubberSupport</code> behavior when dragging the scrubber.");
+
+iconService.directoryPath = "../../../../Source/WebCore/Modules/modern-media-controls/images";
+
+const container = document.querySelector("div#host");
+const media = document.querySelector("video");
+const mediaController = createControls(container, media, null);
+
+let numberOfEvents = 0;
+media.addEventListener("play", () => {
+    media.pause();
+
+    const input = mediaController.controls.timeControl.scrubber.children[1].element;
+    const bounds = input.getBoundingClientRect();
+    const minX = bounds.left;
+    const dragStartX = bounds.left + bounds.width / 2;
+    const dragEndX = bounds.left;
+    const centerY = bounds.top + bounds.height / 2;
+
+    media.addEventListener("timeupdate", () => {
+        numberOfEvents++;
+
+        if (numberOfEvents == 1) {
+            shouldBe("media.currentTime", "media.duration / 2");
+            const delta = dragEndX - dragStartX;
+            const iterations = Math.abs(delta);
+            for (let i = 1; i <= iterations; ++i)
+                eventSender.mouseMoveTo(dragStartX + i * Math.sign(delta), centerY);
+
+            eventSender.mouseUp();
+        } else {
+            shouldBe("media.currentTime", "0");
+            container.remove();
+            media.remove();
+            finishJSTest();
+        }
+        
+    });
+
+    // Start dragging.
+    eventSender.mouseMoveTo(dragStartX, centerY);
+    eventSender.mouseDown();
+});
+
+</script>
+<script src="../../../resources/js-test-post.js"></script>
+</body>
diff --git a/LayoutTests/media/modern-media-controls/scrubber-support/scrubber-support-media-api-expected.txt b/LayoutTests/media/modern-media-controls/scrubber-support/scrubber-support-media-api-expected.txt
new file mode 100644 (file)
index 0000000..cc82e59
--- /dev/null
@@ -0,0 +1,12 @@
+Testing the ScrubberSupport behavior by using the media API.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS mediaController.controls.timeControl.scrubber.value is 0
+PASS mediaController.controls.timeControl.scrubber.value is 0.5
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/media/modern-media-controls/scrubber-support/scrubber-support-media-api.html b/LayoutTests/media/modern-media-controls/scrubber-support/scrubber-support-media-api.html
new file mode 100644 (file)
index 0000000..584fd79
--- /dev/null
@@ -0,0 +1,68 @@
+<script src="../../../resources/js-test-pre.js"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/scheduler.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/layout-node.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/layout-item.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/button.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/buttons-container.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/icon-service.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/start-button.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/icon-button.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/play-pause-button.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/skip-back-button.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/airplay-button.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/pip-button.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/fullscreen-button.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/mute-button.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/tracks-button.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/slider.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/volume-slider.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/scrubber.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/time-label.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/time-control.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/placard.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/airplay-placard.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/pip-placard.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/media-controls.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/macos-media-controls.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/macos-inline-media-controls.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/media/media-controller-support.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/media/elapsed-time-support.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/media/mute-support.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/media/playback-support.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/media/remaining-time-support.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/media/scrubbing-support.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/media/skip-back-support.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/media/start-support.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/media/media-controller.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/main.js" type="text/javascript"></script>
+<body>
+<video src="../../content/test.mp4" style="width: 320px; height: 240px;"></video>
+<div id="shadow"></div>
+<script type="text/javascript">
+
+window.jsTestIsAsync = true;
+
+description("Testing the <code>ScrubberSupport</code> behavior by using the media API.");
+
+iconService.directoryPath = "../../../../Source/WebCore/Modules/modern-media-controls/images";
+
+const shadowRoot = document.querySelector("div#shadow").attachShadow({ mode: "open" });
+const media = document.querySelector("video");
+const mediaController = createControls(shadowRoot, media, null);
+
+shouldBe("mediaController.controls.timeControl.scrubber.value", "0");
+
+media.addEventListener("durationchange", () => {
+    media.addEventListener("timeupdate", () => {
+        shouldBe("mediaController.controls.timeControl.scrubber.value", "0.5");
+        debug("");
+        shadowRoot.host.remove();
+        media.remove();
+        finishJSTest();
+    });
+    media.currentTime = media.duration / 2;
+});
+
+</script>
+<script src="../../../resources/js-test-post.js"></script>
+</body>
index a85b366..b23b59b 100644 (file)
@@ -30,6 +30,7 @@
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/mute-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/playback-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/remaining-time-support.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/media/scrubbing-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/skip-back-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/start-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/media-controller.js" type="text/javascript"></script>
index 6178547..8d19b0d 100644 (file)
@@ -30,6 +30,7 @@
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/mute-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/playback-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/remaining-time-support.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/media/scrubbing-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/skip-back-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/start-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/media-controller.js" type="text/javascript"></script>
index b08ba8d..53ede9e 100644 (file)
@@ -30,6 +30,7 @@
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/mute-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/playback-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/remaining-time-support.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/media/scrubbing-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/skip-back-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/start-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/media-controller.js" type="text/javascript"></script>
index 8992a39..eb6cacc 100644 (file)
@@ -30,6 +30,7 @@
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/mute-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/playback-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/remaining-time-support.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/media/scrubbing-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/skip-back-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/start-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/media-controller.js" type="text/javascript"></script>
index eec525f..b566edc 100644 (file)
@@ -30,6 +30,7 @@
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/mute-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/playback-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/remaining-time-support.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/media/scrubbing-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/skip-back-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/start-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/media-controller.js" type="text/javascript"></script>
index 21114b8..1151ad3 100644 (file)
@@ -30,6 +30,7 @@
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/mute-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/playback-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/remaining-time-support.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/media/scrubbing-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/skip-back-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/start-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/media-controller.js" type="text/javascript"></script>
index 9abb890..dc597f0 100644 (file)
@@ -30,6 +30,7 @@
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/mute-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/playback-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/remaining-time-support.js" type="text/javascript"></script>
+<script src="../../../../Source/WebCore/Modules/modern-media-controls/media/scrubbing-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/skip-back-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/start-support.js" type="text/javascript"></script>
 <script src="../../../../Source/WebCore/Modules/modern-media-controls/media/media-controller.js" type="text/javascript"></script>
index 1c86faf..6c11df1 100644 (file)
@@ -2705,6 +2705,8 @@ webkit.org/b/162739 fast/images/gif-loop-count.html [ Pass ImageOnlyFailure ]
 webkit.org/b/163009 media/modern-media-controls/icon-button/icon-button-active-state.html [ Failure ]
 webkit.org/b/163357 media/modern-media-controls/volume-slider/volume-slider-value.html [ Skip ]
 webkit.org/b/163669 media/modern-media-controls/start-support/start-support-fullscreen.html [ Skip ]
+webkit.org/b/164088 media/modern-media-controls/scrubber-support/scrubber-support-click.html [ Skip ]
+webkit.org/b/164088 media/modern-media-controls/scrubber-support/scrubber-support-drag.html [ Skip ]
 
 # This variation font test requires Skia which isn't available on iOS.
 webkit.org/b/163093 fast/text/variations/advances.html [ Failure ]
index 349f8b6..8f1832d 100644 (file)
@@ -1457,3 +1457,6 @@ webkit.org/b/163307 [ Debug ] loader/stateobjects/replacestate-size-iframe.html
 webkit.org/b/163307 [ Debug ] loader/stateobjects/replacestate-size.html [ Skip ]
 
 webkit.org/b/163922 http/tests/security/svg-image-with-css-cross-domain.html [ Pass ImageOnlyFailure ]
+
+webkit.org/b/164088 [ Yosemite ] media/modern-media-controls/scrubber-support/scrubber-support-click.html [ Skip ]
+webkit.org/b/164088 [ Yosemite ] media/modern-media-controls/scrubber-support/scrubber-support-drag.html [ Skip ]
index 4596e83..f344621 100644 (file)
@@ -1,3 +1,32 @@
+2016-10-28  Antoine Quint  <graouts@apple.com>
+
+        [Modern Media Controls] Media Controller: scrubbing support
+        https://bugs.webkit.org/show_bug.cgi?id=163726
+        <rdar://problem/27989481>
+
+        Reviewed by Dean Jackson.
+
+        We introduce the ScrubberSupport class which brings support for scrubbing the media
+        by interacting with the scrubber in the media controls and correctly reflecting
+        the media's current time as set via the media API.
+
+        Tests: media/modern-media-controls/scrubber-support/scrubber-support-click.html
+               media/modern-media-controls/scrubber-support/scrubber-support-drag.html
+               media/modern-media-controls/scrubber-support/scrubber-support-media-api.html
+
+        * Modules/modern-media-controls/js-files:
+        * Modules/modern-media-controls/media/media-controller.js:
+        (MediaController):
+        * Modules/modern-media-controls/media/scrubbing-support.js: Added.
+        (ScrubbingSupport.prototype.get control):
+        (ScrubbingSupport.prototype.get mediaEvents):
+        (ScrubbingSupport.prototype.controlValueWillStartChanging):
+        (ScrubbingSupport.prototype.controlValueDidChange):
+        (ScrubbingSupport.prototype.controlValueDidStopChanging):
+        (ScrubbingSupport.prototype.syncControl):
+        (ScrubbingSupport):
+        * WebCore.xcodeproj/project.pbxproj:
+
 2016-10-28  Alex Christensen  <achristensen@webkit.org>
 
         Fix Windows WebGL build after r208022
index 238603f..e698670 100644 (file)
@@ -32,6 +32,7 @@ media/elapsed-time-support.js
 media/mute-support.js
 media/playback-support.js
 media/remaining-time-support.js
+media/scrubbing-support.js
 media/skip-back-support.js
 media/start-support.js
 media/media-controller.js
index 982612a..8037c45 100644 (file)
@@ -42,6 +42,7 @@ class MediaController
         new MuteSupport(this);
         new PlaybackSupport(this);
         new RemainingTimeSupport(this);
+        new ScrubbingSupport(this);
         new SkipBackSupport(this);
         new StartSupport(this);
 
diff --git a/Source/WebCore/Modules/modern-media-controls/media/scrubbing-support.js b/Source/WebCore/Modules/modern-media-controls/media/scrubbing-support.js
new file mode 100644 (file)
index 0000000..f5039fc
--- /dev/null
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2016 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+class ScrubbingSupport extends MediaControllerSupport
+{
+
+    // Protected
+
+    get control()
+    {
+        return this.mediaController.controls.timeControl.scrubber;
+    }
+
+    get mediaEvents()
+    {
+        return ["timeupdate"];
+    }
+
+    controlValueWillStartChanging(control)
+    {
+        const media = this.mediaController.media;
+        const isPaused = media.paused;
+        if (!isPaused)
+            media.pause();
+
+        this._wasPausedWhenScrubbingStarted = isPaused;
+    }
+
+    controlValueDidChange(control)
+    {
+        const media = this.mediaController.media;
+        media.fastSeek(control.value * media.duration);
+    }
+
+    controlValueDidStopChanging(control)
+    {
+        if (!this._wasPausedWhenScrubbingStarted)
+            this.mediaController.media.play();
+
+        delete this._wasPausedWhenScrubbingStarted;
+    }
+
+    syncControl()
+    {
+        const media = this.mediaController.media;
+        if (isNaN(media.duration))
+            return;
+
+        this.control.value = media.currentTime / media.duration;
+    }
+
+}
index cda1a07..aab78f7 100644 (file)
                713E70AF1733E8B300A22D00 /* plugIns.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = plugIns.js; sourceTree = "<group>"; };
                715379FE146BD9D6008BD615 /* SVGPathData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGPathData.cpp; sourceTree = "<group>"; };
                715379FF146BD9D6008BD615 /* SVGPathData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPathData.h; sourceTree = "<group>"; };
+               7157E3D11DC1EE4B0094550E /* scrubbing-support.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = "scrubbing-support.js"; sourceTree = "<group>"; };
                7157F061150B6564006EAABD /* SVGAnimatedTransformList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedTransformList.cpp; sourceTree = "<group>"; };
                716FA0D81DB26591007323CC /* airplay-button.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = "airplay-button.css"; sourceTree = "<group>"; };
                716FA0D91DB26591007323CC /* airplay-button.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = "airplay-button.js"; sourceTree = "<group>"; };
                71D02D911DB55C4E00DD5CF5 /* media */ = {
                        isa = PBXGroup;
                        children = (
+                               7157E3D11DC1EE4B0094550E /* scrubbing-support.js */,
                                71004B9A1DC1109300A52A38 /* elapsed-time-support.js */,
                                7177E2461DB80D2F00919A0B /* media-controller-support.js */,
                                71D02D921DB55C4E00DD5CF5 /* media-controller.js */,