Title: [214429] trunk
Revision
214429
Author
[email protected]
Date
2017-03-27 14:20:30 -0700 (Mon, 27 Mar 2017)

Log Message

Unreviewed, rolling out r214411.

Two of the LayoutTests for this change time out on ios-
simulator.

Reverted changeset:

"[Modern Media Controls] Improve media documents across macOS,
iPhone and iPad"
https://bugs.webkit.org/show_bug.cgi?id=169145
http://trac.webkit.org/changeset/214411

Modified Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (214428 => 214429)


--- trunk/LayoutTests/ChangeLog	2017-03-27 20:55:45 UTC (rev 214428)
+++ trunk/LayoutTests/ChangeLog	2017-03-27 21:20:30 UTC (rev 214429)
@@ -1,3 +1,17 @@
+2017-03-27  Ryan Haddad  <[email protected]>
+
+        Unreviewed, rolling out r214411.
+
+        Two of the LayoutTests for this change time out on ios-
+        simulator.
+
+        Reverted changeset:
+
+        "[Modern Media Controls] Improve media documents across macOS,
+        iPhone and iPad"
+        https://bugs.webkit.org/show_bug.cgi?id=169145
+        http://trac.webkit.org/changeset/214411
+
 2017-03-27  Antoine Quint  <[email protected]>
 
         [Modern Media Controls] Clicking on the tracks button when the tracks panel is up in a media document pauses the video

Deleted: trunk/LayoutTests/media/modern-media-controls/fullscreen-support/fullscreen-support-disabled-video-with-audio-tracks-only-expected.txt (214428 => 214429)


--- trunk/LayoutTests/media/modern-media-controls/fullscreen-support/fullscreen-support-disabled-video-with-audio-tracks-only-expected.txt	2017-03-27 20:55:45 UTC (rev 214428)
+++ trunk/LayoutTests/media/modern-media-controls/fullscreen-support/fullscreen-support-disabled-video-with-audio-tracks-only-expected.txt	2017-03-27 21:20:30 UTC (rev 214429)
@@ -1,14 +0,0 @@
-Testing that the fullscreen button is disabled for <video> with an audio resource.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Once media loads its metadata the fullscreen button should become disabled
-Obtained loadedmetadata event
-PASS mediaController.isAudio is true
-PASS mediaController.controls.fullscreenButton.enabled is false
-
-PASS successfullyParsed is true
-
-TEST COMPLETE
-

Deleted: trunk/LayoutTests/media/modern-media-controls/fullscreen-support/fullscreen-support-disabled-video-with-audio-tracks-only.html (214428 => 214429)


--- trunk/LayoutTests/media/modern-media-controls/fullscreen-support/fullscreen-support-disabled-video-with-audio-tracks-only.html	2017-03-27 20:55:45 UTC (rev 214428)
+++ trunk/LayoutTests/media/modern-media-controls/fullscreen-support/fullscreen-support-disabled-video-with-audio-tracks-only.html	2017-03-27 21:20:30 UTC (rev 214429)
@@ -1,44 +0,0 @@
-<script src=""
-<script src="" type="text/_javascript_"></script>
-<body>
-<style type="text/css" media="screen">
-    
-    video, #host {
-        position: absolute;
-        top: 0;
-        left: 0;
-    }
-
-    video {
-        width: 800px;
-        height: 240px;
-    }
-    
-</style>
-<video src="" controls autoplay></video>
-<div id="host"></div>
-<script type="text/_javascript_">
-
-window.jsTestIsAsync = true;
-
-description("Testing that the fullscreen button is disabled for &lt;video> with an audio resource.");
-
-const container = document.querySelector("div#host");
-const media = document.querySelector("video");
-const mediaController = createControls(container, media, null);
-
-debug("Once media loads its metadata the fullscreen button should become disabled");
-media.addEventListener("loadedmetadata", () => {
-    debug("Obtained loadedmetadata event");
-    shouldBeTrue("mediaController.isAudio");
-    shouldBeFalse("mediaController.controls.fullscreenButton.enabled");
-    
-    debug("");
-    media.remove();
-    container.remove();
-    finishJSTest();
-});
-
-</script>
-<script src=""
-</body>

Deleted: trunk/LayoutTests/media/modern-media-controls/media-documents/media-document-audio-ios-sizing-expected.txt (214428 => 214429)


