Title: [213920] trunk
Revision
213920
Author
[email protected]
Date
2017-03-14 11:29:14 -0700 (Tue, 14 Mar 2017)

Log Message

[Modern Media Controls] Fullscreen controls during Live Broadcast is completely broken
https://bugs.webkit.org/show_bug.cgi?id=169354
<rdar://problem/30636370>

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

Source/WebCore:

When playing a Live Broadcast video in fullscreen, we should not show any scrubbing-related
piece of UI and ensure that we show the status label.

Test: http/tests/media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-live-broadcast.html

* Modules/modern-media-controls/controls/macos-fullscreen-media-controls.css:
(.media-controls.mac.fullscreen > .controls-bar .status-label):
* Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
(MacOSFullscreenMediaControls.prototype.layout):
* Modules/modern-media-controls/media/seek-support.js:
(SeekSupport.prototype.get mediaEvents):
(SeekSupport.prototype.syncControl):

LayoutTests:

Add a new test, skipped on iOS, to check scrubbing controls are disabled in fullscreen
for a Live Broadcast video and that the status label is visible. We also rebaseline a
couple of tests now that the time control is added on first layout instead of inside
the constructor.

* http/tests/media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-live-broadcast-expected.txt: Added.
* http/tests/media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-live-broadcast.html: Added.
* media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-constructor-expected.txt:
* media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-constructor.html:
* media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-time-control-styles-expected.txt:
* media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-time-control-styles.html:
* platform/ios-simulator/TestExpectations:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (213919 => 213920)


--- trunk/LayoutTests/ChangeLog	2017-03-14 18:24:14 UTC (rev 213919)
+++ trunk/LayoutTests/ChangeLog	2017-03-14 18:29:14 UTC (rev 213920)
@@ -1,3 +1,24 @@
+2017-03-14  Antoine Quint  <[email protected]>
+
+        [Modern Media Controls] Fullscreen controls during Live Broadcast is completely broken
+        https://bugs.webkit.org/show_bug.cgi?id=169354
+        <rdar://problem/30636370>
+
+        Reviewed by Dean Jackson.
+
+        Add a new test, skipped on iOS, to check scrubbing controls are disabled in fullscreen
+        for a Live Broadcast video and that the status label is visible. We also rebaseline a
+        couple of tests now that the time control is added on first layout instead of inside
+        the constructor.
+
+        * http/tests/media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-live-broadcast-expected.txt: Added.
+        * http/tests/media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-live-broadcast.html: Added.
+        * media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-constructor-expected.txt:
+        * media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-constructor.html:
+        * media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-time-control-styles-expected.txt:
+        * media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-time-control-styles.html:
+        * platform/ios-simulator/TestExpectations:
+
 2017-03-14  Ryan Haddad  <[email protected]>
 
         Skip 12 web-platform-tests until wptserver is upgraded.

Added: trunk/LayoutTests/http/tests/media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-live-broadcast-expected.txt (0 => 213920)


--- trunk/LayoutTests/http/tests/media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-live-broadcast-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/http/tests/media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-live-broadcast-expected.txt	2017-03-14 18:29:14 UTC (rev 213920)
@@ -0,0 +1,15 @@
+Testing that we do not show the seeking controls in fullscreen with a live broadcast video and instead show the status label.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS media.duration became Number.POSITIVE_INFINITY
+PASS mediaController.controls.rewindButton.enabled is false
+PASS mediaController.controls.forwardButton.enabled is false
+PASS mediaController.controls.timeControl.parent is null
+PASS mediaController.controls.statusLabel.parent is mediaController.controls.controlsBar
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/http/tests/media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-live-broadcast.html (0 => 213920)


