[Modern Media Controls] iOS: long press on play button shows the Copy menu
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 9 Mar 2017 22:17:57 +0000 (22:17 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 9 Mar 2017 22:17:57 +0000 (22:17 +0000)
https://bugs.webkit.org/show_bug.cgi?id=169355
<rdar://problem/30928998>

Patch by Antoine Quint <graouts@apple.com> on 2017-03-09
Reviewed by Dean Jackson.

Source/WebCore:

Disable built-in UI behavior that shows a magnifier or a copy callout when pressing
on an element for a long time. These do not make sense for media controls.

Test: media/modern-media-controls/audio/audio-controls-styles.html

* Modules/modern-media-controls/controls/media-controls.css:
(:host):

LayoutTests:

Add a test to check that the expected properties are set as they should to disable
built-in UI behavior that shows a magnifier or a copy callout when pressing on an
element for a long time.

* media/modern-media-controls/audio/audio-controls-styles-expected.txt: Added.
* media/modern-media-controls/audio/audio-controls-styles.html: Added.
* platform/mac/TestExpectations:

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

LayoutTests/ChangeLog
LayoutTests/media/modern-media-controls/audio/audio-controls-styles-expected.txt [new file with mode: 0644]
LayoutTests/media/modern-media-controls/audio/audio-controls-styles.html [new file with mode: 0644]
LayoutTests/platform/mac/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/Modules/modern-media-controls/controls/media-controls.css

index b588db5..a936674 100644 (file)
@@ -1,3 +1,19 @@
+2017-03-09  Antoine Quint  <graouts@apple.com>
+
+        [Modern Media Controls] iOS: long press on play button shows the Copy menu
+        https://bugs.webkit.org/show_bug.cgi?id=169355
+        <rdar://problem/30928998>
+
+        Reviewed by Dean Jackson.
+
+        Add a test to check that the expected properties are set as they should to disable
+        built-in UI behavior that shows a magnifier or a copy callout when pressing on an
+        element for a long time.
+
+        * media/modern-media-controls/audio/audio-controls-styles-expected.txt: Added.
+        * media/modern-media-controls/audio/audio-controls-styles.html: Added.
+        * platform/mac/TestExpectations:
+
 2017-03-09  Ryan Haddad  <ryanhaddad@apple.com>
 
         Rebaseline js/dom/global-constructors-attributes.html.
diff --git a/LayoutTests/media/modern-media-controls/audio/audio-controls-styles-expected.txt b/LayoutTests/media/modern-media-controls/audio/audio-controls-styles-expected.txt
new file mode 100644 (file)
index 0000000..5193f7d
--- /dev/null
@@ -0,0 +1,12 @@
+Testing media elements disable built-in browser UI features to copy content.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS getComputedStyle(audio).WebkitUserSelect is "none"
+PASS getComputedStyle(audio).WebkitTouchCallout is "none"
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/media/modern-media-controls/audio/audio-controls-styles.html b/LayoutTests/media/modern-media-controls/audio/audio-controls-styles.html
new file mode 100644 (file)
index 0000000..562ea54
--- /dev/null
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<script src="../../../resources/js-test-pre.js"></script>
+<body>
+<script type="text/javascript">
+
+description("Testing media elements disable built-in browser UI features to copy content.");
+
+const audio = document.body.appendChild(document.createElement("audio"));
+audio.controls = true;
+
+shouldBeEqualToString("getComputedStyle(audio).WebkitUserSelect", "none");
+shouldBeEqualToString("getComputedStyle(audio).WebkitTouchCallout", "none");
+
+debug("");
+audio.remove();
+
+</script>
+<script src="../../../resources/js-test-post.js"></script>
+</body>
index e054599..24f3b91 100644 (file)
@@ -1481,6 +1481,7 @@ media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-
 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/audio/audio-controls-styles.html [ Skip ]
 
 webkit.org/b/167266 media/modern-media-controls/media-controller/media-controller-auto-hide-mouse-enter-over-controls-bar.html [ Pass Failure ]
 
index 1937b56..67c1e06 100644 (file)
@@ -1,3 +1,19 @@
+2017-03-09  Antoine Quint  <graouts@apple.com>
+
+        [Modern Media Controls] iOS: long press on play button shows the Copy menu
+        https://bugs.webkit.org/show_bug.cgi?id=169355
+        <rdar://problem/30928998>
+
+        Reviewed by Dean Jackson.
+
+        Disable built-in UI behavior that shows a magnifier or a copy callout when pressing
+        on an element for a long time. These do not make sense for media controls.
+
+        Test: media/modern-media-controls/audio/audio-controls-styles.html
+
+        * Modules/modern-media-controls/controls/media-controls.css:
+        (:host):
+
 2017-03-09  Alex Christensen  <achristensen@webkit.org>
 
         [Content Extensions] Introduce if-top-url and unless-top-url
index 7b2fddb..f0358ed 100644 (file)
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+:host {
+    /* We always want to prevent iOS dialogs and the magnifier UI to be shown. */
+    -webkit-user-select: none !important;
+    -webkit-touch-callout: none !important;
+}
+
 :host(audio) {
     width: 200px;
     min-width: 200px !important;