--- trunk/LayoutTests/media/modern-media-controls/media-documents/media-document-audio-ios-sizing-expected.txt	2017-03-27 20:55:45 UTC (rev 214428)
+++ trunk/LayoutTests/media/modern-media-controls/media-documents/media-document-audio-ios-sizing-expected.txt	2017-03-27 21:20:30 UTC (rev 214429)
@@ -1,12 +0,0 @@
-Testing the size of the media element in an audio media document on iOS.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS getComputedStyle(media).width became "320px"
-PASS getComputedStyle(media).height is "50px"
-
-PASS successfullyParsed is true
-
-TEST COMPLETE
-

Deleted: trunk/LayoutTests/media/modern-media-controls/media-documents/media-document-audio-ios-sizing.html (214428 => 214429)


--- trunk/LayoutTests/media/modern-media-controls/media-documents/media-document-audio-ios-sizing.html	2017-03-27 20:55:45 UTC (rev 214428)
+++ trunk/LayoutTests/media/modern-media-controls/media-documents/media-document-audio-ios-sizing.html	2017-03-27 21:20:30 UTC (rev 214429)
@@ -1,35 +0,0 @@
-<!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true ] -->
-<script src=""
-<meta name="viewport" content="width=device-width, initial-scale=1">
-<body>
-<iframe src="" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"></iframe>
-<script type="text/_javascript_">
-
-description("Testing the size of the media element in an audio media document on iOS.");
-
-window.jsTestIsAsync = true;
-
-let media;
-
-(function runTestIfReady() {
-    const iframe = document.querySelector("iframe");
-    media = iframe.contentDocument.querySelector("video");
-
-    if (!media) {
-        setTimeout(runTestIfReady);
-        return;
-    }
-
-    shouldBecomeEqualToString("getComputedStyle(media).width", "320px", () => {
-        shouldBeEqualToString("getComputedStyle(media).height", "50px");
-
-        debug("");
-        iframe.remove();
-        finishJSTest();
-    });
-
-})();
-
-</script>
-<script src=""
-</body>

Deleted: trunk/LayoutTests/media/modern-media-controls/media-documents/media-document-audio-mac-sizing-expected.txt (214428 => 214429)


--- trunk/LayoutTests/media/modern-media-controls/media-documents/media-document-audio-mac-sizing-expected.txt	2017-03-27 20:55:45 UTC (rev 214428)
+++ trunk/LayoutTests/media/modern-media-controls/media-documents/media-document-audio-mac-sizing-expected.txt	2017-03-27 21:20:30 UTC (rev 214429)
@@ -1,12 +0,0 @@
-Testing the size of the media element in an audio media document on macOS.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS getComputedStyle(media).width became "650px"
-PASS getComputedStyle(media).height is "25px"
-
-PASS successfullyParsed is true
-
-TEST COMPLETE
-

Deleted: trunk/LayoutTests/media/modern-media-controls/media-documents/media-document-audio-mac-sizing.html (214428 => 214429)


--- trunk/LayoutTests/media/modern-media-controls/media-documents/media-document-audio-mac-sizing.html	2017-03-27 20:55:45 UTC (rev 214428)
+++ trunk/LayoutTests/media/modern-media-controls/media-documents/media-document-audio-mac-sizing.html	2017-03-27 21:20:30 UTC (rev 214429)
@@ -1,33 +0,0 @@
-<script src=""
-<body>
-<iframe src="" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"></iframe>
-<script type="text/_javascript_">
-
-description("Testing the size of the media element in an audio media document on macOS.");
-
-window.jsTestIsAsync = true;
-
-let media;
-
-(function runTestIfReady() {
-    const iframe = document.querySelector("iframe");
-    media = iframe.contentDocument.querySelector("video");
-
-    if (!media) {
-        setTimeout(runTestIfReady);
-        return;
-    }
-
-    shouldBecomeEqualToString("getComputedStyle(media).width", "650px", () => {
-        shouldBeEqualToString("getComputedStyle(media).height", "25px");
-
-        debug("");
-        iframe.remove();
-        finishJSTest();
-    });
-
-})();
-
-</script>
-<script src=""
-</body>

Deleted: trunk/LayoutTests/media/modern-media-controls/media-documents/media-document-video-ios-sizing-expected.txt (214428 => 214429)


