Title: [273004] trunk
Revision
273004
Author
drou...@apple.com
Date
2021-02-17 09:32:12 -0800 (Wed, 17 Feb 2021)

Log Message

[iOS] Add an overflow button that's shown when controls are dropped so that it's still possible to trigger the dropped button's actions
https://bugs.webkit.org/show_bug.cgi?id=221937
<rdar://problem/20968078>

Reviewed by Eric Carlson.

Source/WebCore:

* Modules/mediacontrols/MediaControlsHost.idl:
* Modules/mediacontrols/MediaControlsHost.cpp:
* Modules/mediacontrols/MediaControlsHost.h:
(WebCore::MediaControlsHost::showMediaControlsContextMenu):
Use a JSON `options` argument instead of a defined `dictionary` so that it's easier to add
new values and is more flexible with the types of values.

* Modules/modern-media-controls/controls/overflow-button.js: Added.
(OverflowButton):
(OverflowButton.prototype.get visible):
(OverflowButton.prototype.set visible):
(OverflowButton.prototype.get contextMenuOptions):
(OverflowButton.prototype.addContextMenuOptions):
(OverflowButton.prototype.clearContextMenuOptions):
(OverflowButton.prototype.set defaultContextMenuOptions):
* Modules/modern-media-controls/media/overflow-support.js: Copied from Source/WebCore/Modules/modern-media-controls/controls/tracks-button.js.
(OverflowSupport.prototype.get mediaEvents):
(OverflowSupport.prototype.get control):
(OverflowSupport.prototype.buttonWasPressed):
(OverflowSupport.prototype.syncControl):
* Modules/modern-media-controls/controls/inline-media-controls.js:
(InlineMediaControls.prototype.layout):
(InlineMediaControls.prototype._rightContainerButtons):
(InlineMediaControls.prototype._droppableButtons):
Create an `OverflowButton` that mainains a JSON object of `contextMenuOptions` which are
passed to `MediaControlsHost::showMediaControlsContextMenu`. Whenever a `Button` is dropped,
add its `get contextMenuOptions` to the `OverflowButton`'s `contextMenuOptions` so that when
the `OverflowButton` is pressed it shows a contextmenu with actions for all dropped buttons.

* Modules/modern-media-controls/controls/button.js:
(Button.prototype.get contextMenuOptions): Added.
* Modules/modern-media-controls/controls/tracks-button.js:
(TracksButton.prototype.get contextMenuOptions): Added.
* Modules/modern-media-controls/media/tracks-support.js:
(TracksSupport.prototype.buttonWasPressed):
Add a `get contextMenuOptions` to the base `Button` class so that all buttons are able to
be merged into `OverflowButton`.

* Modules/modern-media-controls/controls/media-controls.js:
(MediaControls):
* Modules/modern-media-controls/media/media-controller.js:
(MediaController.prototype._supportingObjectClasses):

* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::mediaControlsScript):

* en.lproj/modern-media-controls-localized-strings.js:
* Modules/modern-media-controls/controls/icon-service.js:
* Modules/modern-media-controls/images/iOS/Overflow.svg: Added.
* Modules/modern-media-controls/images/macOS/Overflow.svg: Added.
* Modules/modern-media-controls/js-files:
* WebCore.xcodeproj/project.pbxproj:
Add new files, icons, and text.

LayoutTests:

* media/modern-media-controls/audio/audio-controls-buttons.html:
* media/modern-media-controls/audio/audio-controls-buttons-expected.txt:
* media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-layout.html:
* media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-layout-expected.txt:
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-layout.html:
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-layout-expected.txt:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (273003 => 273004)


--- trunk/LayoutTests/ChangeLog	2021-02-17 17:27:21 UTC (rev 273003)
+++ trunk/LayoutTests/ChangeLog	2021-02-17 17:32:12 UTC (rev 273004)
@@ -1,3 +1,18 @@
+2021-02-17  Devin Rousso  <drou...@apple.com>
+
+        [iOS] Add an overflow button that's shown when controls are dropped so that it's still possible to trigger the dropped button's actions
+        https://bugs.webkit.org/show_bug.cgi?id=221937
+        <rdar://problem/20968078>
+
+        Reviewed by Eric Carlson.
+
+        * media/modern-media-controls/audio/audio-controls-buttons.html:
+        * media/modern-media-controls/audio/audio-controls-buttons-expected.txt:
+        * media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-layout.html:
+        * media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-layout-expected.txt:
+        * media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-layout.html:
+        * media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-layout-expected.txt:
+
 2021-02-17  Antti Koivisto  <an...@apple.com>
 
         Animated keyframe style needs to go through full style adjuster

Modified: trunk/LayoutTests/media/modern-media-controls/audio/audio-controls-buttons-expected.txt (273003 => 273004)


--- trunk/LayoutTests/media/modern-media-controls/audio/audio-controls-buttons-expected.txt	2021-02-17 17:27:21 UTC (rev 273003)
+++ trunk/LayoutTests/media/modern-media-controls/audio/audio-controls-buttons-expected.txt	2021-02-17 17:32:12 UTC (rev 273004)
@@ -5,7 +5,7 @@
 
 Making AirPlay routes available.
 AirPlay routes became available.
-PASS mediaController.controls.rightContainer.children.length is 2
+PASS mediaController.controls.rightContainer.children.length is 3
 PASS mediaController.controls.rightContainer.children[0] is mediaController.controls.muteButton
 PASS mediaController.controls.rightContainer.children[1] is mediaController.controls.airplayButton
 PASS accessibilityController.accessibleElementById('audio-controls').description is "AXDescription: Audio Controls"

Modified: trunk/LayoutTests/media/modern-media-controls/audio/audio-controls-buttons.html (273003 => 273004)


