Title: [202075] trunk/Source/WebCore
Revision
202075
Author
[email protected]
Date
2016-06-14 18:03:30 -0700 (Tue, 14 Jun 2016)

Log Message

Inline media controls cut off PiP and fullscreen buttons on cnn.com
https://bugs.webkit.org/show_bug.cgi?id=158766
<rdar://problem/24175161>

Patch by Antoine Quint <[email protected]> on 2016-06-14
Reviewed by Dean Jackson.

The display of the picture-in-picture and fullscreen buttons are dependent on the availability
of video tracks through a call to hasVideo(). We need to ensure that the display properties of
both those buttons are updated when the number of video tracks has changed since the controls
may be populated prior to the availability of video tracks.

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

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (202074 => 202075)


--- trunk/Source/WebCore/ChangeLog	2016-06-15 00:45:25 UTC (rev 202074)
+++ trunk/Source/WebCore/ChangeLog	2016-06-15 01:03:30 UTC (rev 202075)
@@ -1,3 +1,19 @@
+2016-06-14  Antoine Quint  <[email protected]>
+
+        Inline media controls cut off PiP and fullscreen buttons on cnn.com
+        https://bugs.webkit.org/show_bug.cgi?id=158766
+        <rdar://problem/24175161>
+
+        Reviewed by Dean Jackson.
+
+        The display of the picture-in-picture and fullscreen buttons are dependent on the availability
+        of video tracks through a call to hasVideo(). We need to ensure that the display properties of
+        both those buttons are updated when the number of video tracks has changed since the controls
+        may be populated prior to the availability of video tracks.
+
+        * Modules/mediacontrols/mediaControlsApple.js:
+        (Controller.prototype.updateHasVideo):
+
 2016-06-14  Joseph Pecoraro  <[email protected]>
 
         Web Inspector: Rename Timeline.setAutoCaptureInstruments to Timeline.setInstruments

Modified: trunk/Source/WebCore/Modules/mediacontrols/mediaControlsApple.js (202074 => 202075)


--- trunk/Source/WebCore/Modules/mediacontrols/mediaControlsApple.js	2016-06-15 00:45:25 UTC (rev 202074)
+++ trunk/Source/WebCore/Modules/mediacontrols/mediaControlsApple.js	2016-06-15 01:03:30 UTC (rev 202075)
@@ -2035,10 +2035,11 @@
 
     updateHasVideo: function()
     {
-        if (this.hasVideo())
-            this.controls.panel.classList.remove(this.ClassNames.noVideo);
-        else
-            this.controls.panel.classList.add(this.ClassNames.noVideo);
+        this.controls.panel.classList.toggle(this.ClassNames.noVideo, !this.hasVideo());
+        // The availability of the picture-in-picture button as well as the full-screen
+        // button depends no the value returned by hasVideo(), so make sure we invalidate
+        // the availability of both controls.
+        this.updateFullscreenButtons();
     },
 
     updateVolume: function()
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to