--- trunk/LayoutTests/media/modern-media-controls/media-documents/media-document-video-ios-sizing-expected.txt	2017-03-27 20:55:45 UTC (rev 214428)
+++ trunk/LayoutTests/media/modern-media-controls/media-documents/media-document-video-ios-sizing-expected.txt	2017-03-27 21:20:30 UTC (rev 214429)
@@ -1,12 +0,0 @@
-Testing the size of the media element in a video media document on iOS.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS getComputedStyle(media).height became "240px"
-PASS getComputedStyle(media).width is "320px"
-
-PASS successfullyParsed is true
-
-TEST COMPLETE
-

Deleted: trunk/LayoutTests/media/modern-media-controls/media-documents/media-document-video-ios-sizing.html (214428 => 214429)


--- trunk/LayoutTests/media/modern-media-controls/media-documents/media-document-video-ios-sizing.html	2017-03-27 20:55:45 UTC (rev 214428)
+++ trunk/LayoutTests/media/modern-media-controls/media-documents/media-document-video-ios-sizing.html	2017-03-27 21:20:30 UTC (rev 214429)
@@ -1,35 +0,0 @@
-<!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true ] -->
-<script src=""
-<meta name="viewport" content="width=device-width, initial-scale=1">
-<body>
-<iframe src="" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"></iframe>
-<script type="text/_javascript_">
-
-description("Testing the size of the media element in a video media document on iOS.");
-
-window.jsTestIsAsync = true;
-
-let media;
-
-(function runTestIfReady() {
-    const iframe = document.querySelector("iframe");
-    media = iframe.contentDocument.querySelector("video");
-
-    if (!media) {
-        setTimeout(runTestIfReady);
-        return;
-    }
-
-    shouldBecomeEqualToString("getComputedStyle(media).height", "240px", () => {
-        shouldBeEqualToString("getComputedStyle(media).width", "320px");
-
-        debug("");
-        iframe.remove();
-        finishJSTest();
-    });
-
-})();
-
-</script>
-<script src=""
-</body>

Deleted: trunk/LayoutTests/media/modern-media-controls/media-documents/media-document-video-mac-sizing-expected.txt (214428 => 214429)


--- trunk/LayoutTests/media/modern-media-controls/media-documents/media-document-video-mac-sizing-expected.txt	2017-03-27 20:55:45 UTC (rev 214428)
+++ trunk/LayoutTests/media/modern-media-controls/media-documents/media-document-video-mac-sizing-expected.txt	2017-03-27 21:20:30 UTC (rev 214429)
@@ -1,12 +0,0 @@
-Testing the size of the media element in a video media document on macOS.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS getComputedStyle(media).width became "700px"
-PASS getComputedStyle(media).height is "525px"
-
-PASS successfullyParsed is true
-
-TEST COMPLETE
-

Deleted: trunk/LayoutTests/media/modern-media-controls/media-documents/media-document-video-mac-sizing.html (214428 => 214429)


--- trunk/LayoutTests/media/modern-media-controls/media-documents/media-document-video-mac-sizing.html	2017-03-27 20:55:45 UTC (rev 214428)
+++ trunk/LayoutTests/media/modern-media-controls/media-documents/media-document-video-mac-sizing.html	2017-03-27 21:20:30 UTC (rev 214429)
@@ -1,33 +0,0 @@
-<script src=""
-<body>
-<iframe src="" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"></iframe>
-<script type="text/_javascript_">
-
-description("Testing the size of the media element in a video media document on macOS.");
-
-window.jsTestIsAsync = true;
-
-let media;
-
-(function runTestIfReady() {
-    const iframe = document.querySelector("iframe");
-    media = iframe.contentDocument.querySelector("video");
-
-    if (!media) {
-        setTimeout(runTestIfReady);
-        return;
-    }
-
-    shouldBecomeEqualToString("getComputedStyle(media).width", "700px", () => {
-        shouldBeEqualToString("getComputedStyle(media).height", "525px");
-
-        debug("");
-        iframe.remove();
-        finishJSTest();
-    });
-
-})();
-
-</script>
-<script src=""
-</body>

Deleted: trunk/LayoutTests/media/modern-media-controls/pip-support/pip-support-disabled-video-with-audio-tracks-only-expected.txt (214428 => 214429)