--- trunk/LayoutTests/media/modern-media-controls/audio/audio-controls-buttons.html	2021-02-17 17:27:21 UTC (rev 273003)
+++ trunk/LayoutTests/media/modern-media-controls/audio/audio-controls-buttons.html	2021-02-17 17:32:12 UTC (rev 273004)
@@ -42,7 +42,7 @@
     debug("AirPlay routes became available.");
     media.removeEventListener('webkitplaybacktargetavailabilitychanged', playbackTargetAvailabilityChangedAgain, true);
 
-    shouldBe("mediaController.controls.rightContainer.children.length", "2");
+    shouldBe("mediaController.controls.rightContainer.children.length", "3");
     shouldBe("mediaController.controls.rightContainer.children[0]", "mediaController.controls.muteButton");
     shouldBe("mediaController.controls.rightContainer.children[1]", "mediaController.controls.airplayButton");
     mediaController.controls.bottomControlsBar.element.setAttribute("id", "audio-controls");

Modified: trunk/LayoutTests/media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-layout-expected.txt (273003 => 273004)


--- trunk/LayoutTests/media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-layout-expected.txt	2021-02-17 17:27:21 UTC (rev 273003)
+++ trunk/LayoutTests/media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-layout-expected.txt	2021-02-17 17:32:12 UTC (rev 273004)
@@ -26,7 +26,7 @@
 PASS mediaControls.timeControl.children[0] is mediaControls.timeControl.elapsedTimeLabel
 PASS mediaControls.timeControl.children[1] is mediaControls.timeControl.scrubber
 PASS mediaControls.timeControl.children[2] is mediaControls.timeControl.remainingTimeLabel
-PASS mediaControls.rightContainer.children.length is 2
+PASS mediaControls.rightContainer.children.length is 3
 PASS mediaControls.rightContainer.children[0] is mediaControls.airplayButton
 PASS mediaControls.rightContainer.children[1] is mediaControls.tracksButton
 PASS mediaControls.topRightControlsBar.children.length is 2

Modified: trunk/LayoutTests/media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-layout.html (273003 => 273004)


--- trunk/LayoutTests/media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-layout.html	2021-02-17 17:27:21 UTC (rev 273003)
+++ trunk/LayoutTests/media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-layout.html	2021-02-17 17:32:12 UTC (rev 273004)
@@ -51,7 +51,7 @@
     shouldBe("mediaControls.timeControl.children[1]", "mediaControls.timeControl.scrubber");
     shouldBe("mediaControls.timeControl.children[2]", "mediaControls.timeControl.remainingTimeLabel");
 
-    shouldBe("mediaControls.rightContainer.children.length", "2");
+    shouldBe("mediaControls.rightContainer.children.length", "3");
     shouldBe("mediaControls.rightContainer.children[0]", "mediaControls.airplayButton");
     shouldBe("mediaControls.rightContainer.children[1]", "mediaControls.tracksButton");
 

Modified: trunk/LayoutTests/media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-layout-expected.txt (273003 => 273004)


--- trunk/LayoutTests/media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-layout-expected.txt	2021-02-17 17:27:21 UTC (rev 273003)
+++ trunk/LayoutTests/media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-layout-expected.txt	2021-02-17 17:32:12 UTC (rev 273004)
@@ -25,7 +25,7 @@
 PASS mediaControls.timeControl.children[0] is mediaControls.timeControl.elapsedTimeLabel
 PASS mediaControls.timeControl.children[1] is mediaControls.timeControl.scrubber
 PASS mediaControls.timeControl.children[2] is mediaControls.timeControl.durationTimeLabel
-PASS mediaControls.rightContainer.children.length is 3
+PASS mediaControls.rightContainer.children.length is 4
 PASS mediaControls.rightContainer.children[0] is mediaControls.muteButton
 PASS mediaControls.rightContainer.children[1] is mediaControls.airplayButton
 PASS mediaControls.rightContainer.children[2] is mediaControls.tracksButton

Modified: trunk/LayoutTests/media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-layout.html (273003 => 273004)


--- trunk/LayoutTests/media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-layout.html	2021-02-17 17:27:21 UTC (rev 273003)
+++ trunk/LayoutTests/media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-layout.html	2021-02-17 17:32:12 UTC (rev 273004)
@@ -52,7 +52,7 @@
     shouldBe("mediaControls.timeControl.children[1]", "mediaControls.timeControl.scrubber");
     shouldBe("mediaControls.timeControl.children[2]", "mediaControls.timeControl.durationTimeLabel");
 
-    shouldBe("mediaControls.rightContainer.children.length", "3");
+    shouldBe("mediaControls.rightContainer.children.length", "4");
     shouldBe("mediaControls.rightContainer.children[0]", "mediaControls.muteButton");
     shouldBe("mediaControls.rightContainer.children[1]", "mediaControls.airplayButton");
     shouldBe("mediaControls.rightContainer.children[2]", "mediaControls.tracksButton");

Modified: trunk/Source/WebCore/ChangeLog (273003 => 273004)


