Title: [202509] trunk
Revision
202509
Author
[email protected]
Date
2016-06-27 13:37:48 -0700 (Mon, 27 Jun 2016)

Log Message

[Mac] PiP placeholder should remain visible when 'controls' attribute is removed
https://bugs.webkit.org/show_bug.cgi?id=159158
<rdar://problem/26727435>

Reviewed by Jer Noble.

Source/WebCore:

No new tests, existing test updated.

* Modules/mediacontrols/mediaControlsApple.js:
(Controller.prototype.shouldHaveControls): Always return true when in PiP or AirPlay mode.

LayoutTests:

* media/controls/picture-in-picture-expected.txt: Updated.
* media/controls/picture-in-picture.html: Ditto.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (202508 => 202509)


--- trunk/LayoutTests/ChangeLog	2016-06-27 19:52:26 UTC (rev 202508)
+++ trunk/LayoutTests/ChangeLog	2016-06-27 20:37:48 UTC (rev 202509)
@@ -1,3 +1,14 @@
+2016-06-27  Eric Carlson  <[email protected]>
+
+        [Mac] PiP placeholder should remain visible when 'controls' attribute is removed
+        https://bugs.webkit.org/show_bug.cgi?id=159158
+        <rdar://problem/26727435>
+
+        Reviewed by Jer Noble.
+
+        * media/controls/picture-in-picture-expected.txt: Updated.
+        * media/controls/picture-in-picture.html: Ditto.
+
 2016-06-27  Antoine Quint  <[email protected]>
 
         [iOS] Media controls are too cramped with small video

Modified: trunk/LayoutTests/media/controls/picture-in-picture-expected.txt (202508 => 202509)


--- trunk/LayoutTests/media/controls/picture-in-picture-expected.txt	2016-06-27 19:52:26 UTC (rev 202508)
+++ trunk/LayoutTests/media/controls/picture-in-picture-expected.txt	2016-06-27 20:37:48 UTC (rev 202509)
@@ -23,5 +23,11 @@
 PASS: Should be in pip mode
 PASS: Inline placeholder should be visible at this point
 
+Test for the pip placeholder visibility in pip mode without a 'controls' attribute
+
+PASS: Should still be in pip mode
+PASS: No controls attribute
+PASS: Inline placeholder should still be visible
+
 Testing finished.
 

Modified: trunk/LayoutTests/media/controls/picture-in-picture.html (202508 => 202509)


--- trunk/LayoutTests/media/controls/picture-in-picture.html	2016-06-27 19:52:26 UTC (rev 202508)
+++ trunk/LayoutTests/media/controls/picture-in-picture.html	2016-06-27 20:37:48 UTC (rev 202509)
@@ -7,13 +7,13 @@
             if (window.internals)
                 window.internals.settings.setAllowsPictureInPictureMediaPlayback(true);
 