--- trunk/LayoutTests/media/modern-media-controls/pip-support/pip-support-disabled-video-with-audio-tracks-only-expected.txt	2017-03-27 20:55:45 UTC (rev 214428)
+++ trunk/LayoutTests/media/modern-media-controls/pip-support/pip-support-disabled-video-with-audio-tracks-only-expected.txt	2017-03-27 21:20:30 UTC (rev 214429)
@@ -1,14 +0,0 @@
-Testing that the picture-in-picture button is disabled for <video> with an audio resource.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Once media loads its metadata the picture-in-picture button should become disabled
-Obtained loadedmetadata event
-PASS mediaController.isAudio is true
-PASS mediaController.controls.pipButton.enabled is false
-
-PASS successfullyParsed is true
-
-TEST COMPLETE
-

Deleted: trunk/LayoutTests/media/modern-media-controls/pip-support/pip-support-disabled-video-with-audio-tracks-only.html (214428 => 214429)


--- trunk/LayoutTests/media/modern-media-controls/pip-support/pip-support-disabled-video-with-audio-tracks-only.html	2017-03-27 20:55:45 UTC (rev 214428)
+++ trunk/LayoutTests/media/modern-media-controls/pip-support/pip-support-disabled-video-with-audio-tracks-only.html	2017-03-27 21:20:30 UTC (rev 214429)
@@ -1,44 +0,0 @@
-<script src=""
-<script src="" type="text/_javascript_"></script>
-<body>
-<style type="text/css" media="screen">
-    
-    video, #host {
-        position: absolute;
-        top: 0;
-        left: 0;
-    }
-
-    video {
-        width: 800px;
-        height: 240px;
-    }
-    
-</style>
-<video src="" controls autoplay></video>
-<div id="host"></div>
-<script type="text/_javascript_">
-
-window.jsTestIsAsync = true;
-
-description("Testing that the picture-in-picture button is disabled for &lt;video> with an audio resource.");
-
-const container = document.querySelector("div#host");
-const media = document.querySelector("video");
-const mediaController = createControls(container, media, null);
-
-debug("Once media loads its metadata the picture-in-picture button should become disabled");
-media.addEventListener("loadedmetadata", () => {
-    debug("Obtained loadedmetadata event");
-    shouldBeTrue("mediaController.isAudio");
-    shouldBeFalse("mediaController.controls.pipButton.enabled");
-    
-    debug("");
-    media.remove();
-    container.remove();
-    finishJSTest();
-});
-
-</script>
-<script src=""
-</body>

Modified: trunk/LayoutTests/platform/ios-simulator/TestExpectations (214428 => 214429)


--- trunk/LayoutTests/platform/ios-simulator/TestExpectations	2017-03-27 20:55:45 UTC (rev 214428)
+++ trunk/LayoutTests/platform/ios-simulator/TestExpectations	2017-03-27 21:20:30 UTC (rev 214429)
@@ -2840,8 +2840,6 @@
 media/modern-media-controls/placard-support/placard-support-pip.html [ Skip ]
 media/modern-media-controls/scrubber-support/scrubber-support-drag.html [ Skip ]
 media/modern-media-controls/scrubber-support/ipad/scrubber-support-drag.html [ Skip ]
-media/modern-media-controls/media-documents/media-document-audio-mac-sizing.html [ Skip ]
-media/modern-media-controls/media-documents/media-document-video-mac-sizing.html [ Skip ]
 
 # These tests use uiController and need to be skipped in open-source
 media/modern-media-controls/placard-support/ipad/placard-support-pip.html [ Skip ]

Modified: trunk/LayoutTests/platform/mac/TestExpectations (214428 => 214429)


--- trunk/LayoutTests/platform/mac/TestExpectations	2017-03-27 20:55:45 UTC (rev 214428)
+++ trunk/LayoutTests/platform/mac/TestExpectations	2017-03-27 21:20:30 UTC (rev 214429)
@@ -1472,10 +1472,6 @@
 media/modern-media-controls/media-controller/media-controller-ios-only-enable-tap-gesture-recognizer-with-fades-when-idle.html [ Skip ]
 media/modern-media-controls/media-controller/media-controller-ios-do-not-hide-controls-when-tapping-button.html [ Skip ]
 media/modern-media-controls/media-controller/media-controller-tight-padding.html [ Skip ]
-media/modern-media-controls/media-documents/media-document-audio-ios-sizing.html [ Skip ]
-media/modern-media-controls/media-documents/media-document-video-ios-sizing.html [ Skip ]
-media/modern-media-controls/media-documents/ipad/media-document-audio-ios-sizing.html [ Skip ]
-media/modern-media-controls/media-documents/ipad/media-document-video-ios-sizing.html [ Skip ]
 media/modern-media-controls/audio/audio-controls-styles.html [ Skip ]
 
 webkit.org/b/169118 [ Debug ] media/modern-media-controls/fullscreen-support/fullscreen-support-click.html [ Pass Timeout ]