--- trunk/Source/WebCore/ChangeLog	2021-02-17 17:27:21 UTC (rev 273003)
+++ trunk/Source/WebCore/ChangeLog	2021-02-17 17:32:12 UTC (rev 273004)
@@ -1,3 +1,65 @@
+2021-02-17  Devin Rousso  <drou...@apple.com>
+
+        [iOS] Add an overflow button that's shown when controls are dropped so that it's still possible to trigger the dropped button's actions
+        https://bugs.webkit.org/show_bug.cgi?id=221937
+        <rdar://problem/20968078>
+
+        Reviewed by Eric Carlson.
+
+        * Modules/mediacontrols/MediaControlsHost.idl:
+        * Modules/mediacontrols/MediaControlsHost.cpp:
+        * Modules/mediacontrols/MediaControlsHost.h:
+        (WebCore::MediaControlsHost::showMediaControlsContextMenu):
+        Use a JSON `options` argument instead of a defined `dictionary` so that it's easier to add
+        new values and is more flexible with the types of values.
+
+        * Modules/modern-media-controls/controls/overflow-button.js: Added.
+        (OverflowButton):
+        (OverflowButton.prototype.get visible):
+        (OverflowButton.prototype.set visible):
+        (OverflowButton.prototype.get contextMenuOptions):
+        (OverflowButton.prototype.addContextMenuOptions):
+        (OverflowButton.prototype.clearContextMenuOptions):
+        (OverflowButton.prototype.set defaultContextMenuOptions):
+        * Modules/modern-media-controls/media/overflow-support.js: Copied from Source/WebCore/Modules/modern-media-controls/controls/tracks-button.js.
+        (OverflowSupport.prototype.get mediaEvents):
+        (OverflowSupport.prototype.get control):
+        (OverflowSupport.prototype.buttonWasPressed):
+        (OverflowSupport.prototype.syncControl):
+        * Modules/modern-media-controls/controls/inline-media-controls.js:
+        (InlineMediaControls.prototype.layout):
+        (InlineMediaControls.prototype._rightContainerButtons):
+        (InlineMediaControls.prototype._droppableButtons):
+        Create an `OverflowButton` that mainains a JSON object of `contextMenuOptions` which are
+        passed to `MediaControlsHost::showMediaControlsContextMenu`. Whenever a `Button` is dropped,
+        add its `get contextMenuOptions` to the `OverflowButton`'s `contextMenuOptions` so that when
+        the `OverflowButton` is pressed it shows a contextmenu with actions for all dropped buttons.
+
+        * Modules/modern-media-controls/controls/button.js:
+        (Button.prototype.get contextMenuOptions): Added.
+        * Modules/modern-media-controls/controls/tracks-button.js:
+        (TracksButton.prototype.get contextMenuOptions): Added.
+        * Modules/modern-media-controls/media/tracks-support.js:
+        (TracksSupport.prototype.buttonWasPressed):
+        Add a `get contextMenuOptions` to the base `Button` class so that all buttons are able to
+        be merged into `OverflowButton`.
+
+        * Modules/modern-media-controls/controls/media-controls.js:
+        (MediaControls):
+        * Modules/modern-media-controls/media/media-controller.js:
+        (MediaController.prototype._supportingObjectClasses):
+
+        * rendering/RenderThemeIOS.mm:
+        (WebCore::RenderThemeIOS::mediaControlsScript):
+
+        * en.lproj/modern-media-controls-localized-strings.js:
+        * Modules/modern-media-controls/controls/icon-service.js:
+        * Modules/modern-media-controls/images/iOS/Overflow.svg: Added.
+        * Modules/modern-media-controls/images/macOS/Overflow.svg: Added.
+        * Modules/modern-media-controls/js-files:
+        * WebCore.xcodeproj/project.pbxproj:
+        Add new files, icons, and text.
+
 2021-02-17  Antti Koivisto  <an...@apple.com>
 
         Animated keyframe style needs to go through full style adjuster

Modified: trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.cpp (273003 => 273004)


--- trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.cpp	2021-02-17 17:27:21 UTC (rev 273003)
+++ trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.cpp	2021-02-17 17:32:12 UTC (rev 273004)
@@ -45,11 +45,16 @@
 #include "TextTrack.h"
 #include "TextTrackList.h"
 #include <_javascript_Core/JSCJSValueInlines.h>