-            var tester = new ControlsTest("non-existent-media-file", "error")
+            const tester = new ControlsTest("non-existent-media-file", "error")
                 .whenReady(runTestsWithoutVideo)
                 .start();
 
             function runTestsWithoutVideo()
             {
-                var currentState = tester.currentState;
+                const currentState = tester.currentState;
                 tester.test("We are using the apple idiom")
                     .value(currentState.idiom)
                     .isEqualTo("apple");
@@ -20,7 +20,7 @@
 
                 tester.startNewSection("Test the picture-in-picture button without video", true);
 
-                var stateForPictureInPictureButton = tester.stateForControlsElement("Picture-in-picture Button");
+                const stateForPictureInPictureButton = tester.stateForControlsElement("Picture-in-picture Button");
                 tester.test("Picture-in-picture button should not be visible if there's no video")
                     .value(stateForPictureInPictureButton.className)
                     .contains("hidden");
@@ -34,7 +34,7 @@
             {
                 tester.startNewSection("Test the picture-in-picture button with valid video");
 
-                var stateForPictureInPictureButton = tester.stateForControlsElement("Picture-in-picture Button", true);
+                const stateForPictureInPictureButton = tester.stateForControlsElement("Picture-in-picture Button", true);
                 tester.test("Picture-in-picture button should be visible if there's video")
                     .value(stateForPictureInPictureButton.className)
                     .doesNotContain("hidden");
@@ -43,7 +43,7 @@
                     .value(stateForPictureInPictureButton.parentElement)
                     .isNotEqualTo(undefined);
 
-                var stateForPlaceholder = tester.stateForControlsElement("Inline playback placeholder", true);
+                const stateForPlaceholder = tester.stateForControlsElement("Inline playback placeholder", true);
                 tester.test("Inline placeholder should not be visible at this point")
                     .value(stateForPlaceholder.className)
                     .contains("hidden");
@@ -62,12 +62,36 @@
                     .value(tester.media.webkitPresentationMode)
                     .isEqualTo("picture-in-picture");
 
-                var stateForPlaceholder = tester.stateForControlsElement("Inline playback placeholder", true);
+                const stateForPlaceholder = tester.stateForControlsElement("Inline playback placeholder", true);
                 tester.test("Inline placeholder should be visible at this point")
                     .value(stateForPlaceholder.className)
                     .doesNotContain("hidden");
 
+                const controlsObserver = new MutationObserver(controlsDidChange);
+                controlsObserver.observe(tester.media, { attributes: true, attributeFilter: ['controls'] });
+
+                tester.media.removeAttribute('controls');
+            }
+
+            function controlsDidChange()
+            {
+                tester.startNewSection("Test for the pip placeholder visibility in pip mode without a 'controls' attribute");
+
+                tester.test("Should still be in pip mode")
+                    .value(tester.media.webkitPresentationMode)
+                    .isEqualTo("picture-in-picture");
+
+                tester.test("No controls attribute")
+                    .value(tester.media.hasAttribute('controls'))
+                    .isFalse();
+
+                const stateForPlaceholder = tester.stateForControlsElement("Inline playback placeholder", true);
+                tester.test("Inline placeholder should still be visible")
+                    .value(stateForPlaceholder.className)
+                    .doesNotContain("hidden");
+
                 tester.media.webkitSetPresentationMode("inline");
+
                 tester.end();
             }
         </script>

Modified: trunk/Source/WebCore/ChangeLog (202508 => 202509)


--- trunk/Source/WebCore/ChangeLog	2016-06-27 19:52:26 UTC (rev 202508)
+++ trunk/Source/WebCore/ChangeLog	2016-06-27 20:37:48 UTC (rev 202509)
@@ -1,3 +1,16 @@
+2016-06-27  Eric Carlson  <[email protected]>
+
+        [Mac] PiP placeholder should remain visible when 'controls' attribute is removed
+        https://bugs.webkit.org/show_bug.cgi?id=159158
+        <rdar://problem/26727435>
+
+        Reviewed by Jer Noble.
+
+        No new tests, existing test updated.
+
+        * Modules/mediacontrols/mediaControlsApple.js:
+        (Controller.prototype.shouldHaveControls): Always return true when in PiP or AirPlay mode.
+
 2016-06-27  Oliver Hunt  <[email protected]>
 
         Update ATS WebContent exception for more robust framework information

Modified: trunk/Source/WebCore/Modules/mediacontrols/mediaControlsApple.js (202508 => 202509)


--- trunk/Source/WebCore/Modules/mediacontrols/mediaControlsApple.js	2016-06-27 19:52:26 UTC (rev 202508)
+++ trunk/Source/WebCore/Modules/mediacontrols/mediaControlsApple.js	2016-06-27 20:37:48 UTC (rev 202509)
@@ -306,7 +306,10 @@
         if (!this.isAudio() && !this.host.allowsInlineMediaPlayback)
             return true;
 
-        return this.video.controls || this.isFullScreen();
+        if (this.isFullScreen() || this.presentationMode() === 'picture-in-picture' || this.currentPlaybackTargetIsWireless())
+            return true;
+
+        return this.video.controls;
     },
 
     setNeedsTimelineMetricsUpdate: function()
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to