Title: [265721] branches/safari-610.1-branch
Revision
265721
Author
[email protected]
Date
2020-08-14 17:17:02 -0700 (Fri, 14 Aug 2020)

Log Message

Cherry-pick r265709. rdar://problem/67106107

    RTL: volume slider and icons are backwards
    https://bugs.webkit.org/show_bug.cgi?id=215482
    <rdar://problem/65730749>

    Reviewed by Eric Carlson.

    Source/WebCore:

    * Modules/modern-media-controls/controls/inline-media-controls.js:
    (InlineMediaControls.prototype.layout):
    Flip the inline volume button when not in LTR.

    * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
    (MacOSFullscreenMediaControls.prototype.layout):
    (MacOSFullscreenMediaControls.prototype._volumeControlsForCurrentDirection): Added.
    Reverse the order of the fullscreen volume controls when not in LTR.

    * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.css:
    (.media-controls.mac.fullscreen:not(.uses-ltr-user-interface-layout-direction) :is(.volume-down, .volume.slider, .volume-up)): Added.
    (.media-controls.mac.fullscreen:not(.uses-ltr-user-interface-layout-direction) .volume.slider): Deleted.
    Also flip the fullscreen volume up and volume down buttons.

    LayoutTests:

    `MacOSFullscreenMediaControls` defaults to having `usesLTRUserInterfaceLayoutDirection` be
    `false`, so flip the order of the volume controls to match the non-LTR UI.

    * media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-constructor.html:
    * media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-constructor-expected.txt:
    * media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-volume-styles.html:

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

Modified Paths

Diff

Modified: branches/safari-610.1-branch/LayoutTests/ChangeLog (265720 => 265721)


--- branches/safari-610.1-branch/LayoutTests/ChangeLog	2020-08-15 00:16:57 UTC (rev 265720)
+++ branches/safari-610.1-branch/LayoutTests/ChangeLog	2020-08-15 00:17:02 UTC (rev 265721)
@@ -1,5 +1,58 @@
 2020-08-14  Alan Coon  <[email protected]>
 
+        Cherry-pick r265709. rdar://problem/67106107
+
+    RTL: volume slider and icons are backwards
+    https://bugs.webkit.org/show_bug.cgi?id=215482
+    <rdar://problem/65730749>
+    
+    Reviewed by Eric Carlson.
+    
+    Source/WebCore:
+    
+    * Modules/modern-media-controls/controls/inline-media-controls.js:
+    (InlineMediaControls.prototype.layout):
+    Flip the inline volume button when not in LTR.
+    
+    * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
+    (MacOSFullscreenMediaControls.prototype.layout):
+    (MacOSFullscreenMediaControls.prototype._volumeControlsForCurrentDirection): Added.
+    Reverse the order of the fullscreen volume controls when not in LTR.
+    
+    * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.css:
+    (.media-controls.mac.fullscreen:not(.uses-ltr-user-interface-layout-direction) :is(.volume-down, .volume.slider, .volume-up)): Added.
+    (.media-controls.mac.fullscreen:not(.uses-ltr-user-interface-layout-direction) .volume.slider): Deleted.
+    Also flip the fullscreen volume up and volume down buttons.
+    
+    LayoutTests:
+    
+    `MacOSFullscreenMediaControls` defaults to having `usesLTRUserInterfaceLayoutDirection` be
+    `false`, so flip the order of the volume controls to match the non-LTR UI.
+    
+    * media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-constructor.html:
+    * media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-constructor-expected.txt:
+    * media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-volume-styles.html:
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@265709 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2020-08-14  Devin Rousso  <[email protected]>
+
+            RTL: volume slider and icons are backwards
+            https://bugs.webkit.org/show_bug.cgi?id=215482
+            <rdar://problem/65730749>
+
+            Reviewed by Eric Carlson.
+
+            `MacOSFullscreenMediaControls` defaults to having `usesLTRUserInterfaceLayoutDirection` be
+            `false`, so flip the order of the volume controls to match the non-LTR UI.
+
+            * media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-constructor.html:
+            * media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-constructor-expected.txt:
+            * media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-volume-styles.html:
+
+2020-08-14  Alan Coon  <[email protected]>
+
         Cherry-pick r265603. rdar://problem/67084483
 
     Font loads quickly followed by navigations may fail indefinitely

Modified: branches/safari-610.1-branch/LayoutTests/media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-constructor-expected.txt (265720 => 265721)


--- branches/safari-610.1-branch/LayoutTests/media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-constructor-expected.txt	2020-08-15 00:16:57 UTC (rev 265720)
+++ branches/safari-610.1-branch/LayoutTests/media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-constructor-expected.txt	2020-08-15 00:17:02 UTC (rev 265721)
@@ -14,7 +14,7 @@
 PASS mediaControls.bottomControlsBar.children[3] instanceof ButtonsContainer is true
 
 Left container