+#include <wtf/JSONValues.h>
 #include <wtf/UUID.h>
 #include <wtf/Variant.h>
 
 namespace WebCore {
 
+#if USE(APPLE_INTERNAL_SDK)
+#include <WebKitAdditions/MediaControlsHostAdditions.cpp>
+#endif
+
 const AtomString& MediaControlsHost::automaticKeyword()
 {
     static MainThreadNeverDestroyed<const AtomString> automatic("automatic", AtomString::ConstructFromLiteral);
@@ -313,7 +318,15 @@
 
 #if ENABLE(MEDIA_CONTROLS_CONTEXT_MENUS)
 
-void MediaControlsHost::showMediaControlsContextMenu(HTMLElement& target, ContextMenuOptions&& options)
+#if !defined(MediaControlsHostAdditions_showMediaControlsContextMenu_MenuData)
+#define MediaControlsHostAdditions_showMediaControlsContextMenu_MenuData
+#endif
+
+#if !defined(MediaControlsHostAdditions_showMediaControlsContextMenu_MenuData_switchOn)
+#define MediaControlsHostAdditions_showMediaControlsContextMenu_MenuData_switchOn
+#endif
+
+void MediaControlsHost::showMediaControlsContextMenu(HTMLElement& target, String&& optionsJSONString)
 {
     if (!m_mediaElement)
         return;
@@ -324,12 +337,25 @@
     if (!page)
         return;
 
-    using MenuTrackItem = Variant<RefPtr<AudioTrack>, RefPtr<TextTrack>>;
-    HashMap<MediaControlsContextMenuItem::ID, MenuTrackItem> idMap;
+    auto optionsJSON = JSON::Value::parseJSON(optionsJSONString);
+    if (!optionsJSON)
+        return;
 
+    auto optionsJSONObject = optionsJSON->asObject();
+    if (!optionsJSONObject)
+        return;
+
+    using MenuData = Variant<RefPtr<AudioTrack>, RefPtr<TextTrack> MediaControlsHostAdditions_showMediaControlsContextMenu_MenuData>;
+    HashMap<MediaControlsContextMenuItem::ID, MenuData> idMap;
+    auto generateID = [&] (MenuData data) {
+        auto id = idMap.size() + 1;
+        idMap.add(id, data);
+        return id;
+    };
+
     Vector<MediaControlsContextMenuItem> items;
 
-    if (options.includeAudioTracks) {
+    if (optionsJSONObject->getBoolean("includeAudioTracks"_s).valueOr(false)) {
         if (auto* audioTracks = mediaElement.audioTracks(); audioTracks && audioTracks->length() > 1) {
             MediaControlsContextMenuItem audioTracksItem;
             audioTracksItem.title = WEB_UI_STRING_KEY("Languages", "Languages (Media Controls Menu)", "Languages media controls context menu title");
@@ -340,12 +366,9 @@
 
             for (auto& audioTrack : captionPreferences.sortedTrackListForMenu(audioTracks)) {
                 MediaControlsContextMenuItem audioTrackItem;
-                audioTrackItem.id = idMap.size() + 1;
+                audioTrackItem.id = generateID(audioTrack);
                 audioTrackItem.title = captionPreferences.displayNameForTrack(audioTrack.get());
                 audioTrackItem.isChecked = audioTrack->enabled();
-
-                idMap.add(audioTrackItem.id, audioTrack);
-
                 audioTracksItem.children.append(WTFMove(audioTrackItem));
             }
 
@@ -354,7 +377,7 @@
         }
     }
 
-    if (options.includeTextTracks) {
+    if (optionsJSONObject->getBoolean("includeTextTracks"_s).valueOr(false)) {
         if (auto* textTracks = mediaElement.textTracks(); textTracks && textTracks->length()) {
             MediaControlsContextMenuItem textTracksItem;
             textTracksItem.title = WEB_UI_STRING_KEY("Subtitles", "Subtitles (Media Controls Menu)", "Subtitles media controls context menu title");
@@ -370,7 +393,7 @@
 
             for (auto& textTrack : sortedTextTracks) {
                 MediaControlsContextMenuItem textTrackItem;
-                textTrackItem.id = idMap.size() + 1;
+                textTrackItem.id = generateID(textTrack);
                 textTrackItem.title = captionPreferences.displayNameForTrack(textTrack.get());
                 if (allTracksDisabled && textTrack == &TextTrack::captionMenuOffItem() && (captionPreferences.captionDisplayMode() == CaptionUserPreferences::ForcedOnly || captionPreferences.captionDisplayMode() == CaptionUserPreferences::Manual))
                     textTrackItem.isChecked = true;
@@ -380,9 +403,6 @@
                     textTrackItem.isChecked = true;
                 else
                     textTrackItem.isChecked = false;
-
-                idMap.add(textTrackItem.id, textTrack);
-
                 textTracksItem.children.append(WTFMove(textTrackItem));
             }
 
@@ -391,6 +411,10 @@
         }
     }
 
+#if defined(MediaControlsHostAdditions_showMediaControlsContextMenu_options)
+    MediaControlsHostAdditions_showMediaControlsContextMenu_options
+#endif
+
     if (items.isEmpty())
         return;
 
@@ -397,7 +421,6 @@
     ASSERT(!idMap.isEmpty());
 
     page->chrome().client().showMediaControlsContextMenu(target.boundsInRootViewSpace(), WTFMove(items), [weakMediaElement = makeWeakPtr(mediaElement), idMap = WTFMove(idMap)] (MediaControlsContextMenuItem::ID selectedItemID) {
-
         if (selectedItemID == MediaControlsContextMenuItem::invalidID)
             return;
 
@@ -421,6 +444,7 @@
                 }
                 mediaElement.setSelectedTextTrack(selectedTextTrack.get());
             }
+            MediaControlsHostAdditions_showMediaControlsContextMenu_MenuData_switchOn
         );
     });
 }

Modified: trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.h (273003 => 273004)


--- trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.h	2021-02-17 17:27:21 UTC (rev 273003)
+++ trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.h	2021-02-17 17:32:12 UTC (rev 273004)
@@ -25,6 +25,7 @@
 
 #pragma once
 
+#include <wtf/Ref.h>
 #include <wtf/RefCounted.h>
 #include <wtf/RefPtr.h>
 #include <wtf/Variant.h>
@@ -92,11 +93,7 @@
     static String formattedStringForDuration(double);
 
 #if ENABLE(MEDIA_CONTROLS_CONTEXT_MENUS)
-    struct ContextMenuOptions {
-        bool includeAudioTracks { false };
-        bool includeTextTracks { false };
-    };
-    void showMediaControlsContextMenu(HTMLElement&, ContextMenuOptions&&);
+    void showMediaControlsContextMenu(HTMLElement&, String&& optionsJSONString);
 #endif // ENABLE(MEDIA_CONTROLS_CONTEXT_MENUS)
 
 private:

Modified: trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.idl (273003 => 273004)


--- trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.idl	2021-02-17 17:27:21 UTC (rev 273003)
+++ trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.idl	2021-02-17 17:32:12 UTC (rev 273004)
@@ -65,12 +65,5 @@
     [EnabledAtRuntime=ModernMediaControls] DOMString base64StringForIconNameAndType(DOMString iconName, DOMString iconType);
     [EnabledAtRuntime=ModernMediaControls] DOMString formattedStringForDuration(unrestricted double durationInSeconds);
 
-    [Conditional=MEDIA_CONTROLS_CONTEXT_MENUS, EnabledBySetting=MediaControlsContextMenus, EnabledAtRuntime=ModernMediaControls] undefined showMediaControlsContextMenu(HTMLElement target, ContextMenuOptions options);
+    [Conditional=MEDIA_CONTROLS_CONTEXT_MENUS, EnabledBySetting=MediaControlsContextMenus, EnabledAtRuntime=ModernMediaControls] undefined showMediaControlsContextMenu(HTMLElement target, JSON options);
 };
-
-[
-    Conditional=MEDIA_CONTROLS_CONTEXT_MENUS,
-] dictionary ContextMenuOptions {
-    boolean includeAudioTracks;
-    boolean includeTextTracks;
-};

Modified: trunk/Source/WebCore/Modules/modern-media-controls/controls/button.js (273003 => 273004)