--- trunk/LayoutTests/http/tests/media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-live-broadcast.html	                        (rev 0)
+++ trunk/LayoutTests/http/tests/media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-live-broadcast.html	2017-03-14 18:29:14 UTC (rev 213920)
@@ -0,0 +1,45 @@
+<script src=""
+<script src=""
+<script src=""
+<body>
+<video src="" style="width: 800px;" autoplay></video>
+<div id="shadow"></div>
+<script type="text/_javascript_">
+
+window.jsTestIsAsync = true;
+
+description("Testing that we do not show the seeking controls in fullscreen with a live broadcast video and instead show the status label.");
+
+const shadowRoot = document.querySelector("div#shadow").attachShadow({ mode: "open" });
+const media = document.querySelector("video");
+const mediaController = createControls(shadowRoot, media, null);
+
+media.addEventListener("webkitfullscreenchange", () => {
+    if (!media.webkitDisplayingFullscreen)
+        return;
+
+    shouldBecomeEqual("media.duration", "Number.POSITIVE_INFINITY", () => {
+        shouldBeFalse("mediaController.controls.rewindButton.enabled");
+        shouldBeFalse("mediaController.controls.forwardButton.enabled");
+        shouldBe("mediaController.controls.timeControl.parent", "null");
+        shouldBe("mediaController.controls.statusLabel.parent", "mediaController.controls.controlsBar");
+
+        debug("");
+        media.remove();
+        shadowRoot.host.remove();
+        finishJSTest();
+    });
+});
+
+media.addEventListener("play", () => {
+    media.pause();
+
+    const button = document.body.appendChild(document.createElement("button"));
+    button.addEventListener("click", event => media.webkitEnterFullscreen());
+    pressOnElement(button);
+    button.remove();
+});
+
+</script>
+<script src=""
+</body>

Modified: trunk/LayoutTests/media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-constructor-expected.txt (213919 => 213920)


--- trunk/LayoutTests/media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-constructor-expected.txt	2017-03-14 18:24:14 UTC (rev 213919)
+++ trunk/LayoutTests/media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-constructor-expected.txt	2017-03-14 18:29:14 UTC (rev 213920)
@@ -8,11 +8,10 @@
 PASS mediaControls.layoutTraits is LayoutTraits.macOS | LayoutTraits.Fullscreen
 
 Controls bar
-PASS mediaControls.controlsBar.children.length is 5
+PASS mediaControls.controlsBar.children.length is 4
 PASS mediaControls.controlsBar.children[1] instanceof ButtonsContainer is true
 PASS mediaControls.controlsBar.children[2] instanceof ButtonsContainer is true
 PASS mediaControls.controlsBar.children[3] instanceof ButtonsContainer is true
-PASS mediaControls.controlsBar.children[4] is mediaControls.timeControl
 
 Left container
 PASS mediaControls.controlsBar.children[1].buttons is [mediaControls.volumeDownButton, mediaControls.volumeSlider, mediaControls.volumeUpButton]

Modified: trunk/LayoutTests/media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-constructor.html (213919 => 213920)


--- trunk/LayoutTests/media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-constructor.html	2017-03-14 18:24:14 UTC (rev 213919)
+++ trunk/LayoutTests/media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-constructor.html	2017-03-14 18:29:14 UTC (rev 213920)
@@ -13,11 +13,10 @@
 
 debug("");
 debug("Controls bar");
-shouldBe("mediaControls.controlsBar.children.length", "5");
+shouldBe("mediaControls.controlsBar.children.length", "4");
 shouldBeTrue("mediaControls.controlsBar.children[1] instanceof ButtonsContainer");
 shouldBeTrue("mediaControls.controlsBar.children[2] instanceof ButtonsContainer");
 shouldBeTrue("mediaControls.controlsBar.children[3] instanceof ButtonsContainer");
-shouldBe("mediaControls.controlsBar.children[4]", "mediaControls.timeControl");
 
 debug("");
 debug("Left container");

Modified: trunk/LayoutTests/media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-time-control-styles-expected.txt (213919 => 213920)


