<video> does not respect pointer-events
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 7 Nov 2017 20:17:55 +0000 (20:17 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 7 Nov 2017 20:17:55 +0000 (20:17 +0000)
https://bugs.webkit.org/show_bug.cgi?id=179378
<rdar://problem/34687668>

Patch by Antoine Quint <graouts@apple.com> on 2017-11-07
Reviewed by Simon Fraser.

Source/WebCore:

We now honor the "pointer-events" property value set on the <video> element by setting it to "inherit"
on the media controls shadow root container.

Test: media/modern-media-controls/css/pointer-events-none.html

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

LayoutTests:

Add a new test that checks that settings "pointer-events: none" on the <video> element
correctly reflects that same value on the media controls shadow root container.

* media/modern-media-controls/css/pointer-events-none-expected.txt: Added.
* media/modern-media-controls/css/pointer-events-none.html: Added.
* platform/ios/TestExpectations:

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

LayoutTests/ChangeLog
LayoutTests/media/modern-media-controls/css/pointer-events-none-expected.txt [new file with mode: 0644]
LayoutTests/media/modern-media-controls/css/pointer-events-none.html [new file with mode: 0644]
LayoutTests/platform/ios/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/Modules/modern-media-controls/controls/media-controls.css

index 41d424e..079efea 100644 (file)
@@ -1,3 +1,18 @@
+2017-11-07  Antoine Quint  <graouts@apple.com>
+
+        <video> does not respect pointer-events
+        https://bugs.webkit.org/show_bug.cgi?id=179378
+        <rdar://problem/34687668>
+
+        Reviewed by Simon Fraser.
+
+        Add a new test that checks that settings "pointer-events: none" on the <video> element
+        correctly reflects that same value on the media controls shadow root container.
+
+        * media/modern-media-controls/css/pointer-events-none-expected.txt: Added.
+        * media/modern-media-controls/css/pointer-events-none.html: Added.
+        * platform/ios/TestExpectations:
+
 2017-11-07  Chris Dumez  <cdumez@apple.com>
 
         [Service Workers] Add support for "install" event
diff --git a/LayoutTests/media/modern-media-controls/css/pointer-events-none-expected.txt b/LayoutTests/media/modern-media-controls/css/pointer-events-none-expected.txt
new file mode 100644 (file)
index 0000000..0106833
--- /dev/null
@@ -0,0 +1,11 @@
+Testing that settings 'pointer-events: none' on the <video> element is respected in the media controls shadow root.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS getComputedStyle(window.internals.shadowRoot(media).querySelector('.media-controls-container')).pointerEvents is "none"
+PASS interactive is false
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/media/modern-media-controls/css/pointer-events-none.html b/LayoutTests/media/modern-media-controls/css/pointer-events-none.html
new file mode 100644 (file)
index 0000000..f9da0d2
--- /dev/null
@@ -0,0 +1,26 @@
+<script src="../../../resources/js-test-pre.js"></script>
+<script src="../resources/media-controls-utils.js" type="text/javascript"></script>
+<body>
+<video controls style="pointer-events: none"></video>
+<script type="text/javascript">
+
+window.jsTestIsAsync = true;
+
+description("Testing that settings 'pointer-events: none' on the &lt;video> element is respected in the media controls shadow root.");
+
+const media = document.querySelector("video");
+shouldBeEqualToString("getComputedStyle(window.internals.shadowRoot(media).querySelector('.media-controls-container')).pointerEvents", "none");
+
+let interactive = false;
+
+media.addEventListener("click", () => interactive = true);
+media.addEventListener("touchstart", () => interactive = true);
+
+pressOnElement(media, () => {
+    shouldBeFalse("interactive");
+    finishJSTest();
+});
+
+</script>
+<script src="../../../resources/js-test-post.js"></script>
+</body>
index 9cba940..ee0c4a0 100644 (file)
@@ -172,6 +172,7 @@ platform/ios/ios/fast/forms/range-input-touches.html [ Skip ]
 platform/ios/ios/fast/text/data-detectors/phone-disabled.html [ Skip ]
 platform/ios/ios/fast/text/data-detectors/phone.html [ Skip ]
 platform/ios/ios/touch [ Skip ]
+media/modern-media-controls/css/pointer-events-none.html [ Skip ]
 
 # Codecs not supported
 media/media-can-play-ogg.html [ WontFix ]
index 71a6e19..bf63a89 100644 (file)
@@ -1,3 +1,19 @@
+2017-11-07  Antoine Quint  <graouts@apple.com>
+
+        <video> does not respect pointer-events
+        https://bugs.webkit.org/show_bug.cgi?id=179378
+        <rdar://problem/34687668>
+
+        Reviewed by Simon Fraser.
+
+        We now honor the "pointer-events" property value set on the <video> element by setting it to "inherit"
+        on the media controls shadow root container.
+
+        Test: media/modern-media-controls/css/pointer-events-none.html
+
+        * Modules/modern-media-controls/controls/media-controls.css:
+        (.media-controls-container):
+
 2017-11-07  Chris Dumez  <cdumez@apple.com>
 
         [Service Workers] Add support for "install" event
index 52282ac..8c53772 100644 (file)
@@ -54,6 +54,7 @@
     all: initial;
     display: block;
     visibility: inherit;
+    pointer-events: inherit;
     -webkit-cursor-visibility: inherit;
     position: relative;
     will-change: z-index;