--- trunk/Source/WebCore/Modules/modern-media-controls/controls/button.js	2021-02-17 17:27:21 UTC (rev 273003)
+++ trunk/Source/WebCore/Modules/modern-media-controls/controls/button.js	2021-02-17 17:32:12 UTC (rev 273004)
@@ -129,6 +129,12 @@
         this._updateImageMetrics();
     }
 
+    get contextMenuOptions()
+    {
+        // Implemented by subclasses.
+        return {};
+    }
+
     // Protected
 
     handleEvent(event)

Modified: trunk/Source/WebCore/Modules/modern-media-controls/controls/icon-service.js (273003 => 273004)


--- trunk/Source/WebCore/Modules/modern-media-controls/controls/icon-service.js	2021-02-17 17:27:21 UTC (rev 273003)
+++ trunk/Source/WebCore/Modules/modern-media-controls/controls/icon-service.js	2021-02-17 17:32:12 UTC (rev 273004)
@@ -32,6 +32,7 @@
     Forward         : { name: "Forward", type: "svg", label: UIString("Forward") },
     InvalidCompact  : { name: "InvalidCompact", type: "pdf", label: UIString("Invalid") },
     InvalidPlacard  : { name: "invalid-placard", type: "png", label: UIString("Invalid") },
+    Overflow        : { name: "Overflow", type: "svg", label: UIString("More...") },
     Pause           : { name: "Pause", type: "svg", label: UIString("Pause") },
     PiPPlacard      : { name: "pip-placard", type: "png", label: UIString("Picture in Picture") },
     Play            : { name: "Play", type: "svg", label: UIString("Play") },

Modified: trunk/Source/WebCore/Modules/modern-media-controls/controls/inline-media-controls.js (273003 => 273004)


--- trunk/Source/WebCore/Modules/modern-media-controls/controls/inline-media-controls.js	2021-02-17 17:27:21 UTC (rev 273003)
+++ trunk/Source/WebCore/Modules/modern-media-controls/controls/inline-media-controls.js	2021-02-17 17:32:12 UTC (rev 273004)
@@ -166,6 +166,7 @@
         this.rightContainer.children = this._rightContainerButtons();
         this.rightContainer.children.concat(this.leftContainer.children).forEach(button => delete button.dropped);
         this.muteButton.style = this.preferredMuteButtonStyle;
+        this.overflowButton.clearContextMenuOptions();
 
         for (let button of this._droppableButtons()) {
             // If the button is not enabled, we can skip it.
@@ -182,6 +183,9 @@
 
             // This button must now be dropped.
             button.dropped = true;
+
+            if (button !== this.overflowButton)
+                this.overflowButton.addContextMenuOptions(button.contextMenuOptions);
         }
 
         // Update layouts once more.
@@ -255,15 +259,15 @@
     _rightContainerButtons()
     {
         if (this._shouldUseAudioLayout)
-            return [this.muteButton, this.airplayButton];
+            return [this.muteButton, this.airplayButton, this.overflowButton];
 
         if (this._shouldUseSingleBarLayout)
-            return [this.muteButton, this.airplayButton, this.pipButton, this.tracksButton, this.fullscreenButton];
+            return [this.muteButton, this.airplayButton, this.pipButton, this.tracksButton, this.overflowButton, this.fullscreenButton];
 
         const buttons = [];
         if (this.preferredMuteButtonStyle === Button.Styles.Bar)
             buttons.push(this.muteButton);
-        buttons.push(this.airplayButton, this.tracksButton);
+        buttons.push(this.airplayButton, this.tracksButton, this.overflowButton);
         return buttons;
     }
 