--- trunk/LayoutTests/media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-time-control-styles-expected.txt	2017-03-14 18:24:14 UTC (rev 213919)
+++ trunk/LayoutTests/media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-time-control-styles-expected.txt	2017-03-14 18:29:14 UTC (rev 213920)
@@ -3,9 +3,9 @@
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
+PASS window.getComputedStyle(mediaControls.timeControl.element).width became "457px"
 PASS window.getComputedStyle(mediaControls.timeControl.element).left is "10px"
 PASS window.getComputedStyle(mediaControls.timeControl.element).top is "48px"
-PASS window.getComputedStyle(mediaControls.timeControl.element).width is "457px"
 PASS window.getComputedStyle(mediaControls.timeControl.scrubber.element).top is "-3px"
 PASS window.getComputedStyle(mediaControls.timeControl.elapsedTimeLabel.element).fontSize is "12px"
 PASS window.getComputedStyle(mediaControls.timeControl.remainingTimeLabel.element).fontSize is "12px"

Modified: trunk/LayoutTests/media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-time-control-styles.html (213919 => 213920)


--- trunk/LayoutTests/media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-time-control-styles.html	2017-03-14 18:24:14 UTC (rev 213919)
+++ trunk/LayoutTests/media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-time-control-styles.html	2017-03-14 18:29:14 UTC (rev 213920)
@@ -9,14 +9,11 @@
 window.jsTestIsAsync = true;
 
 const mediaControls = new MacOSFullscreenMediaControls;
+document.body.appendChild(mediaControls.element);
 
-scheduler.frameDidFire = function()
-{
-    document.body.appendChild(mediaControls.element);
-
+shouldBecomeEqualToString("window.getComputedStyle(mediaControls.timeControl.element).width", "457px", () => {
     shouldBeEqualToString("window.getComputedStyle(mediaControls.timeControl.element).left", "10px");
     shouldBeEqualToString("window.getComputedStyle(mediaControls.timeControl.element).top", "48px");
-    shouldBeEqualToString("window.getComputedStyle(mediaControls.timeControl.element).width", "457px");
     shouldBeEqualToString("window.getComputedStyle(mediaControls.timeControl.scrubber.element).top", "-3px");
     shouldBeEqualToString("window.getComputedStyle(mediaControls.timeControl.elapsedTimeLabel.element).fontSize", "12px");
     shouldBeEqualToString("window.getComputedStyle(mediaControls.timeControl.remainingTimeLabel.element).fontSize", "12px");
@@ -25,7 +22,7 @@
     mediaControls.element.remove();
 
     finishMediaControlsTest();
-};
+});
 
 </script>
 <script src=""

Modified: trunk/LayoutTests/platform/ios-simulator/TestExpectations (213919 => 213920)


--- trunk/LayoutTests/platform/ios-simulator/TestExpectations	2017-03-14 18:24:14 UTC (rev 213919)
+++ trunk/LayoutTests/platform/ios-simulator/TestExpectations	2017-03-14 18:29:14 UTC (rev 213920)
@@ -2809,6 +2809,7 @@
 media/modern-media-controls/volume-up-support [ Skip ]
 media/modern-media-controls/controls-visibility-support/controls-visibility-support-fullscreen-on-video.html [ Skip ]
 media/modern-media-controls/controls-visibility-support/controls-visibility-support-fullscreen-on-parent-element.html [ Skip ]
+http/tests/media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-live-broadcast.html [ Skip ]
 
 # These tests are macOS-specific or mouse-specific
 media/modern-media-controls/media-controller/media-controller-auto-hide-mouse-leave-after-play.html [ Skip ]

Modified: trunk/Source/WebCore/ChangeLog (213919 => 213920)