Modified: trunk/Source/WebCore/ChangeLog (214428 => 214429)


--- trunk/Source/WebCore/ChangeLog	2017-03-27 20:55:45 UTC (rev 214428)
+++ trunk/Source/WebCore/ChangeLog	2017-03-27 21:20:30 UTC (rev 214429)
@@ -1,3 +1,17 @@
+2017-03-27  Ryan Haddad  <[email protected]>
+
+        Unreviewed, rolling out r214411.
+
+        Two of the LayoutTests for this change time out on ios-
+        simulator.
+
+        Reverted changeset:
+
+        "[Modern Media Controls] Improve media documents across macOS,
+        iPhone and iPad"
+        https://bugs.webkit.org/show_bug.cgi?id=169145
+        http://trac.webkit.org/changeset/214411
+
 2017-03-27  Antoine Quint  <[email protected]>
 
         [Modern Media Controls] Clicking on the tracks button when the tracks panel is up in a media document pauses the video

Modified: trunk/Source/WebCore/Modules/modern-media-controls/controls/ios-inline-media-controls.css (214428 => 214429)


--- trunk/Source/WebCore/Modules/modern-media-controls/controls/ios-inline-media-controls.css	2017-03-27 20:55:45 UTC (rev 214428)
+++ trunk/Source/WebCore/Modules/modern-media-controls/controls/ios-inline-media-controls.css	2017-03-27 21:20:30 UTC (rev 214429)
@@ -43,8 +43,7 @@
     will-change: transform;
 }
 
-:host(audio) .media-controls.ios.inline > .controls-bar:before,
-:host(.media-document.audio) .media-controls.ios.inline > .controls-bar:before {
+:host(audio) .media-controls.ios.inline > .controls-bar:before {
     -webkit-appearance: none;
     background-color: rgb(212, 212, 212);
 }

Modified: trunk/Source/WebCore/Modules/modern-media-controls/controls/macos-media-controls.css (214428 => 214429)


--- trunk/Source/WebCore/Modules/modern-media-controls/controls/macos-media-controls.css	2017-03-27 20:55:45 UTC (rev 214428)
+++ trunk/Source/WebCore/Modules/modern-media-controls/controls/macos-media-controls.css	2017-03-27 21:20:30 UTC (rev 214429)
@@ -50,12 +50,10 @@
     -webkit-appearance: none !important;
 }
 