@@ -270,9 +274,9 @@
     _droppableButtons()
     {
         if (this._shouldUseSingleBarLayout)
-            return [this.skipForwardButton, this.skipBackButton, this.airplayButton, this.tracksButton, this.pipButton, this.fullscreenButton, this.muteButton];
+            return [this.skipForwardButton, this.skipBackButton, this.airplayButton, this.tracksButton, this.overflowButton, this.pipButton, this.fullscreenButton, this.muteButton];
 
-        const buttons = [this.skipForwardButton, this.skipBackButton, this.airplayButton, this.tracksButton];
+        const buttons = [this.skipForwardButton, this.skipBackButton, this.airplayButton, this.tracksButton, this.overflowButton];
         if (this.preferredMuteButtonStyle === Button.Styles.Bar)
             buttons.push(this.muteButton);
         return buttons;

Modified: trunk/Source/WebCore/Modules/modern-media-controls/controls/media-controls.js (273003 => 273004)


--- trunk/Source/WebCore/Modules/modern-media-controls/controls/media-controls.js	2021-02-17 17:27:21 UTC (rev 273003)
+++ trunk/Source/WebCore/Modules/modern-media-controls/controls/media-controls.js	2021-02-17 17:32:12 UTC (rev 273004)
@@ -43,6 +43,7 @@
         this.fullscreenButton = new FullscreenButton(this);
         this.muteButton = new MuteButton(this);
         this.tracksButton = new TracksButton(this);
+        this.overflowButton = new OverflowButton(this);
 
         this.statusLabel = new StatusLabel(this);
         this.timeControl = new TimeControl(this);

Added: trunk/Source/WebCore/Modules/modern-media-controls/controls/overflow-button.js (0 => 273004)


--- trunk/Source/WebCore/Modules/modern-media-controls/controls/overflow-button.js	                        (rev 0)
+++ trunk/Source/WebCore/Modules/modern-media-controls/controls/overflow-button.js	2021-02-17 17:32:12 UTC (rev 273004)
@@ -0,0 +1,94 @@
+/*
+ * Copyright (C) 2021 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 OverflowButton extends Button
+{
+
+    constructor(layoutDelegate)
+    {
+        super({
+            cssClassName: "overflow",
+            iconName: Icons.Overflow,
+            layoutDelegate,
+        });
+
+        this.clearContextMenuOptions();
+        this._defaultContextMenuOptions = {};
+    }
+
+    // Public
+
+    get visible()
+    {
+        return super.visible;
+    }
+
+    set visible(flag)
+    {
+        let hasContextMenuOptions = false;
+        for (let key in this._contextMenuOptions) {
+            hasContextMenuOptions = true;
+            break;
+        }
+
+        super.visible = flag && hasContextMenuOptions;
+    }
+
+    get contextMenuOptions()
+    {
+        return this._contextMenuOptions;
+    }
+
+    addContextMenuOptions(contextMenuOptions)
+    {
+        if (!this.enabled)
+            return;
+
+        for (let key in contextMenuOptions)
+            this._contextMenuOptions[key] = contextMenuOptions[key];
+
+        this.visible = true;
+    }
+
+    clearContextMenuOptions()
+    {
+        this._contextMenuOptions = {};
+
+        this.visible = false;
+
+        this.addContextMenuOptions(this._defaultContextMenuOptions);
+    }
+
+    set defaultContextMenuOptions(defaultContextMenuOptions)
+    {
+        this._defaultContextMenuOptions = defaultContextMenuOptions || {};
+
+        this.clearContextMenuOptions();
+
+        if (this.layoutDelegate)
+            this.layoutDelegate.needsLayout = true;
+    }
+
+}

Modified: trunk/Source/WebCore/Modules/modern-media-controls/controls/tracks-button.js (273003 => 273004)


--- trunk/Source/WebCore/Modules/modern-media-controls/controls/tracks-button.js	2021-02-17 17:27:21 UTC (rev 273003)
+++ trunk/Source/WebCore/Modules/modern-media-controls/controls/tracks-button.js	2021-02-17 17:32:12 UTC (rev 273004)
@@ -35,4 +35,14 @@
         });
     }
 
+    // Public
+
+    get contextMenuOptions()
+    {
+        return {
+            includeAudioTracks: true,
+            includeTextTracks: true,
+        };
+    }
+
 }

Added: trunk/Source/WebCore/Modules/modern-media-controls/images/iOS/Overflow.svg (0 => 273004)


--- trunk/Source/WebCore/Modules/modern-media-controls/images/iOS/Overflow.svg	                        (rev 0)
+++ trunk/Source/WebCore/Modules/modern-media-controls/images/iOS/Overflow.svg	2021-02-17 17:32:12 UTC (rev 273004)
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg width="16px" height="13px" viewBox="0 0 16 13" version="1.1" xmlns="http://www.w3.org/2000/svg">
+    <path d="M3.4654228,6.50010323 C3.4654228,5.56764731 2.70936258,4.82 1.76011527,4.82 C0.836055054,4.82 0.08,5.56764731 0.08,6.50010323 C0.08,7.43255914 0.836055054,8.18020645 1.76011527,8.18020645 C2.70936258,8.18020645 3.4654228,7.43255914 3.4654228,6.50010323 Z M9.68181849,6.50010323 C9.68181849,5.56764731 8.93417118,4.82 8.00171527,4.82 C7.07765505,4.82 6.33000774,5.56764731 6.33000774,6.50010323 C6.33000774,7.43255914 7.07765505,8.18020645 8.00171527,8.18020645 C8.93417118,8.18020645 9.68181849,7.43255914 9.68181849,6.50010323 Z M15.9234013,6.50010323 C15.9234013,5.56764731 15.1757712,4.82 14.2433153,4.82 C13.2940508,4.82 12.5464034,5.56764731 12.5464034,6.50010323 C12.5464034,7.43255914 13.2940508,8.18020645 14.2433153,8.18020645 C15.1757712,8.18020645 15.9234013,7.43255914 15.9234013,6.50010323 Z"/>
+</svg>

Added: trunk/Source/WebCore/Modules/modern-media-controls/images/macOS/Overflow.svg (0 => 273004)


--- trunk/Source/WebCore/Modules/modern-media-controls/images/macOS/Overflow.svg	                        (rev 0)
+++ trunk/Source/WebCore/Modules/modern-media-controls/images/macOS/Overflow.svg	2021-02-17 17:32:12 UTC (rev 273004)
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg width="16px" height="13px" viewBox="0 0 16 13" version="1.1" xmlns="http://www.w3.org/2000/svg">
+    <path d="M3.4654228,6.50010323 C3.4654228,5.56764731 2.70936258,4.82 1.76011527,4.82 C0.836055054,4.82 0.08,5.56764731 0.08,6.50010323 C0.08,7.43255914 0.836055054,8.18020645 1.76011527,8.18020645 C2.70936258,8.18020645 3.4654228,7.43255914 3.4654228,6.50010323 Z M9.68181849,6.50010323 C9.68181849,5.56764731 8.93417118,4.82 8.00171527,4.82 C7.07765505,4.82 6.33000774,5.56764731 6.33000774,6.50010323 C6.33000774,7.43255914 7.07765505,8.18020645 8.00171527,8.18020645 C8.93417118,8.18020645 9.68181849,7.43255914 9.68181849,6.50010323 Z M15.9234013,6.50010323 C15.9234013,5.56764731 15.1757712,4.82 14.2433153,4.82 C13.2940508,4.82 12.5464034,5.56764731 12.5464034,6.50010323 C12.5464034,7.43255914 13.2940508,8.18020645 14.2433153,8.18020645 C15.1757712,8.18020645 15.9234013,7.43255914 15.9234013,6.50010323 Z"/>
+</svg>

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


--- trunk/Source/WebCore/Modules/modern-media-controls/js-files	2021-02-17 17:27:21 UTC (rev 273003)
+++ trunk/Source/WebCore/Modules/modern-media-controls/js-files	2021-02-17 17:32:12 UTC (rev 273004)
@@ -22,6 +22,7 @@
 controls/seek-button.js
 controls/rewind-button.js
 controls/forward-button.js
+controls/overflow-button.js
 controls/buttons-container.js
 controls/status-label.js
 controls/controls-bar.js
@@ -45,6 +46,7 @@
 media/controls-visibility-support.js
 media/fullscreen-support.js
 media/mute-support.js
+media/overflow-support.js
 media/pip-support.js
 media/placard-support.js
 media/playback-support.js

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


--- trunk/Source/WebCore/Modules/modern-media-controls/media/media-controller.js	2021-02-17 17:27:21 UTC (rev 273003)
+++ trunk/Source/WebCore/Modules/modern-media-controls/media/media-controller.js	2021-02-17 17:32:12 UTC (rev 273004)
@@ -186,7 +186,7 @@
         if (this.layoutTraits & LayoutTraits.Compact)
             return [CompactMediaControlsSupport];
 
-        return [AirplaySupport, AudioSupport, ControlsVisibilitySupport, FullscreenSupport, MuteSupport, PiPSupport, PlacardSupport, PlaybackSupport, ScrubbingSupport, SeekBackwardSupport, SeekForwardSupport, SkipBackSupport, SkipForwardSupport, StartSupport, StatusSupport, TimeControlSupport, TracksSupport, VolumeSupport];
+        return [AirplaySupport, AudioSupport, ControlsVisibilitySupport, FullscreenSupport, MuteSupport, OverflowSupport, PiPSupport, PlacardSupport, PlaybackSupport, ScrubbingSupport, SeekBackwardSupport, SeekForwardSupport, SkipBackSupport, SkipForwardSupport, StartSupport, StatusSupport, TimeControlSupport, TracksSupport, VolumeSupport];
     }
 
     _updateControlsIfNeeded()

Copied: trunk/Source/WebCore/Modules/modern-media-controls/media/overflow-support.js (from rev 273003, trunk/Source/WebCore/Modules/modern-media-controls/controls/tracks-button.js) (0 => 273004)


--- trunk/Source/WebCore/Modules/modern-media-controls/media/overflow-support.js	                        (rev 0)
+++ trunk/Source/WebCore/Modules/modern-media-controls/media/overflow-support.js	2021-02-17 17:32:12 UTC (rev 273004)
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2021 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 OverflowSupport extends MediaControllerSupport
+{
+
+    // Protected
+
+    get mediaEvents()
+    {
+        let mediaEvents = [];
+        window["WebKitAdditions.OverflowSupport.prototype.get_mediaEvents"]?.(this, mediaEvents);
+        return mediaEvents;
+    }
+
+    get control()
+    {
+        return this.mediaController.controls.overflowButton;
+    }
+
+    buttonWasPressed(control)
+    {
+        if (this.mediaController.host?.showMediaControlsContextMenu)
+            this.mediaController.host.showMediaControlsContextMenu(control.element, control.contextMenuOptions);
+    }
+
+    syncControl()
+    {
+        this.control.enabled = !!this.mediaController.host?.showMediaControlsContextMenu;
+
+        let defaultContextMenuOptions = {};
+        window["WebKitAdditions.OverflowSupport.prototype.syncControl"]?.(this, defaultContextMenuOptions);
+        this.control.defaultContextMenuOptions = defaultContextMenuOptions;
+    }
+
+}

Modified: trunk/Source/WebCore/Modules/modern-media-controls/media/tracks-support.js (273003 => 273004)


--- trunk/Source/WebCore/Modules/modern-media-controls/media/tracks-support.js	2021-02-17 17:27:21 UTC (rev 273003)
+++ trunk/Source/WebCore/Modules/modern-media-controls/media/tracks-support.js	2021-02-17 17:32:12 UTC (rev 273004)
@@ -57,7 +57,7 @@
     buttonWasPressed(control)
     {
         if (this.mediaController.host?.showMediaControlsContextMenu)
-            this.mediaController.host.showMediaControlsContextMenu(control.element, {includeAudioTracks: true, includeTextTracks: true});
+            this.mediaController.host.showMediaControlsContextMenu(control.element, control.contextMenuOptions);
         else
             this.mediaController.controls.showTracksPanel();
     }

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (273003 => 273004)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2021-02-17 17:27:21 UTC (rev 273003)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2021-02-17 17:32:12 UTC (rev 273004)
@@ -10040,10 +10040,6 @@
 		715AD71D2050512400D592DC /* DeclarativeAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DeclarativeAnimation.h; sourceTree = "<group>"; };
 		715AD71F2050512400D592DC /* DeclarativeAnimation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DeclarativeAnimation.cpp; sourceTree = "<group>"; };
 		715DA5D3201BB902002EF2B0 /* JSWebAnimationCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebAnimationCustom.cpp; sourceTree = "<group>"; };
-		716C8DF11E48B269005BD0DA /* volume-down-support.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode._javascript_; path = "volume-down-support.js"; sourceTree = "<group>"; };
-		716C8DF21E48B269005BD0DA /* volume-up-support.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode._javascript_; path = "volume-up-support.js"; sourceTree = "<group>"; };
-		716C8DF31E48B284005BD0DA /* volume-down-button.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode._javascript_; path = "volume-down-button.js"; sourceTree = "<group>"; };
-		716C8DF41E48B284005BD0DA /* volume-up-button.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode._javascript_; path = "volume-up-button.js"; sourceTree = "<group>"; };
 		716FA0D81DB26591007323CC /* airplay-button.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = "airplay-button.css"; sourceTree = "<group>"; };
 		716FA0D91DB26591007323CC /* airplay-button.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode._javascript_; path = "airplay-button.js"; sourceTree = "<group>"; };
 		716FA0DA1DB26591007323CC /* airplay-placard.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode._javascript_; path = "airplay-placard.js"; sourceTree = "<group>"; };
@@ -11770,6 +11766,8 @@
 		94E839501DFB29A4007BC6A7 /* CSSNamespaceRule.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CSSNamespaceRule.idl; sourceTree = "<group>"; };
 		94E839531DFB2BA6007BC6A7 /* JSCSSNamespaceRule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCSSNamespaceRule.cpp; sourceTree = "<group>"; };
 		94E839541DFB2BA6007BC6A7 /* JSCSSNamespaceRule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCSSNamespaceRule.h; sourceTree = "<group>"; };
+		950C484925D6774200AB3D9C /* overflow-support.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode._javascript_; path = "overflow-support.js"; sourceTree = "<group>"; };
+		950C484B25D6774E00AB3D9C /* overflow-button.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode._javascript_; path = "overflow-button.js"; sourceTree = "<group>"; };
 		950C4C02BED8936F818E2F99 /* JSSVGGraphicsElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSSVGGraphicsElement.h; sourceTree = "<group>"; };
 		952076001F2675F9007D2AAB /* CallTracer.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CallTracer.cpp; sourceTree = "<group>"; };
 		952076011F2675F9007D2AAB /* CallTracer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CallTracer.h; sourceTree = "<group>"; };
@@ -22572,6 +22570,7 @@
 				716FA0EA1DB26591007323CC /* media-controls.css */,
 				716FA0EB1DB26591007323CC /* media-controls.js */,
 				716FA0EC1DB26591007323CC /* mute-button.js */,
+				950C484B25D6774E00AB3D9C /* overflow-button.js */,
 				716FA0ED1DB26591007323CC /* pip-button.js */,
 				716FA0EE1DB26591007323CC /* pip-placard.js */,
 				716FA0EF1DB26591007323CC /* placard.css */,
@@ -22592,8 +22591,6 @@
 				716FA0FE1DB26591007323CC /* tracks-button.js */,
 				7146DF8B1DEFC2ED0046F98B /* tracks-panel.css */,
 				7146DF8C1DEFC2ED0046F98B /* tracks-panel.js */,
-				716C8DF31E48B284005BD0DA /* volume-down-button.js */,
-				716C8DF41E48B284005BD0DA /* volume-up-button.js */,
 			);
 			name = controls;
 			path = "Modules/modern-media-controls/controls";
