Diff
Modified: trunk/LayoutTests/ChangeLog (207298 => 207299)
--- trunk/LayoutTests/ChangeLog 2016-10-13 19:01:53 UTC (rev 207298)
+++ trunk/LayoutTests/ChangeLog 2016-10-13 19:02:29 UTC (rev 207299)
@@ -1,5 +1,22 @@
2016-10-13 Antoine Quint <grao...@apple.com>
+ [Modern Media Controls] MediaControls base class
+ https://bugs.webkit.org/show_bug.cgi?id=163387
+ <rdar://problem/28753955>
+
+ Reviewed by Dean Jackson.
+
+ Testing the properties of the new MediaControls class.
+
+ * media/modern-media-controls/media-controls/media-controls-constructor-expected.txt: Added.
+ * media/modern-media-controls/media-controls/media-controls-constructor.html: Added.
+ * media/modern-media-controls/media-controls/media-controls-placard-expected.txt: Added.
+ * media/modern-media-controls/media-controls/media-controls-placard.html: Added.
+ * media/modern-media-controls/media-controls/media-controls-start-button-expected.txt: Added.
+ * media/modern-media-controls/media-controls/media-controls-start-button.html: Added.
+
+2016-10-13 Antoine Quint <grao...@apple.com>
+
[Modern Media Controls] TimeControl and TimeLabel
https://bugs.webkit.org/show_bug.cgi?id=163356
<rdar://problem/28741376>
Added: trunk/LayoutTests/media/modern-media-controls/media-controls/media-controls-constructor-expected.txt (0 => 207299)
--- trunk/LayoutTests/media/modern-media-controls/media-controls/media-controls-constructor-expected.txt (rev 0)
+++ trunk/LayoutTests/media/modern-media-controls/media-controls/media-controls-constructor-expected.txt 2016-10-13 19:02:29 UTC (rev 207299)
@@ -0,0 +1,34 @@
+Testing the MediaControls constructor.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS mediaControls.element.localName is "div"
+PASS mediaControls.element.className is "media-controls"
+
+PASS mediaControls.width is 300
+PASS mediaControls.height is 150
+PASS mediaControls.layoutTraits is LayoutTraits.macOS
+PASS mediaControls.showsStartButton is false
+
+PASS mediaControls.startButton instanceof StartButton is true
+PASS mediaControls.playPauseButton instanceof PlayPauseButton is true
+PASS mediaControls.skipBackButton instanceof SkipBackButton is true
+PASS mediaControls.airplayButton instanceof AirplayButton is true
+PASS mediaControls.pipButton instanceof PiPButton is true
+PASS mediaControls.fullscreenButton instanceof FullscreenButton is true
+PASS mediaControls.timeControl instanceof TimeControl is true
+PASS mediaControls.airplayPlacard instanceof AirplayPlacard is true
+PASS mediaControls.pipPlacard instanceof PiPPlacard is true
+
+PASS mediaControls.controlsBar instanceof LayoutItem is true
+PASS mediaControls.controlsBar.element.localName is "div"
+PASS mediaControls.controlsBar.element.className is "controls-bar"
+
+PASS mediaControlsWithArguments.width is 600
+PASS mediaControlsWithArguments.height is 300
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/media/modern-media-controls/media-controls/media-controls-constructor.html (0 => 207299)
--- trunk/LayoutTests/media/modern-media-controls/media-controls/media-controls-constructor.html (rev 0)
+++ trunk/LayoutTests/media/modern-media-controls/media-controls/media-controls-constructor.html 2016-10-13 19:02:29 UTC (rev 207299)
@@ -0,0 +1,65 @@
+<script src=""
+<script src="" type="text/_javascript_"></script>
+<script src="" type="text/_javascript_"></script>
+<script src="" type="text/_javascript_"></script>
+<script src="" type="text/_javascript_"></script>
+<script src="" type="text/_javascript_"></script>
+<script src="" type="text/_javascript_"></script>
+<script src="" type="text/_javascript_"></script>
+<script src="" type="text/_javascript_"></script>
+<script src="" type="text/_javascript_"></script>
+<script src="" type="text/_javascript_"></script>
+<script src="" type="text/_javascript_"></script>
+<script src="" type="text/_javascript_"></script>
+<script src="" type="text/_javascript_"></script>
+<script src="" type="text/_javascript_"></script>
+<script src="" type="text/_javascript_"></script>
+<script src="" type="text/_javascript_"></script>
+<script src="" type="text/_javascript_"></script>
+<script src="" type="text/_javascript_"></script>
+<script src="" type="text/_javascript_"></script>
+<script src="" type="text/_javascript_"></script>
+<body>
+<script type="text/_javascript_">
+
+description("Testing the <code>MediaControls</code> constructor.");
+
+iconService.directoryPath = "../../../../Source/WebCore/Modules/modern-media-controls/images";
+
+const mediaControls = new MediaControls({ layoutTraits: LayoutTraits.macOS });
+
+shouldBeEqualToString("mediaControls.element.localName", "div");
+shouldBeEqualToString("mediaControls.element.className", "media-controls");
+
+debug("");
+shouldBe("mediaControls.width", "300");
+shouldBe("mediaControls.height", "150");
+shouldBe("mediaControls.layoutTraits", "LayoutTraits.macOS");
+shouldBeFalse("mediaControls.showsStartButton");
+
+debug("");
+shouldBeTrue("mediaControls.startButton instanceof StartButton");
+shouldBeTrue("mediaControls.playPauseButton instanceof PlayPauseButton");
+shouldBeTrue("mediaControls.skipBackButton instanceof SkipBackButton");
+shouldBeTrue("mediaControls.airplayButton instanceof AirplayButton");
+shouldBeTrue("mediaControls.pipButton instanceof PiPButton");
+shouldBeTrue("mediaControls.fullscreenButton instanceof FullscreenButton");
+shouldBeTrue("mediaControls.timeControl instanceof TimeControl");
+shouldBeTrue("mediaControls.airplayPlacard instanceof AirplayPlacard");
+shouldBeTrue("mediaControls.pipPlacard instanceof PiPPlacard");
+
+debug("");
+shouldBeTrue("mediaControls.controlsBar instanceof LayoutItem");
+shouldBeEqualToString("mediaControls.controlsBar.element.localName", "div");
+shouldBeEqualToString("mediaControls.controlsBar.element.className", "controls-bar");
+
+debug("");
+const mediaControlsWithArguments = new MediaControls({ width: 600, height: 300, layoutTraits: LayoutTraits.macOS });
+shouldBe("mediaControlsWithArguments.width", "600");
+shouldBe("mediaControlsWithArguments.height", "300");
+
+debug("");
+
+</script>
+<script src=""
+</body>
Added: trunk/LayoutTests/media/modern-media-controls/media-controls/media-controls-placard-expected.txt (0 => 207299)
--- trunk/LayoutTests/media/modern-media-controls/media-controls/media-controls-placard-expected.txt (rev 0)
+++ trunk/LayoutTests/media/modern-media-controls/media-controls/media-controls-placard-expected.txt 2016-10-13 19:02:29 UTC (rev 207299)
@@ -0,0 +1,25 @@
+Testing the MediaControls handling of placards.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+By default, no placard is shown.
+PASS mediaControls.showsPlacard is false
+PASS mediaControls.children is [mediaControls.controlsBar]
+
+Showing the Airplay placard
+PASS mediaControls.showsPlacard is true
+PASS mediaControls.children is [mediaControls.airplayPlacard, mediaControls.controlsBar]
+
+Showing the PiP placard, hides the controls bar
+PASS mediaControls.showsPlacard is true
+PASS mediaControls.children is [mediaControls.pipPlacard]
+
+Hide placard
+PASS mediaControls.showsPlacard is false
+PASS mediaControls.children is [mediaControls.controlsBar]
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/media/modern-media-controls/media-controls/media-controls-placard.html (0 => 207299)
--- trunk/LayoutTests/media/modern-media-controls/media-controls/media-controls-placard.html (rev 0)
+++ trunk/LayoutTests/media/modern-media-controls/media-controls/media-controls-placard.html 2016-10-13 19:02:29 UTC (rev 207299)
@@ -0,0 +1,57 @@
+<script src=""
+<script src="" type="text/_javascript_"></script>
+<script src="" type="text/_javascript_"></script>
+<script src="" type="text/_javascript_"></script>
+<script src="" type="text/_javascript_"></script>
+<script src="" type="text/_javascript_"></script>
+<script src="" type="text/_javascript_"></script>
+<script src="" type="text/_javascript_"></script>
+<script src="" type="text/_javascript_"></script>
+<script src="" type="text/_javascript_"></script>
+<script src="" type="text/_javascript_"></script>
+<script src="" type="text/_javascript_"></script>
+<script src="" type="text/_javascript_"></script>
+<script src="" type="text/_javascript_"></script>
+<script src="" type="text/_javascript_"></script>
+<script src="" type="text/_javascript_"></script>
+<script src="" type="text/_javascript_"></script>
+<script src="" type="text/_javascript_"></script>
+<script src="" type="text/_javascript_"></script>
+<script src="" type="text/_javascript_"></script>
+<script src="" type="text/_javascript_"></script>
+<body>
+<script type="text/_javascript_">
+
+description("Testing the <code>MediaControls</code> handling of placards.");
+
+iconService.directoryPath = "../../../../Source/WebCore/Modules/modern-media-controls/images";
+
+const mediaControls = new MediaControls({ layoutTraits: LayoutTraits.macOS });
+
+debug("By default, no placard is shown.");
+shouldBeFalse("mediaControls.showsPlacard");
+shouldBe("mediaControls.children", "[mediaControls.controlsBar]");
+
+debug("");
+debug("Showing the Airplay placard");
+mediaControls.showPlacard(mediaControls.airplayPlacard);
+shouldBeTrue("mediaControls.showsPlacard");
+shouldBe("mediaControls.children", "[mediaControls.airplayPlacard, mediaControls.controlsBar]");
+
+debug("");
+debug("Showing the PiP placard, hides the controls bar");
+mediaControls.showPlacard(mediaControls.pipPlacard);
+shouldBeTrue("mediaControls.showsPlacard");
+shouldBe("mediaControls.children", "[mediaControls.pipPlacard]");
+
+debug("");
+debug("Hide placard");
+mediaControls.hidePlacard();
+shouldBeFalse("mediaControls.showsPlacard");
+shouldBe("mediaControls.children", "[mediaControls.controlsBar]");
+
+debug("");
+
+</script>
+<script src=""
+</body>
Added: trunk/LayoutTests/media/modern-media-controls/media-controls/media-controls-start-button-expected.txt (0 => 207299)
--- trunk/LayoutTests/media/modern-media-controls/media-controls/media-controls-start-button-expected.txt (rev 0)
+++ trunk/LayoutTests/media/modern-media-controls/media-controls/media-controls-start-button-expected.txt 2016-10-13 19:02:29 UTC (rev 207299)
@@ -0,0 +1,17 @@
+Testing the MediaControls showsStartButton property.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Default where showsStartButton = false
+PASS mediaControls.showsStartButton is false
+PASS mediaControls.children is [mediaControls.controlsBar]
+
+showsStartButton = true
+PASS mediaControls.showsStartButton is true
+PASS mediaControls.children is [mediaControls.startButton]
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/media/modern-media-controls/media-controls/media-controls-start-button.html (0 => 207299)
--- trunk/LayoutTests/media/modern-media-controls/media-controls/media-controls-start-button.html (rev 0)
+++ trunk/LayoutTests/media/modern-media-controls/media-controls/media-controls-start-button.html 2016-10-13 19:02:29 UTC (rev 207299)
@@ -0,0 +1,45 @@
+<script src=""
+<script src="" type="text/_javascript_"></script>
+<script src="" type="text/_javascript_"></script>
+<script src="" type="text/_javascript_"></script>
+<script src="" type="text/_javascript_"></script>
+<script src="" type="text/_javascript_"></script>
+<script src="" type="text/_javascript_"></script>
+<script src="" type="text/_javascript_"></script>
+<script src="" type="text/_javascript_"></script>
+<script src="" type="text/_javascript_"></script>
+<script src="" type="text/_javascript_"></script>
+<script src="" type="text/_javascript_"></script>
+<script src="" type="text/_javascript_"></script>
+<script src="" type="text/_javascript_"></script>
+<script src="" type="text/_javascript_"></script>
+<script src="" type="text/_javascript_"></script>
+<script src="" type="text/_javascript_"></script>
+<script src="" type="text/_javascript_"></script>
+<script src="" type="text/_javascript_"></script>
+<script src="" type="text/_javascript_"></script>
+<script src="" type="text/_javascript_"></script>
+<body>
+<script type="text/_javascript_">
+
+description("Testing the <code>MediaControls</code> showsStartButton property.");
+
+iconService.directoryPath = "../../../../Source/WebCore/Modules/modern-media-controls/images";
+
+const mediaControls = new MediaControls({ layoutTraits: LayoutTraits.macOS });
+
+debug("Default where showsStartButton = false");
+shouldBeFalse("mediaControls.showsStartButton");
+shouldBe("mediaControls.children", "[mediaControls.controlsBar]");
+
+debug("");
+debug("showsStartButton = true");
+mediaControls.showsStartButton = true;
+shouldBeTrue("mediaControls.showsStartButton");
+shouldBe("mediaControls.children", "[mediaControls.startButton]");
+
+debug("");
+
+</script>
+<script src=""
+</body>
Modified: trunk/Source/WebCore/ChangeLog (207298 => 207299)
--- trunk/Source/WebCore/ChangeLog 2016-10-13 19:01:53 UTC (rev 207298)
+++ trunk/Source/WebCore/ChangeLog 2016-10-13 19:02:29 UTC (rev 207299)
@@ -1,3 +1,29 @@
+2016-10-13 Antoine Quint <grao...@apple.com>
+
+ [Modern Media Controls] MediaControls base class
+ https://bugs.webkit.org/show_bug.cgi?id=163387
+ <rdar://problem/28753955>
+
+ Reviewed by Dean Jackson.
+
+ Introducing the new MediaControls class which will serve as a basis for all media controls.
+ We will introduce specific MediaControls subclasses for macOS inline, macOS fullscreen and
+ iOS inline in future patches.
+
+ Tests: media/modern-media-controls/media-controls/media-controls-constructor.html
+ media/modern-media-controls/media-controls/media-controls-placard.html
+ media/modern-media-controls/media-controls/media-controls-start-button.html
+
+ * Modules/modern-media-controls/controls/media-controls.css: Added.
+ (.media-controls,):
+ * Modules/modern-media-controls/controls/media-controls.js: Added.
+ (MediaControls.):
+ (MediaControls.prototype.get showsStartButton):
+ (MediaControls.prototype.set showsStartButton):
+ (MediaControls.prototype.get showsPlacard):
+ (MediaControls.prototype.showPlacard):
+ (MediaControls.prototype.hidePlacard):
+
2016-10-13 Alex Christensen <achristen...@webkit.org>
Disable URLParser for non-Safari iOS and Mac apps for now
Added: trunk/Source/WebCore/Modules/modern-media-controls/controls/media-controls.css (0 => 207299)
--- trunk/Source/WebCore/Modules/modern-media-controls/controls/media-controls.css (rev 0)
+++ trunk/Source/WebCore/Modules/modern-media-controls/controls/media-controls.css 2016-10-13 19:02:29 UTC (rev 207299)
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+.media-controls,
+.media-controls > .controls-bar {
+ position: absolute;
+}
Added: trunk/Source/WebCore/Modules/modern-media-controls/controls/media-controls.js (0 => 207299)
--- trunk/Source/WebCore/Modules/modern-media-controls/controls/media-controls.js (rev 0)
+++ trunk/Source/WebCore/Modules/modern-media-controls/controls/media-controls.js 2016-10-13 19:02:29 UTC (rev 207299)
@@ -0,0 +1,89 @@
+/*
+ * Copyright (C) 2016 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 MediaControls extends LayoutNode
+{
+
+ constructor({ width = 300, height = 150, layoutTraits = LayoutTraits.Unknown } = {})
+ {
+ super(`<div class="media-controls">`);
+
+ this.width = width;
+ this.height = height;
+ this.layoutTraits = layoutTraits;
+
+ this.startButton = new StartButton(this);
+
+ this.playPauseButton = new PlayPauseButton(this);
+ this.skipBackButton = new SkipBackButton(this);
+ this.airplayButton = new AirplayButton(this);
+ this.pipButton = new PiPButton(this);
+ this.fullscreenButton = new FullscreenButton(this);
+
+ this.timeControl = new TimeControl(this);
+
+ this.controlsBar = new LayoutItem({
+ element: `<div class="controls-bar">`,
+ layoutDelegate: this
+ });
+
+ this.airplayPlacard = new AirplayPlacard(this);
+ this.pipPlacard = new PiPPlacard(this);
+
+ this.showsStartButton = false;
+ }
+
+ // Public
+
+ get showsStartButton()
+ {
+ return this.children.includes(this.startButton);
+ }
+
+ set showsStartButton(showsStartButton)
+ {
+ this.children = [showsStartButton ? this.startButton : this.controlsBar];
+ }
+
+ get showsPlacard()
+ {
+ return this.children.includes(this.airplayPlacard) || this.children.includes(this.pipPlacard);
+ }
+
+ showPlacard(placard)
+ {
+ const children = [placard];
+ if (placard === this.airplayPlacard)
+ children.push(this.controlsBar);
+
+ this.children = children;
+ }
+
+ hidePlacard()
+ {
+ this.children = [this.controlsBar];
+ }
+
+}