-:host(audio) .media-controls.mac.inline > .controls-bar,
-:host(.media-document.audio) .media-controls.mac.inline > .controls-bar {
+:host(audio) .media-controls.mac.inline > .controls-bar {
     background-color: rgb(41, 41, 41);
 }
 
-:host(audio) .media-controls.mac.inline > .controls-bar > .background-tint,
-:host(.media-document.audio) .media-controls.mac.inline > .controls-bar > .background-tint {
+:host(audio) .media-controls.mac.inline > .controls-bar > .background-tint {
     display: none;
 }

Deleted: trunk/Source/WebCore/Modules/modern-media-controls/controls/media-document.css (214428 => 214429)


--- trunk/Source/WebCore/Modules/modern-media-controls/controls/media-document.css	2017-03-27 20:55:45 UTC (rev 214428)
+++ trunk/Source/WebCore/Modules/modern-media-controls/controls/media-document.css	2017-03-27 21:20:30 UTC (rev 214429)
@@ -1,65 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All Rights Reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-:host(.media-document) {
-    visibility: hidden !important;
-    max-width: 100% !important;
-    min-height: 50px !important;
-}
-
-:host(.media-document.ready) {
-    visibility: visible !important;
-}
-
-/* Audio */
-
-:host(.media-document.audio.mac) {
-    width: 650px !important;
-    min-height: 25px !important;
-}
-
-:host(.media-document.audio.ipad) {
-    width: 650px !important;
-}
-
-:host(.media-document.audio.iphone) {
-    padding: 0 10px;
-    width: 100% !important;
-    box-sizing: border-box;
-}
-
-/* Video */
-
-:host(.media-document.video.mac) {
-    min-width: 700px !important;
-}
-
-:host(.media-document.video.ipad) {
-    min-width: 700px !important;
-}
-
-:host(.media-document.video.iphone) {
-    width: 100% !important;
-}

Modified: trunk/Source/WebCore/Modules/modern-media-controls/js-files (214428 => 214429)


--- trunk/Source/WebCore/Modules/modern-media-controls/js-files	2017-03-27 20:55:45 UTC (rev 214428)
+++ trunk/Source/WebCore/Modules/modern-media-controls/js-files	2017-03-27 21:20:30 UTC (rev 214429)
@@ -61,6 +61,5 @@
 media/volume-down-support.js
 media/volume-support.js
 media/volume-up-support.js
-media/media-document-controller.js
 media/media-controller.js
 

Modified: trunk/Source/WebCore/Modules/modern-media-controls/media/fullscreen-support.js (214428 => 214429)


--- trunk/Source/WebCore/Modules/modern-media-controls/media/fullscreen-support.js	2017-03-27 20:55:45 UTC (rev 214428)
+++ trunk/Source/WebCore/Modules/modern-media-controls/media/fullscreen-support.js	2017-03-27 21:20:30 UTC (rev 214429)
@@ -69,7 +69,7 @@
     {
         const control = this.control;
         const media = this.mediaController.media;
-        control.enabled = !this.mediaController.isAudio && media.webkitSupportsFullscreen;
+        control.enabled = media.webkitSupportsFullscreen && media.videoTracks.length > 0;
         control.isFullScreen = media.webkitDisplayingFullscreen;
     }
 

Modified: trunk/Source/WebCore/Modules/modern-media-controls/media/media-controller.js (214428 => 214429)


--- trunk/Source/WebCore/Modules/modern-media-controls/media/media-controller.js	2017-03-27 20:55:45 UTC (rev 214428)
+++ trunk/Source/WebCore/Modules/modern-media-controls/media/media-controller.js	2017-03-27 21:20:30 UTC (rev 214429)
@@ -40,8 +40,6 @@
         if (host) {
             host.controlsDependOnPageScaleFactor = this.layoutTraits & LayoutTraits.iOS;
             this.container.appendChild(host.textTrackContainer);
-            if (host.isInMediaDocument)
-                this.mediaDocumentController = new MediaDocumentController(this);
         }
 
         this._updateControlsIfNeeded();
@@ -62,15 +60,7 @@
 
     get isAudio()
     {
-        if (this.media instanceof HTMLAudioElement)
-            return true;
-
-        if (this.media.readyState < HTMLMediaElement.HAVE_METADATA)
-            return false;
-
-        const isLiveBroadcast = this.media.duration === Number.POSITIVE_INFINITY;
-        const hasVideoTracks = this.media.videoWidth != 0;
-        return !isLiveBroadcast && !hasVideoTracks;
+        return this.media instanceof HTMLAudioElement || (this.media.readyState >= HTMLMediaElement.HAVE_METADATA && this.media.videoWidth === 0);
     }
 
     get layoutTraits()

Deleted: trunk/Source/WebCore/Modules/modern-media-controls/media/media-document-controller.js (214428 => 214429)


--- trunk/Source/WebCore/Modules/modern-media-controls/media/media-document-controller.js	2017-03-27 20:55:45 UTC (rev 214428)
+++ trunk/Source/WebCore/Modules/modern-media-controls/media/media-document-controller.js	2017-03-27 21:20:30 UTC (rev 214429)
@@ -1,75 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All Rights Reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-class MediaDocumentController
-{
-
-    constructor(mediaController)
-    {
-        this.mediaController = mediaController;
-
-        const media = mediaController.media;
-        media.classList.add("media-document");
-
-        if (media.readyState >= HTMLMediaElement.HAVE_METADATA)
-            this._mediaDocumentHasMetadata();
-        else
-            media.addEventListener("loadedmetadata", this);
-    }
-
-    // Protected
-
-    handleEvent(event)
-    {
-        event.currentTarget.removeEventListener(event.type, this);
-
-        if (event.type === "loadedmetadata")
-            this._mediaDocumentHasMetadata();
-        else if (event.type === "resize")
-            this._mediaDocumentHasSize();
-    }
-
-    // Private
-
-    _mediaDocumentHasMetadata()
-    {
-        window.requestAnimationFrame(() => {
-            const media = this.mediaController.media;
-            media.classList.add(this.mediaController.isAudio ? "audio" : "video");
-            media.classList.add(window.navigator.platform === "MacIntel" ? "mac" : window.navigator.platform);
-
-            if (this.mediaController.isAudio)
-                this._mediaDocumentHasSize();
-            else
-                this.mediaController.shadowRoot.addEventListener("resize", this);
-        });
-    }
-
-    _mediaDocumentHasSize()
-    {
-        window.requestAnimationFrame(() => this.mediaController.media.classList.add("ready"));
-    }
-
-}

Modified: trunk/Source/WebCore/Modules/modern-media-controls/media/pip-support.js (214428 => 214429)


--- trunk/Source/WebCore/Modules/modern-media-controls/media/pip-support.js	2017-03-27 20:55:45 UTC (rev 214428)
+++ trunk/Source/WebCore/Modules/modern-media-controls/media/pip-support.js	2017-03-27 21:20:30 UTC (rev 214429)
@@ -56,7 +56,7 @@
     {
         const media = this.mediaController.media;
         if (media.webkitSupportsPresentationMode)
-            this.control.enabled = !this.mediaController.isAudio && media.webkitSupportsPresentationMode(PiPMode) && !media.webkitCurrentPlaybackTargetIsWireless;
+            this.control.enabled = media instanceof HTMLVideoElement && media.webkitSupportsPresentationMode(PiPMode) && !media.webkitCurrentPlaybackTargetIsWireless;
         else
             this.control.enabled = false;
     }

Modified: trunk/Source/WebCore/html/MediaDocument.cpp (214428 => 214429)


--- trunk/Source/WebCore/html/MediaDocument.cpp	2017-03-27 20:55:45 UTC (rev 214428)
+++ trunk/Source/WebCore/html/MediaDocument.cpp	2017-03-27 21:20:30 UTC (rev 214429)
@@ -104,6 +104,13 @@
 #endif
 
     auto body = HTMLBodyElement::create(document);
+    if (RuntimeEnabledFeatures::sharedFeatures().modernMediaControlsEnabled()) {
+        StringBuilder bodyStyle;
+        bodyStyle.appendLiteral("margin: 0; padding: 0;");
+        bodyStyle.appendLiteral("background-color: rgb(38, 38, 38);");
+        bodyStyle.appendLiteral("display: flex; justify-content: center; align-items: center;");
+        body->setAttribute(styleAttr, bodyStyle.toString());
+    }
     rootElement->appendChild(body);
 
     auto videoElement = HTMLVideoElement::create(document);
@@ -110,20 +117,25 @@
     m_mediaElement = videoElement.ptr();
     videoElement->setAttributeWithoutSynchronization(controlsAttr, emptyAtom);
     videoElement->setAttributeWithoutSynchronization(autoplayAttr, emptyAtom);
-    videoElement->setAttributeWithoutSynchronization(playsinlineAttr, emptyAtom);
-    videoElement->setSrc(document.url());
-    if (auto* loader = document.loader())
-        videoElement->setAttributeWithoutSynchronization(typeAttr, loader->responseMIMEType());
+    videoElement->setAttributeWithoutSynchronization(nameAttr, AtomicString("media", AtomicString::ConstructFromLiteral));
 
-    if (!RuntimeEnabledFeatures::sharedFeatures().modernMediaControlsEnabled()) {
-        StringBuilder elementStyle;
-        elementStyle.appendLiteral("max-width: 100%; max-height: 100%;");
+    StringBuilder elementStyle;
+    elementStyle.appendLiteral("max-width: 100%; max-height: 100%;");
 #if PLATFORM(IOS)
-        elementStyle.appendLiteral("width: 100%; height: auto;");
+    elementStyle.appendLiteral("width: 100%; height: auto;");
 #endif
-        videoElement->setAttribute(styleAttr, elementStyle.toString());
+    if (RuntimeEnabledFeatures::sharedFeatures().modernMediaControlsEnabled()) {
+        elementStyle.appendLiteral("min-height: 50px;");
     }
+    videoElement->setAttribute(styleAttr, elementStyle.toString());
 
+    auto sourceElement = HTMLSourceElement::create(document);
+    sourceElement->setSrc(document.url());
+
+    if (auto* loader = document.loader())
+        sourceElement->setType(loader->responseMIMEType());
+
+    videoElement->appendChild(sourceElement);
     body->appendChild(videoElement);
 
     Frame* frame = document.frame();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to