-PASS mediaControls.bottomControlsBar.children[1].children is [mediaControls.volumeDownButton, mediaControls.volumeSlider, mediaControls.volumeUpButton]
+PASS mediaControls.bottomControlsBar.children[1].children is [mediaControls.volumeUpButton, mediaControls.volumeSlider, mediaControls.volumeDownButton]
 PASS mediaControls.bottomControlsBar.children[1].element.className is "buttons-container left"
 PASS mediaControls.bottomControlsBar.children[1].leftMargin is 12
 PASS mediaControls.bottomControlsBar.children[1].rightMargin is 0

Modified: branches/safari-610.1-branch/LayoutTests/media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-constructor.html (265720 => 265721)


--- branches/safari-610.1-branch/LayoutTests/media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-constructor.html	2020-08-15 00:16:57 UTC (rev 265720)
+++ branches/safari-610.1-branch/LayoutTests/media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-constructor.html	2020-08-15 00:17:02 UTC (rev 265721)
@@ -20,7 +20,7 @@
 
 debug("");
 debug("Left container");
-shouldBe("mediaControls.bottomControlsBar.children[1].children", "[mediaControls.volumeDownButton, mediaControls.volumeSlider, mediaControls.volumeUpButton]");
+shouldBe("mediaControls.bottomControlsBar.children[1].children", "[mediaControls.volumeUpButton, mediaControls.volumeSlider, mediaControls.volumeDownButton]");
 shouldBeEqualToString("mediaControls.bottomControlsBar.children[1].element.className", "buttons-container left");
 shouldBe("mediaControls.bottomControlsBar.children[1].leftMargin", "12");
 shouldBe("mediaControls.bottomControlsBar.children[1].rightMargin", "0");

Modified: branches/safari-610.1-branch/LayoutTests/media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-volume-styles.html (265720 => 265721)


--- branches/safari-610.1-branch/LayoutTests/media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-volume-styles.html	2020-08-15 00:16:57 UTC (rev 265720)
+++ branches/safari-610.1-branch/LayoutTests/media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-volume-styles.html	2020-08-15 00:17:02 UTC (rev 265721)
@@ -9,6 +9,8 @@
 window.jsTestIsAsync = true;
 
 const mediaControls = new MacOSFullscreenMediaControls;