@@ -22608,6 +22605,7 @@
 				7177E2461DB80D2F00919A0B /* media-controller-support.js */,
 				71D02D921DB55C4E00DD5CF5 /* media-controller.js */,
 				7177E2471DB80D2F00919A0B /* mute-support.js */,
+				950C484925D6774200AB3D9C /* overflow-support.js */,
 				7130141D1DC9C08600CA3A88 /* pip-support.js */,
 				711FB0751DC7688F00C4C708 /* placard-support.js */,
 				71004B9D1DC1398800A52A38 /* playback-support.js */,
@@ -22619,9 +22617,7 @@
 				7177E2481DB80D2F00919A0B /* start-support.js */,
 				71B0460A1DD3C2EE00EE19CF /* status-support.js */,
 				71F936F71DD4F99B00922CC7 /* tracks-support.js */,
-				716C8DF11E48B269005BD0DA /* volume-down-support.js */,
 				717F90571DC40ED60006F520 /* volume-support.js */,
-				716C8DF21E48B269005BD0DA /* volume-up-support.js */,
 			);
 			path = media;
 			sourceTree = "<group>";

Modified: trunk/Source/WebCore/en.lproj/modern-media-controls-localized-strings.js (273003 => 273004)


--- trunk/Source/WebCore/en.lproj/modern-media-controls-localized-strings.js	2021-02-17 17:27:21 UTC (rev 273003)
+++ trunk/Source/WebCore/en.lproj/modern-media-controls-localized-strings.js	2021-02-17 17:32:12 UTC (rev 273004)
@@ -13,6 +13,7 @@
     "Invalid": "Invalid",
     "Live Broadcast": "Live Broadcast",
     "Media Selection": "Media Selection",