--- trunk/Source/WebCore/ChangeLog	2017-03-14 18:24:14 UTC (rev 213919)
+++ trunk/Source/WebCore/ChangeLog	2017-03-14 18:29:14 UTC (rev 213920)
@@ -1,3 +1,24 @@
+2017-03-14  Antoine Quint  <[email protected]>
+
+        [Modern Media Controls] Fullscreen controls during Live Broadcast is completely broken
+        https://bugs.webkit.org/show_bug.cgi?id=169354
+        <rdar://problem/30636370>
+
+        Reviewed by Dean Jackson.
+
+        When playing a Live Broadcast video in fullscreen, we should not show any scrubbing-related
+        piece of UI and ensure that we show the status label.
+
+        Test: http/tests/media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-live-broadcast.html
+
+        * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.css:
+        (.media-controls.mac.fullscreen > .controls-bar .status-label):
+        * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
+        (MacOSFullscreenMediaControls.prototype.layout):
+        * Modules/modern-media-controls/media/seek-support.js:
+        (SeekSupport.prototype.get mediaEvents):
+        (SeekSupport.prototype.syncControl):
+
 2017-03-14  Joseph Pecoraro  <[email protected]>
 
         Web Inspector: More accurate Resource Timing data in Web Inspector

Modified: trunk/Source/WebCore/Modules/modern-media-controls/controls/macos-fullscreen-media-controls.css (213919 => 213920)


--- trunk/Source/WebCore/Modules/modern-media-controls/controls/macos-fullscreen-media-controls.css	2017-03-14 18:24:14 UTC (rev 213919)
+++ trunk/Source/WebCore/Modules/modern-media-controls/controls/macos-fullscreen-media-controls.css	2017-03-14 18:29:14 UTC (rev 213920)
@@ -117,3 +117,13 @@
 .media-controls.mac.fullscreen .scrubber {
     top: -3px;
 }
+
+/* Status Label */
+
+.media-controls.mac.fullscreen > .controls-bar .status-label {
+    position: absolute;
+    left: 0;
+    right: 0;
+    bottom: 13px;
+    text-align: center;
+}

Modified: trunk/Source/WebCore/Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js (213919 => 213920)


--- trunk/Source/WebCore/Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js	2017-03-14 18:24:14 UTC (rev 213919)
+++ trunk/Source/WebCore/Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js	2017-03-14 18:29:14 UTC (rev 213920)
@@ -71,7 +71,7 @@
             rightMargin: 12
         });
 
-        this.controlsBar.children = [new BackgroundTint, this._leftContainer, this._centerContainer, this._rightContainer, this.timeControl];
+        this.controlsBar.children = [new BackgroundTint, this._leftContainer, this._centerContainer, this._rightContainer];
 
         this.controlsBar.element.addEventListener("mousedown", this);
     }
@@ -108,7 +108,14 @@
         this._centerContainer.layout();
         this._rightContainer.layout();
 
-        this.timeControl.width = FullscreenTimeControlWidth;
+        if (this.statusLabel.enabled && this.statusLabel.parent !== this.controlsBar) {
+            this.timeControl.remove();
+            this.controlsBar.addChild(this.statusLabel);
+        } else if (!this.statusLabel.enabled && this.timeControl.parent !== this.controlsBar) {
+            this.statusLabel.remove();
+            this.controlsBar.addChild(this.timeControl);
+            this.timeControl.width = FullscreenTimeControlWidth;
+        }
     }
 
     // Private

Modified: trunk/Source/WebCore/Modules/modern-media-controls/media/seek-support.js (213919 => 213920)


--- trunk/Source/WebCore/Modules/modern-media-controls/media/seek-support.js	2017-03-14 18:24:14 UTC (rev 213919)
+++ trunk/Source/WebCore/Modules/modern-media-controls/media/seek-support.js	2017-03-14 18:29:14 UTC (rev 213920)
@@ -28,6 +28,11 @@
 
     // Protected
 
+    get mediaEvents()
+    {
+        return ["durationchange"];
+    }
+
     get multiplier()
     {
         // Implemented by subclasses.
@@ -41,6 +46,11 @@
             this._stopSeeking();
     }
 
+    syncControl()
+    {
+        this.control.enabled = this.mediaController.media.duration !== Number.POSITIVE_INFINITY;
+    }
+
     // Private
 
     _startSeeking()
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to