Media Element: scrubbing in full-screen mode breaks playback.
authorjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 6 Jan 2012 19:13:02 +0000 (19:13 +0000)
committerjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 6 Jan 2012 19:13:02 +0000 (19:13 +0000)
https://bugs.webkit.org/show_bug.cgi?id=75650

Reviewed by John Sullivan.

Source/WebCore:

Test: fullscreen/video-controls-timeline.html

Only begin scrubbing if the panel itself is the mousedown event target.

* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlPanelElement::defaultEventHandler):

LayoutTests:

* fullscreen/video-controls-timeline-expected.txt: Added.
* fullscreen/video-controls-timeline.html: Added.

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

LayoutTests/ChangeLog
LayoutTests/fullscreen/video-controls-timeline-expected.txt [new file with mode: 0644]
LayoutTests/fullscreen/video-controls-timeline.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/html/shadow/MediaControlElements.cpp

index 7f4972b..2a71390 100644 (file)
@@ -1,3 +1,13 @@
+2012-01-05  Jer Noble  <jer.noble@apple.com>
+
+        Media Element: scrubbing in full-screen mode breaks playback.
+        https://bugs.webkit.org/show_bug.cgi?id=75650
+
+        Reviewed by John Sullivan.
+
+        * fullscreen/video-controls-timeline-expected.txt: Added.
+        * fullscreen/video-controls-timeline.html: Added.
+
 2012-01-06  Jer Noble  <jer.noble@apple.com>
 
         Add new (failing) test to Chromium test_expectations.  Fix tracked by
diff --git a/LayoutTests/fullscreen/video-controls-timeline-expected.txt b/LayoutTests/fullscreen/video-controls-timeline-expected.txt
new file mode 100644 (file)
index 0000000..03e6429
--- /dev/null
@@ -0,0 +1,8 @@
+This tests that the video element's timeline controls are draggable in full screen. Press any key to continue.
+
+EVENT(canplaythrough)
+EVENT(webkitfullscreenchange)
+EVENT(mousedown)
+EVENT(mouseup)
+END OF TEST
+
diff --git a/LayoutTests/fullscreen/video-controls-timeline.html b/LayoutTests/fullscreen/video-controls-timeline.html
new file mode 100644 (file)
index 0000000..7dd21f9
--- /dev/null
@@ -0,0 +1,34 @@
+<body>
+    <p>This tests that the video element's timeline controls are draggable in full screen.  Press any key to continue.</p>
+    <video id="video" width="300" controls></video>
+    <script src="full-screen-test.js"></script>
+    <script src="../media/media-controls.js"></script>
+    <script src="../media/media-file.js"></script>
+    <script>
+        var video = document.getElementById('video');
+        var timeline;
+
+        waitForEvent(document, 'webkitfullscreenchange', function() {
+            if (window.internals) {
+                timeline = mediaControlsElement(internals.shadowRoot(video).firstChild, '-webkit-media-controls-timeline');
+                var box = internals.boundingBox(timeline);
+
+                eventSender.mouseMoveTo(box.left + 5, box.top + 5);
+
+                waitForEvent(timeline, 'mousedown');
+                eventSender.mouseDown();
+
+                waitForEventAndEnd(timeline, 'mouseup');
+                eventSender.mouseUp();
+            }
+            else
+                logResult(false, "window.internals == undefined");
+        });
+
+        waitForEvent(video, 'canplaythrough', function() {
+            runWithKeyDown(function(){video.webkitRequestFullScreen()});
+        });
+
+        video.src = findMediaFile('video', '../media/content/test');
+    </script>
+</body>
index 2379c00..26ff309 100644 (file)
@@ -1,5 +1,19 @@
 2012-01-05  Jer Noble  <jer.noble@apple.com>
 
+        Media Element: scrubbing in full-screen mode breaks playback.
+        https://bugs.webkit.org/show_bug.cgi?id=75650
+
+        Reviewed by John Sullivan.
+
+        Test: fullscreen/video-controls-timeline.html
+
+        Only begin scrubbing if the panel itself is the mousedown event target.
+
+        * html/shadow/MediaControlElements.cpp:
+        (WebCore::MediaControlPanelElement::defaultEventHandler):
+
+2012-01-05  Jer Noble  <jer.noble@apple.com>
+
         REGRESSION (r90797): Full screen video HUD cannot be dragged horizontally
         https://bugs.webkit.org/show_bug.cgi?id=75200
 
index 84e364b..d88b87f 100644 (file)
@@ -236,12 +236,12 @@ void MediaControlPanelElement::defaultEventHandler(Event* event)
 
     if (event->isMouseEvent()) {
         LayoutPoint location = static_cast<MouseEvent*>(event)->absoluteLocation();
-        if (event->type() == eventNames().mousedownEvent) {
+        if (event->type() == eventNames().mousedownEvent && event->target() == this) {
             startDrag(location);
             event->setDefaultHandled();
-        } else if (event->type() == eventNames().mousemoveEvent)
+        } else if (event->type() == eventNames().mousemoveEvent && m_isBeingDragged)
             continueDrag(location);
-        else if (event->type() == eventNames().mouseupEvent) {
+        else if (event->type() == eventNames().mouseupEvent && m_isBeingDragged) {
             continueDrag(location);
             endDrag();
             event->setDefaultHandled();