Title: [197005] trunk/Source/WebCore
Revision
197005
Author
adac...@apple.com
Date
2016-02-23 16:30:48 -0800 (Tue, 23 Feb 2016)

Log Message

Refactor script that updates fullscreen buttons.
https://bugs.webkit.org/show_bug.cgi?id=154562

Reviewed by Dean Jackson.

Also expose extra property and element in getCurrentControlsStatus() for future testing.

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

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (197004 => 197005)


--- trunk/Source/WebCore/ChangeLog	2016-02-24 00:20:01 UTC (rev 197004)
+++ trunk/Source/WebCore/ChangeLog	2016-02-24 00:30:48 UTC (rev 197005)
@@ -1,3 +1,16 @@
+2016-02-22  Ada Chan  <adac...@apple.com>
+
+        Refactor script that updates fullscreen buttons.
+        https://bugs.webkit.org/show_bug.cgi?id=154562
+
+        Reviewed by Dean Jackson.
+
+        Also expose extra property and element in getCurrentControlsStatus() for future testing.
+
+        * Modules/mediacontrols/mediaControlsApple.js:
+        (Controller.prototype.updatePictureInPictureButton):
+        (Controller.prototype.updateFullscreenButtons):
+
 2016-02-22  Ryosuke Niwa  <rn...@webkit.org>
 
         Calling importNode on shadow root causes a crash

Modified: trunk/Source/WebCore/Modules/mediacontrols/mediaControlsApple.js (197004 => 197005)


--- trunk/Source/WebCore/Modules/mediacontrols/mediaControlsApple.js	2016-02-24 00:20:01 UTC (rev 197004)
+++ trunk/Source/WebCore/Modules/mediacontrols/mediaControlsApple.js	2016-02-24 00:30:48 UTC (rev 197005)
@@ -818,9 +818,14 @@
 
     updatePictureInPictureButton: function()
     {
-        var shouldShowPictureInPictureButton = Controller.gSimulatePictureInPictureAvailable || ('webkitSupportsPresentationMode' in this.video && this.video.webkitSupportsPresentationMode('picture-in-picture'));
+        var shouldShowPictureInPictureButton = (Controller.gSimulatePictureInPictureAvailable || ('webkitSupportsPresentationMode' in this.video && this.video.webkitSupportsPresentationMode('picture-in-picture'))) && this.hasVideo();
         if (shouldShowPictureInPictureButton) {
-            this.controls.panel.appendChild(this.controls.pictureInPictureButton);
+            if (!this.controls.pictureInPictureButton.parentElement) {
+                if (this.controls.fullscreenButton.parentElement == this.controls.panel)
+                    this.controls.panel.insertBefore(this.controls.pictureInPictureButton, this.controls.fullscreenButton);
+                else
+                    this.controls.panel.appendChild(this.controls.pictureInPictureButton);
+            }
             this.controls.pictureInPictureButton.classList.remove(this.ClassNames.hidden);
         } else
             this.controls.pictureInPictureButton.classList.add(this.ClassNames.hidden);
@@ -1138,7 +1143,7 @@
     {
         var shouldBeHidden = !this.video.webkitSupportsFullscreen || !this.hasVideo();
         this.controls.fullscreenButton.classList.toggle(this.ClassNames.hidden, shouldBeHidden && !this.isFullScreen());
-        this.controls.pictureInPictureButton.classList.toggle(this.ClassNames.hidden, shouldBeHidden);
+        this.updatePictureInPictureButton();
         this.setNeedsUpdateForDisplayedWidth();
         this.updateLayoutForDisplayedWidth();
     },
@@ -2248,12 +2253,17 @@
             },
             {
                 name: "Picture-in-picture Button",
-                object: this.controls.pictureInPictureButton
+                object: this.controls.pictureInPictureButton,
+                extraProperties: ["parentElement"],
             },
             {
                 name: "Track Menu",
                 object: this.captionMenu
             },
+            {
+                name: "Inline playback placeholder",
+                object: this.controls.inlinePlaybackPlaceholder,
+            },
         ];
 
         elements.forEach(function (element) {
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to