+mediaControls.usesLTRUserInterfaceLayoutDirection = true;
+
 document.body.appendChild(mediaControls.element);
 
 shouldBecomeEqualToString("window.getComputedStyle(mediaControls.volumeSlider.element).left", "30px", () => {

Modified: branches/safari-610.1-branch/Source/WebCore/ChangeLog (265720 => 265721)


--- branches/safari-610.1-branch/Source/WebCore/ChangeLog	2020-08-15 00:16:57 UTC (rev 265720)
+++ branches/safari-610.1-branch/Source/WebCore/ChangeLog	2020-08-15 00:17:02 UTC (rev 265721)
@@ -1,5 +1,65 @@
 2020-08-14  Alan Coon  <[email protected]>
 
+        Cherry-pick r265709. rdar://problem/67106107
+
+    RTL: volume slider and icons are backwards
+    https://bugs.webkit.org/show_bug.cgi?id=215482
+    <rdar://problem/65730749>
+    
+    Reviewed by Eric Carlson.
+    
+    Source/WebCore:
+    
+    * Modules/modern-media-controls/controls/inline-media-controls.js:
+    (InlineMediaControls.prototype.layout):
+    Flip the inline volume button when not in LTR.
+    
+    * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
+    (MacOSFullscreenMediaControls.prototype.layout):
+    (MacOSFullscreenMediaControls.prototype._volumeControlsForCurrentDirection): Added.
+    Reverse the order of the fullscreen volume controls when not in LTR.
+    
+    * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.css:
+    (.media-controls.mac.fullscreen:not(.uses-ltr-user-interface-layout-direction) :is(.volume-down, .volume.slider, .volume-up)): Added.
+    (.media-controls.mac.fullscreen:not(.uses-ltr-user-interface-layout-direction) .volume.slider): Deleted.
+    Also flip the fullscreen volume up and volume down buttons.
+    
+    LayoutTests:
+    
+    `MacOSFullscreenMediaControls` defaults to having `usesLTRUserInterfaceLayoutDirection` be
+    `false`, so flip the order of the volume controls to match the non-LTR UI.
+    
+    * media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-constructor.html:
+    * media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-constructor-expected.txt:
+    * media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-volume-styles.html:
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@265709 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2020-08-14  Devin Rousso  <[email protected]>
+
+            RTL: volume slider and icons are backwards
+            https://bugs.webkit.org/show_bug.cgi?id=215482
+            <rdar://problem/65730749>
+
+            Reviewed by Eric Carlson.
+
+            * Modules/modern-media-controls/controls/inline-media-controls.js:
+            (InlineMediaControls.prototype.layout):
+            Flip the inline volume button when not in LTR.
+
+            * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
+            (MacOSFullscreenMediaControls.prototype.layout):
+            (MacOSFullscreenMediaControls.prototype._volumeControlsForCurrentDirection): Added.
+            Reverse the order of the fullscreen volume controls when not in LTR.
+
+            * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.css:
+            (.media-controls.mac.fullscreen:not(.uses-ltr-user-interface-layout-direction) :is(.volume-down, .volume.slider, .volume-up)): Added.
+            (.media-controls.mac.fullscreen:not(.uses-ltr-user-interface-layout-direction) .volume.slider): Deleted.
+            Also flip the fullscreen volume up and volume down buttons.
+
+2020-08-14  Alan Coon  <[email protected]>
+
         Cherry-pick r265690. rdar://problem/67100613
 
     The PiP button on the fullscreen youtube player disappears after starting a new video in a playlist

Modified: branches/safari-610.1-branch/Source/WebCore/Modules/modern-media-controls/controls/inline-media-controls.js (265720 => 265721)


--- branches/safari-610.1-branch/Source/WebCore/Modules/modern-media-controls/controls/inline-media-controls.js	2020-08-15 00:16:57 UTC (rev 265720)
+++ branches/safari-610.1-branch/Source/WebCore/Modules/modern-media-controls/controls/inline-media-controls.js	2020-08-15 00:17:02 UTC (rev 265721)
@@ -166,7 +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.muteButton.usesRTLIconVariant = false;
+        this.muteButton.usesRTLIconVariant = !this.usesLTRUserInterfaceLayoutDirection;
 
         for (let button of this._droppableButtons()) {
             // If the button is not enabled, we can skip it.

Modified: branches/safari-610.1-branch/Source/WebCore/Modules/modern-media-controls/controls/macos-fullscreen-media-controls.css (265720 => 265721)


--- branches/safari-610.1-branch/Source/WebCore/Modules/modern-media-controls/controls/macos-fullscreen-media-controls.css	2020-08-15 00:16:57 UTC (rev 265720)
+++ branches/safari-610.1-branch/Source/WebCore/Modules/modern-media-controls/controls/macos-fullscreen-media-controls.css	2020-08-15 00:17:02 UTC (rev 265721)
@@ -40,9 +40,9 @@
     height: var(--fullscreen-controls-bar-height);
 }
 
-/* Volume slider */
+/* Volume controls */
 
-.media-controls.mac.fullscreen:not(.uses-ltr-user-interface-layout-direction) .volume.slider {
+.media-controls.mac.fullscreen:not(.uses-ltr-user-interface-layout-direction) :is(.volume-down, .volume.slider, .volume-up) {
     transform: scaleX(-1);
 }
 

Modified: branches/safari-610.1-branch/Source/WebCore/Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js (265720 => 265721)


--- branches/safari-610.1-branch/Source/WebCore/Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js	2020-08-15 00:16:57 UTC (rev 265720)
+++ branches/safari-610.1-branch/Source/WebCore/Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js	2020-08-15 00:17:02 UTC (rev 265721)
@@ -51,7 +51,7 @@
         this.volumeSlider.width = 60;
 
         this._leftContainer = new ButtonsContainer({
-            children: [this.volumeDownButton, this.volumeSlider, this.volumeUpButton],
+            children: this._volumeControlsForCurrentDirection(),
             cssClassName: "left",
             leftMargin: 12,
             rightMargin: 0,
@@ -124,6 +124,7 @@
         this._rightContainer.buttonMargin = buttonMargin;
 
         this._leftContainer.visible = this.muteButton.enabled;
+        this._leftContainer.children = this._volumeControlsForCurrentDirection();
 
         this._leftContainer.layout();
         this._centerContainer.layout();
@@ -143,6 +144,11 @@
 
     // Private
 
+    _volumeControlsForCurrentDirection()
+    {
+        return this.usesLTRUserInterfaceLayoutDirection ? [this.volumeDownButton, this.volumeSlider, this.volumeUpButton] : [this.volumeUpButton, this.volumeSlider, this.volumeDownButton];
+    }
+
     _handleMousedown(event)
     {
         // We don't allow dragging when the interaction is initiated on an interactive element. 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to