Title: [212861] trunk
Revision
212861
Author
[email protected]
Date
2017-02-22 16:19:04 -0800 (Wed, 22 Feb 2017)

Log Message

[Modern Media Controls] Can't set the volume slider with macOS inline controls
https://bugs.webkit.org/show_bug.cgi?id=168747
<rdar://problem/30605528>

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

Source/WebCore:

Only call super for events we haven't registered specifically in the context
of this class. Otherwise we'd invalidate the volume container visibility for
a "mousedown" event registered by the MacOSMediaControls, the super class.

* Modules/modern-media-controls/controls/macos-inline-media-controls.js:
(MacOSInlineMediaControls.prototype.handleEvent):

LayoutTests:

Add some assertions to check that the volume slider container remains visible
after interacting with the volume slider.

* media/modern-media-controls/volume-support/volume-support-click-expected.txt:
* media/modern-media-controls/volume-support/volume-support-click.html:
* media/modern-media-controls/volume-support/volume-support-drag-expected.txt:
* media/modern-media-controls/volume-support/volume-support-drag.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (212860 => 212861)


--- trunk/LayoutTests/ChangeLog	2017-02-22 23:55:34 UTC (rev 212860)
+++ trunk/LayoutTests/ChangeLog	2017-02-23 00:19:04 UTC (rev 212861)
@@ -1,3 +1,19 @@
+2017-02-22  Antoine Quint  <[email protected]>
+
+        [Modern Media Controls] Can't set the volume slider with macOS inline controls
+        https://bugs.webkit.org/show_bug.cgi?id=168747
+        <rdar://problem/30605528>
+
+        Reviewed by Dean Jackson.
+
+        Add some assertions to check that the volume slider container remains visible
+        after interacting with the volume slider.
+
+        * media/modern-media-controls/volume-support/volume-support-click-expected.txt:
+        * media/modern-media-controls/volume-support/volume-support-click.html:
+        * media/modern-media-controls/volume-support/volume-support-drag-expected.txt:
+        * media/modern-media-controls/volume-support/volume-support-drag.html:
+
 2017-02-22  Youenn Fablet  <[email protected]>
 
         [WebRTC] Some webrtc tests are failing

Modified: trunk/LayoutTests/media/modern-media-controls/volume-support/volume-support-click-expected.txt (212860 => 212861)


--- trunk/LayoutTests/media/modern-media-controls/volume-support/volume-support-click-expected.txt	2017-02-22 23:55:34 UTC (rev 212860)
+++ trunk/LayoutTests/media/modern-media-controls/volume-support/volume-support-click-expected.txt	2017-02-23 00:19:04 UTC (rev 212861)
@@ -3,6 +3,7 @@
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
+PASS mediaController.controls.volumeSlider.parent.visible is true
 PASS media.volume is 0.5
 PASS successfullyParsed is true
 

Modified: trunk/LayoutTests/media/modern-media-controls/volume-support/volume-support-click.html (212860 => 212861)


--- trunk/LayoutTests/media/modern-media-controls/volume-support/volume-support-click.html	2017-02-22 23:55:34 UTC (rev 212860)
+++ trunk/LayoutTests/media/modern-media-controls/volume-support/volume-support-click.html	2017-02-23 00:19:04 UTC (rev 212861)
@@ -47,6 +47,9 @@
         eventSender.mouseDown();
         eventSender.mouseUp();
 
+        // Ensure the volume slider remains visible.
+        shouldBeTrue("mediaController.controls.volumeSlider.parent.visible");
+
         scheduler.frameDidFire = null;
     }
 };

Modified: trunk/LayoutTests/media/modern-media-controls/volume-support/volume-support-drag-expected.txt (212860 => 212861)


--- trunk/LayoutTests/media/modern-media-controls/volume-support/volume-support-drag-expected.txt	2017-02-22 23:55:34 UTC (rev 212860)
+++ trunk/LayoutTests/media/modern-media-controls/volume-support/volume-support-drag-expected.txt	2017-02-23 00:19:04 UTC (rev 212861)
@@ -15,6 +15,7 @@
 
 We finished dragging to set the volume to 1
 PASS media.volume is 1
+PASS mediaController.controls.volumeSlider.parent.visible is true
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/media/modern-media-controls/volume-support/volume-support-drag.html (212860 => 212861)


--- trunk/LayoutTests/media/modern-media-controls/volume-support/volume-support-drag.html	2017-02-22 23:55:34 UTC (rev 212860)
+++ trunk/LayoutTests/media/modern-media-controls/volume-support/volume-support-drag.html	2017-02-23 00:19:04 UTC (rev 212861)
@@ -72,6 +72,10 @@
         debug("");
         debug("We finished dragging to set the volume to 1");
         shouldBe("media.volume", "1");
+
+        // Ensure the volume slider remains visible.
+        shouldBeTrue("mediaController.controls.volumeSlider.parent.visible");
+
         container.remove();
         media.remove();
         finishMediaControlsTest();

Modified: trunk/Source/WebCore/ChangeLog (212860 => 212861)


--- trunk/Source/WebCore/ChangeLog	2017-02-22 23:55:34 UTC (rev 212860)
+++ trunk/Source/WebCore/ChangeLog	2017-02-23 00:19:04 UTC (rev 212861)
@@ -1,3 +1,18 @@
+2017-02-22  Antoine Quint  <[email protected]>
+
+        [Modern Media Controls] Can't set the volume slider with macOS inline controls
+        https://bugs.webkit.org/show_bug.cgi?id=168747
+        <rdar://problem/30605528>
+
+        Reviewed by Dean Jackson.
+
+        Only call super for events we haven't registered specifically in the context
+        of this class. Otherwise we'd invalidate the volume container visibility for
+        a "mousedown" event registered by the MacOSMediaControls, the super class.
+
+        * Modules/modern-media-controls/controls/macos-inline-media-controls.js:
+        (MacOSInlineMediaControls.prototype.handleEvent):
+
 2017-02-22  Antti Koivisto  <[email protected]>
 
         Replace SimpleLineLayout::Range by WTF::IteratorRange

Modified: trunk/Source/WebCore/Modules/modern-media-controls/controls/macos-inline-media-controls.js (212860 => 212861)


--- trunk/Source/WebCore/Modules/modern-media-controls/controls/macos-inline-media-controls.js	2017-02-22 23:55:34 UTC (rev 212860)
+++ trunk/Source/WebCore/Modules/modern-media-controls/controls/macos-inline-media-controls.js	2017-02-23 00:19:04 UTC (rev 212861)
@@ -141,8 +141,12 @@
 
     handleEvent(event)
     {
-        super.handleEvent(event);
-        this._volumeSliderContainer.visible = event.type === "mouseenter" || event.relatedTarget === this._volumeSliderContainer.element;
+        if (event.type === "mouseenter" && event.currentTarget === this.muteButton.element)
+            this._volumeSliderContainer.visible = true;
+        else if (event.type === "mouseleave" && (event.currentTarget === this.muteButton.element || event.currentTarget === this._volumeSliderContainer.element))
+            this._volumeSliderContainer.visible = this._volumeSliderContainer.element.contains(event.relatedTarget);
+        else
+            super.handleEvent(event);
     }
 
     controlsBarVisibilityDidChange(controlsBar)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to