+    "More...": "More...",
     "Mute": "Mute",
     "Pause": "Pause",
     "Picture in Picture": "Picture in Picture",

Modified: trunk/Source/WebCore/rendering/RenderThemeIOS.mm (273003 => 273004)


--- trunk/Source/WebCore/rendering/RenderThemeIOS.mm	2021-02-17 17:27:21 UTC (rev 273003)
+++ trunk/Source/WebCore/rendering/RenderThemeIOS.mm	2021-02-17 17:32:12 UTC (rev 273004)
@@ -100,6 +100,10 @@
 
 namespace WebCore {
 
+#if USE(APPLE_INTERNAL_SDK)
+#include <WebKitAdditions/RenderThemeIOSAdditions.cpp>
+#endif
+
 using namespace HTMLNames;
 
 const float ControlBaseHeight = 20;
@@ -1291,9 +1295,12 @@
             NSBundle *bundle = [NSBundle bundleForClass:[WebCoreRenderThemeBundle class]];
 
             StringBuilder scriptBuilder;
-            scriptBuilder.append("window.isIOSFamily = true;");
+            scriptBuilder.append("window.isIOSFamily = true;\n");
             scriptBuilder.append([NSString stringWithContentsOfFile:[bundle pathForResource:@"modern-media-controls-localized-strings" ofType:@"js"] encoding:NSUTF8StringEncoding error:nil]);
             scriptBuilder.append([NSString stringWithContentsOfFile:[bundle pathForResource:@"modern-media-controls" ofType:@"js" inDirectory:@"modern-media-controls"] encoding:NSUTF8StringEncoding error:nil]);
+#if defined(RenderThemeIOSAdditions_mediaControlsScript)
+            RenderThemeIOSAdditions_mediaControlsScript
+#endif
             m_mediaControlsScript = scriptBuilder.toString();
         }
         return m_mediaControlsScript;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to