Title: [195671] trunk
Revision
195671
Author
[email protected]
Date
2016-01-27 07:20:03 -0800 (Wed, 27 Jan 2016)

Log Message

Calling video.controls=true during a scrub operation cancels scrub.
https://bugs.webkit.org/show_bug.cgi?id=153494

Reviewed by Eric Carlson.

Source/WebCore:

Test: media/media-controls-drag-timeline-set-controls-property.html

Verify that the video.controls attribute actually changed before tearing down and
re-adding the media controls to the Shadow DOM.

* Modules/mediacontrols/mediaControlsApple.js:
(Controller.prototype.handleControlsChange):
(Controller.prototype.hasControls):

LayoutTests:

* media/media-controls-drag-timeline-set-controls-property-expected.txt: Added.
* media/media-controls-drag-timeline-set-controls-property.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (195670 => 195671)


--- trunk/LayoutTests/ChangeLog	2016-01-27 14:34:46 UTC (rev 195670)
+++ trunk/LayoutTests/ChangeLog	2016-01-27 15:20:03 UTC (rev 195671)
@@ -1,3 +1,13 @@
+2016-01-26  Jer Noble  <[email protected]>
+
+        Calling video.controls=true during a scrub operation cancels scrub.
+        https://bugs.webkit.org/show_bug.cgi?id=153494
+
+        Reviewed by Eric Carlson.
+
+        * media/media-controls-drag-timeline-set-controls-property-expected.txt: Added.
+        * media/media-controls-drag-timeline-set-controls-property.html: Added.
+
 2016-01-26  Chris Dumez  <[email protected]>
 
         fast/history/page-cache-webdatabase-no-transaction-db.html flakily crashes

Added: trunk/LayoutTests/media/media-controls-drag-timeline-set-controls-property-expected.txt (0 => 195671)


--- trunk/LayoutTests/media/media-controls-drag-timeline-set-controls-property-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/media/media-controls-drag-timeline-set-controls-property-expected.txt	2016-01-27 15:20:03 UTC (rev 195671)
@@ -0,0 +1,10 @@
+Test that dragging the timeline slider after setting video.controls=true causes seeks.
+
+
+EVENT(playing)
+EVENT(pause)
+EVENT(seeked)
+EVENT(seeked)
+EVENT(seeked)
+END OF TEST
+

Added: trunk/LayoutTests/media/media-controls-drag-timeline-set-controls-property.html (0 => 195671)


--- trunk/LayoutTests/media/media-controls-drag-timeline-set-controls-property.html	                        (rev 0)
+++ trunk/LayoutTests/media/media-controls-drag-timeline-set-controls-property.html	2016-01-27 15:20:03 UTC (rev 195671)
@@ -0,0 +1,80 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <title>media-controls-timeline-set-controls-property</title>
+    <script src=""
+    <script src=""
+    <script src=""
+    <script>
+    var x;
+    var y;
+    var seekCount = 0;
+    var moveInterval;
+
+    function runTest()
+    {
+        findMediaElement();
+        waitForEvent('playing', beginScrubbing);
+        video.src = "" 'content/test');
+        video.play();
+    }
+
+    function beginScrubbing()
+    {
+        if (window.eventSender) {
+
+            var timelineCoordinate;
+            try {
+                timelineCoordinate = mediaControlsButtonCoordinates(video, 'timeline');
+            } catch (exception) {
+                failTest(exception.description);
+                return;
+            }
+            x = timelineCoordinate[0];
+            y = timelineCoordinate[1];
+
+            eventSender.dragMode = false;
+            eventSender.mouseMoveTo(x, y);
+            eventSender.mouseDown();
+        }
+        waitForEvent('pause', pause);
+        waitForEvent('seeked', seeked)
+    }
+
+    function pause()
+    {
+        video.controls = 'true';
+        moveInterval = setInterval(move, 100);
+    }
+
+    function move()
+    {
+        if (window.eventSender) {
+            x += 10;
+            eventSender.mouseMoveTo(x, y);
+        }
+    }
+
+
+    function seeked()
+    {
+        ++seekCount;
+        if (seekCount < 3)
+            return;
+
+        clearInterval(moveInterval);
+        if (window.eventSender)
+            eventSender.mouseUp();
+        endTest();
+    }
+
+    
+    </script>
+</head>
+
+<body _onload_="runTest()">
+    <p>Test that dragging the timeline slider after setting video.controls=true causes seeks.</p>
+    <video controls></video>
+</body>
+</html>
+

Modified: trunk/Source/WebCore/ChangeLog (195670 => 195671)


--- trunk/Source/WebCore/ChangeLog	2016-01-27 14:34:46 UTC (rev 195670)
+++ trunk/Source/WebCore/ChangeLog	2016-01-27 15:20:03 UTC (rev 195671)
@@ -1,3 +1,19 @@
+2016-01-26  Jer Noble  <[email protected]>
+
+        Calling video.controls=true during a scrub operation cancels scrub.
+        https://bugs.webkit.org/show_bug.cgi?id=153494
+
+        Reviewed by Eric Carlson.
+
+        Test: media/media-controls-drag-timeline-set-controls-property.html
+
+        Verify that the video.controls attribute actually changed before tearing down and
+        re-adding the media controls to the Shadow DOM.
+
+        * Modules/mediacontrols/mediaControlsApple.js:
+        (Controller.prototype.handleControlsChange):
+        (Controller.prototype.hasControls):
+
 2016-01-27  Carlos Garcia Campos  <[email protected]>
 
         [GTK][EFL] Rename ScrollAnimationNone as ScrollAnimationSmooth

Modified: trunk/Source/WebCore/Modules/mediacontrols/mediaControlsApple.js (195670 => 195671)


--- trunk/Source/WebCore/Modules/mediacontrols/mediaControlsApple.js	2016-01-27 14:34:46 UTC (rev 195670)
+++ trunk/Source/WebCore/Modules/mediacontrols/mediaControlsApple.js	2016-01-27 15:20:03 UTC (rev 195671)
@@ -1087,9 +1087,9 @@
         try {
             this.updateBase();
 
-            if (this.shouldHaveControls())
+            if (this.shouldHaveControls() && !this.hasControls())
                 this.addControls();
-            else
+            else if (!this.shouldHaveControls() && this.hasControls())
                 this.removeControls();
         } catch(e) {
             if (window.console)
@@ -1542,6 +1542,11 @@
         this.updateControls();
     },
 
+    hasControls: function()
+    {
+        return this.controls.panel.parentElement;
+    },
+
     updateTime: function()
     {
         var currentTime = this.video.currentTime;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to