Title: [195666] releases/WebKitGTK/webkit-2.10
Revision
195666
Author
[email protected]
Date
2016-01-27 05:31:39 -0800 (Wed, 27 Jan 2016)

Log Message

Merge r195511 - [GTK] Fix media controls displaying without controls attribute
https://bugs.webkit.org/show_bug.cgi?id=152500

Media controls is not displayed without controls attribute by default
when the video element has text track. It'll be displayed on fullscreen
regardless of controls attribute.

Patch by Wonchul Lee <[email protected]> on 2016-01-23
Reviewed by Michael Catanzaro.

Source/WebCore:

* Modules/mediacontrols/mediaControlsGtk.js:
(ControllerGtk.prototype.shouldHaveControls):
(ControllerGtk.prototype.reconnectControls):
(ControllerGtk.prototype.removeControls):
(ControllerGtk.prototype.configureControls): Deleted.

LayoutTests:

* media/video-controls-no-display-with-text-track-expected.txt: Added.
* media/video-controls-no-display-with-text-track.html: Added.

Modified Paths

Added Paths

Diff

Modified: releases/WebKitGTK/webkit-2.10/LayoutTests/ChangeLog (195665 => 195666)


--- releases/WebKitGTK/webkit-2.10/LayoutTests/ChangeLog	2016-01-27 13:23:44 UTC (rev 195665)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/ChangeLog	2016-01-27 13:31:39 UTC (rev 195666)
@@ -1,3 +1,17 @@
+2016-01-23  Wonchul Lee  <[email protected]>
+
+        [GTK] Fix media controls displaying without controls attribute
+        https://bugs.webkit.org/show_bug.cgi?id=152500
+
+        Media controls is not displayed without controls attribute by default
+        when the video element has text track. It'll be displayed on fullscreen
+        regardless of controls attribute.
+
+        Reviewed by Michael Catanzaro.
+
+        * media/video-controls-no-display-with-text-track-expected.txt: Added.
+        * media/video-controls-no-display-with-text-track.html: Added.
+
 2016-01-21  Dave Hyatt  <[email protected]>
 
         Elements with overflow and border-radius don't show in multicolumn properly.

Added: releases/WebKitGTK/webkit-2.10/LayoutTests/media/video-controls-no-display-with-text-track-expected.txt (0 => 195666)


--- releases/WebKitGTK/webkit-2.10/LayoutTests/media/video-controls-no-display-with-text-track-expected.txt	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/media/video-controls-no-display-with-text-track-expected.txt	2016-01-27 13:31:39 UTC (rev 195666)
@@ -0,0 +1,12 @@
+Tests that video controls are not shown for videos with a text track when the controls attribute is not present, except when fullscreen
+
+EVENT(canplay)
+
+** Video controls should not be shown **
+EXPECTED (panel == 'null') OK
+EVENT(webkitfullscreenchange)
+
+** Video controls should be shown on fullscreen **
+EXPECTED (panel.style['display'] != 'none') OK
+END OF TEST
+

Added: releases/WebKitGTK/webkit-2.10/LayoutTests/media/video-controls-no-display-with-text-track.html (0 => 195666)


--- releases/WebKitGTK/webkit-2.10/LayoutTests/media/video-controls-no-display-with-text-track.html	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/media/video-controls-no-display-with-text-track.html	2016-01-27 13:31:39 UTC (rev 195666)
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <title>Video controls no display with text track Test</title>
+    <script src=""
+    <script src=""
+    <script src=""
+    <script src=""
+    <script>
+        var panel;
+
+        var startTest = function() {
+            findMediaElement();
+            waitForEvent(video, 'canplay', oncanplay);
+            video.src = "" 'content/test');
+        };
+
+        var _oncanplay_ = function() {
+            panel = mediaControlsElement(internals.shadowRoot(video).firstChild, "-webkit-media-controls-panel");
+
+            consoleWrite("");
+            consoleWrite("** Video controls should not be shown **");
+            testExpected("panel", null, "==");
+
+            waitForEvent(video, 'webkitfullscreenchange', onfullscreenchange);
+            runWithKeyDown(function(){ video.webkitRequestFullscreen(); })
+        };
+
+        var _onfullscreenchange_ = function() {
+            panel = mediaControlsElement(internals.shadowRoot(video).firstChild, "-webkit-media-controls-panel");
+
+            consoleWrite("");
+            consoleWrite("** Video controls should be shown on fullscreen **");
+
+            testExpected("panel.style['display']", 'none', "!=");
+            endTest();
+        };
+    </script>
+</head>
+<body _onload_="startTest()">
+    Tests that video controls are not shown for videos with a text track when the controls attribute is not present, except when fullscreen<br>
+    <video>
+        <track>
+    </video>
+
+</body>
+</html>

Modified: releases/WebKitGTK/webkit-2.10/Source/WebCore/ChangeLog (195665 => 195666)


--- releases/WebKitGTK/webkit-2.10/Source/WebCore/ChangeLog	2016-01-27 13:23:44 UTC (rev 195665)
+++ releases/WebKitGTK/webkit-2.10/Source/WebCore/ChangeLog	2016-01-27 13:31:39 UTC (rev 195666)
@@ -1,3 +1,19 @@
+2016-01-23  Wonchul Lee  <[email protected]>
+
+        [GTK] Fix media controls displaying without controls attribute
+        https://bugs.webkit.org/show_bug.cgi?id=152500
+
+        Media controls is not displayed without controls attribute by default
+        when the video element has text track. It'll be displayed on fullscreen
+        regardless of controls attribute.
+
+        Reviewed by Michael Catanzaro.
+
+        * Modules/mediacontrols/mediaControlsGtk.js:
+        (ControllerGtk.prototype.shouldHaveControls):
+        (ControllerGtk.prototype.reconnectControls):
+        (ControllerGtk.prototype.removeControls):
+        (ControllerGtk.prototype.configureControls): Deleted.
 2016-01-21  Dave Hyatt  <[email protected]>
 
         Elements with overflow and border-radius don't show in multicolumn properly.

Modified: releases/WebKitGTK/webkit-2.10/Source/WebCore/Modules/mediacontrols/mediaControlsGtk.js (195665 => 195666)


--- releases/WebKitGTK/webkit-2.10/Source/WebCore/Modules/mediacontrols/mediaControlsGtk.js	2016-01-27 13:23:44 UTC (rev 195665)
+++ releases/WebKitGTK/webkit-2.10/Source/WebCore/Modules/mediacontrols/mediaControlsGtk.js	2016-01-27 13:31:39 UTC (rev 195666)
@@ -54,18 +54,19 @@
         this.controls.enclosure.appendChild(this.controls.panel);
     },
 
-    configureControls: function() {
-        if (this.controls.configured)
-            return;
-
-        this.configureInlineControls();
-        this.controls.configured = true;
-        this.addControls();
+    shouldHaveControls: function()
+    {
+        return this.video.controls || this.isFullScreen();
     },
 
     reconnectControls: function()
     {
-        this.configureControls();
+        Controller.prototype.disconnectControls.apply(this, arguments);
+
+        this.configureInlineControls();
+
+        if (this.shouldHaveControls())
+            this.addControls();
     },
 
     setStatusHidden: function(hidden)
@@ -133,6 +134,13 @@
         return true;
     },
 
+    removeControls: function()
+    {
+        if (this.controls.enclosure.parentNode)
+            this.controls.enclosure.parentNode.removeChild(this.controls.enclosure);
+        this.destroyCaptionMenu();
+    },
+
     addControls: function()
     {
         this.base.appendChild(this.controls.enclosure);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to