[Modern Media Controls] Disabling both fullscreen and picture-in-picture shows an...
authorgraouts@webkit.org <graouts@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 4 Sep 2018 18:40:12 +0000 (18:40 +0000)
committergraouts@webkit.org <graouts@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 4 Sep 2018 18:40:12 +0000 (18:40 +0000)
https://bugs.webkit.org/show_bug.cgi?id=189259
<rdar://problem/42026625>

Reviewed by Dean Jackson.

Source/WebCore:

Test: media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-disabled-fullscreen-and-pip.html

Ensure the top left controls bar is hidden when none of its children are visible.

* Modules/modern-media-controls/controls/inline-media-controls.js:
(InlineMediaControls.prototype.layout):

LayoutTests:

Adding a new test that checks that the top left container is hidden when both the fullscreen and picture-in-picture buttons are disabled.

* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-disabled-fullscreen-and-pip-expected.txt: Added.
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-disabled-fullscreen-and-pip.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235622 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-disabled-fullscreen-and-pip-expected.txt [new file with mode: 0644]
LayoutTests/media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-disabled-fullscreen-and-pip.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/Modules/modern-media-controls/controls/inline-media-controls.js

index 53a30b7..17eb593 100644 (file)
@@ -1,3 +1,16 @@
+2018-09-04  Antoine Quint  <graouts@apple.com>
+
+        [Modern Media Controls] Disabling both fullscreen and picture-in-picture shows an empty top left container
+        https://bugs.webkit.org/show_bug.cgi?id=189259
+        <rdar://problem/42026625>
+
+        Reviewed by Dean Jackson.
+
+        Adding a new test that checks that the top left container is hidden when both the fullscreen and picture-in-picture buttons are disabled.
+
+        * media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-disabled-fullscreen-and-pip-expected.txt: Added.
+        * media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-disabled-fullscreen-and-pip.html: Added.
+
 2018-09-04  Per Arne Vollan  <pvollan@apple.com>
 
         Add test for fix in https://bugs.webkit.org/show_bug.cgi?id=187922
diff --git a/LayoutTests/media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-disabled-fullscreen-and-pip-expected.txt b/LayoutTests/media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-disabled-fullscreen-and-pip-expected.txt
new file mode 100644 (file)
index 0000000..2112e22
--- /dev/null
@@ -0,0 +1,10 @@
+Testing MacOSInlineMediaControls with disabled fullscreen and picture-in-picture buttons.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS mediaControls.topLeftControlsBar.visible is false
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-disabled-fullscreen-and-pip.html b/LayoutTests/media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-disabled-fullscreen-and-pip.html
new file mode 100644 (file)
index 0000000..ff0a851
--- /dev/null
@@ -0,0 +1,19 @@
+<script src="../../../resources/js-test-pre.js"></script>
+<script src="../resources/media-controls-loader.js" type="text/javascript"></script>
+<script src="../resources/media-controls-utils.js" type="text/javascript"></script>
+<body>
+<script type="text/javascript">
+
+description("Testing <code>MacOSInlineMediaControls</code> with disabled fullscreen and picture-in-picture buttons.");
+
+const mediaControls = new MacOSInlineMediaControls({ width: 680, height: 300 });
+
+// Disabling both the fullscreen and picture-and-picture buttons should make the top left controls bar have no visible
+// buttons and thus have its visible property set to false.
+mediaControls.fullscreenButton.enabled = false;
+mediaControls.pipButton.enabled = false;
+shouldBeFalse("mediaControls.topLeftControlsBar.visible");
+
+</script>
+<script src="../../../resources/js-test-post.js"></script>
+</body>
index e85aec0..8c0a91d 100644 (file)
@@ -1,3 +1,18 @@
+2018-09-04  Antoine Quint  <graouts@apple.com>
+
+        [Modern Media Controls] Disabling both fullscreen and picture-in-picture shows an empty top left container
+        https://bugs.webkit.org/show_bug.cgi?id=189259
+        <rdar://problem/42026625>
+
+        Reviewed by Dean Jackson.
+
+        Test: media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-disabled-fullscreen-and-pip.html
+
+        Ensure the top left controls bar is hidden when none of its children are visible.
+
+        * Modules/modern-media-controls/controls/inline-media-controls.js:
+        (InlineMediaControls.prototype.layout):
+
 2018-09-04  Daniel Bates  <dabates@apple.com>
 
         Attempt to fix failing tests following r235615 (https://bugs.webkit.org/show_bug.cgi?id=187925)
index ac487ab..0de34b5 100644 (file)
@@ -134,7 +134,7 @@ class InlineMediaControls extends MediaControls
         this._topLeftControlsBarContainer.children = this._topLeftContainerButtons();
         this._topLeftControlsBarContainer.layout();
         this.topLeftControlsBar.width = this._topLeftControlsBarContainer.width;
-        this.topLeftControlsBar.visible = this._topLeftControlsBarContainer.children.length > 0;
+        this.topLeftControlsBar.visible = this._topLeftControlsBarContainer.children.some(button => button.visible);
 
         // Compute the visible size for the controls bar.
         this.bottomControlsBar.width = this._shouldUseAudioLayout ? this.width : (this.width - 2 * InsideMargin);