Title: [211576] branches/safari-604.1.5-branch

Diff

Modified: branches/safari-604.1.5-branch/LayoutTests/ChangeLog (211575 => 211576)


--- branches/safari-604.1.5-branch/LayoutTests/ChangeLog	2017-02-02 19:20:06 UTC (rev 211575)
+++ branches/safari-604.1.5-branch/LayoutTests/ChangeLog	2017-02-02 19:20:12 UTC (rev 211576)
@@ -1,3 +1,22 @@
+2017-02-02  Matthew Hanson  <matt_han...@apple.com>
+
+        Merge r211339. rdar://problem/29601646
+
+    2017-01-28  Antoine Quint  <grao...@apple.com>
+
+            [Modern Media Controls] REGRESSION: Video stops playing after going into Full Screen in media documents
+            https://bugs.webkit.org/show_bug.cgi?id=167552
+            <rdar://problem/29601646>
+
+            Reviewed by Eric Carlson.
+
+            Add a new test that checks that clicking on a <video> within a media document does not paused after being clicked.
+            Since this behavior uses click events, we use window.eventSender and skip this test on iOS.
+
+            * media/modern-media-controls/media-documents/click-on-video-should-not-pause-expected.txt: Added.
+            * media/modern-media-controls/media-documents/click-on-video-should-not-pause.html: Added.
+            * platform/ios-simulator/TestExpectations:
+
 2017-01-26  Chris Dumez  <cdu...@apple.com>
 
         Crash when navigating back to a page in PacheCache when one of its frames has been removed

Added: branches/safari-604.1.5-branch/LayoutTests/media/modern-media-controls/media-documents/click-on-video-should-not-pause-expected.txt (0 => 211576)


--- branches/safari-604.1.5-branch/LayoutTests/media/modern-media-controls/media-documents/click-on-video-should-not-pause-expected.txt	                        (rev 0)
+++ branches/safari-604.1.5-branch/LayoutTests/media/modern-media-controls/media-documents/click-on-video-should-not-pause-expected.txt	2017-02-02 19:20:12 UTC (rev 211576)
@@ -0,0 +1,14 @@
+Testing that clicking on a video in a media document does not pause it.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS video.paused is false
+
+Clicking on video
+PASS video.paused is false
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: branches/safari-604.1.5-branch/LayoutTests/media/modern-media-controls/media-documents/click-on-video-should-not-pause.html (0 => 211576)


--- branches/safari-604.1.5-branch/LayoutTests/media/modern-media-controls/media-documents/click-on-video-should-not-pause.html	                        (rev 0)
+++ branches/safari-604.1.5-branch/LayoutTests/media/modern-media-controls/media-documents/click-on-video-should-not-pause.html	2017-02-02 19:20:12 UTC (rev 211576)
@@ -0,0 +1,48 @@
+<script src=""
+<script src="" type="text/_javascript_"></script>
+<body>
+<iframe src="" style="position: absolute; top: 0; left: 0;"></iframe>
+<script type="text/_javascript_">
+
+description("Testing that clicking on a video in a media document does not pause it.");
+
+window.jsTestIsAsync = true;
+
+let video;
+(function runTestIfReady() {
+    const iframe = document.querySelector("iframe");
+    video = iframe.contentDocument.querySelector("video");
+
+    if (!video) {
+        setTimeout(runTestIfReady)
+        return;
+    }
+
+    if (!video.paused)
+        videoIsPlaying();
+    else
+        video.addEventListener("play", videoIsPlaying);    
+
+    function videoIsPlaying()
+    {
+        shouldBeFalse("video.paused");
+        
+        const bounds = video.getBoundingClientRect();
+        debug("");
+        debug("Clicking on video");
+        window.eventSender.mouseMoveTo(bounds.left + 10, bounds.top + 10);
+        window.eventSender.mouseDown();
+        window.eventSender.mouseUp();
+
+        shouldBeFalse("video.paused");
+
+        debug("");
+        iframe.remove();
+        finishJSTest();
+    }
+
+})();
+
+</script>
+<script src=""
+</body>

Modified: branches/safari-604.1.5-branch/LayoutTests/platform/ios-simulator/TestExpectations (211575 => 211576)


--- branches/safari-604.1.5-branch/LayoutTests/platform/ios-simulator/TestExpectations	2017-02-02 19:20:06 UTC (rev 211575)
+++ branches/safari-604.1.5-branch/LayoutTests/platform/ios-simulator/TestExpectations	2017-02-02 19:20:12 UTC (rev 211576)
@@ -2800,6 +2800,7 @@
 media/modern-media-controls/media-controller/media-controller-auto-hide-mouse-enter-over-controls-bar.html [ Skip ]
 media/modern-media-controls/media-controller/media-controller-auto-hide-rewind-with-mouse-enter.html [ Skip ]
 media/modern-media-controls/scrubber-support/scrubber-support-click.html [ Skip ]
+media/modern-media-controls/media-documents/click-on-video-should-not-pause.html [ Skip ]
 
 # Tests designed for macOS that have iOS equivalents in "ipad" directories
 media/modern-media-controls/fullscreen-support/fullscreen-support-click.html [ Skip ]

Modified: branches/safari-604.1.5-branch/Source/WebCore/ChangeLog (211575 => 211576)


--- branches/safari-604.1.5-branch/Source/WebCore/ChangeLog	2017-02-02 19:20:06 UTC (rev 211575)
+++ branches/safari-604.1.5-branch/Source/WebCore/ChangeLog	2017-02-02 19:20:12 UTC (rev 211576)
@@ -1,5 +1,28 @@
 2017-02-02  Matthew Hanson  <matt_han...@apple.com>
 
+        Merge r211339. rdar://problem/29601646
+
+    2017-01-28  Antoine Quint  <grao...@apple.com>
+
+            [Modern Media Controls] REGRESSION: Video stops playing after going into Full Screen in media documents
+            https://bugs.webkit.org/show_bug.cgi?id=167552
+            <rdar://problem/29601646>
+
+            Reviewed by Eric Carlson.
+
+            In the case of media documents, there is a built-in behavior, implemented in MediaDocument::defaultEventHandler(),
+            that toggles playback when clicking or double-clicking the video. We disable this behavior by adding a "click" event
+            handler on the entire media shadow root and calling "preventDefault()".
+
+            Test: media/modern-media-controls/media-documents/click-on-video-should-not-pause.html
+
+            * Modules/modern-media-controls/media/media-controller.js:
+            (MediaController):
+            (MediaController.prototype.handleEvent):
+            (MediaController.prototype._containerWasClicked):
+
+2017-02-02  Matthew Hanson  <matt_han...@apple.com>
+
         Merge r211438.
 
     2017-01-31  Jessie Berlin  <jber...@webkit.org>

Modified: branches/safari-604.1.5-branch/Source/WebCore/Modules/modern-media-controls/media/media-controller.js (211575 => 211576)


--- branches/safari-604.1.5-branch/Source/WebCore/Modules/modern-media-controls/media/media-controller.js	2017-02-02 19:20:06 UTC (rev 211575)
+++ branches/safari-604.1.5-branch/Source/WebCore/Modules/modern-media-controls/media/media-controller.js	2017-02-02 19:20:12 UTC (rev 211576)
@@ -34,6 +34,7 @@
 
         this.container = shadowRoot.appendChild(document.createElement("div"));
         this.container.className = "media-controls-container";
+        this.container.addEventListener("click", this, true);
 
         if (host) {
             host.controlsDependOnPageScaleFactor = this.layoutTraits & LayoutTraits.iOS;
@@ -78,6 +79,8 @@
     {
         if (event.type === "resize" && event.currentTarget === this.shadowRoot)
             this._updateControlsSize();
+        else if (event.type === "click" && event.currentTarget === this.container)
+            this._containerWasClicked(event);
         else if (event.currentTarget === this.media) {
             this._updateControlsIfNeeded();
             if (event.type === "webkitpresentationmodechanged")
@@ -87,6 +90,13 @@
 
     // Private
 
+    _containerWasClicked(event)
+    {
+        // We need to call preventDefault() here since, in the case of Media Documents,
+        // playback may be toggled when clicking on the video.
+        event.preventDefault();
+    }
+
     _updateControlsIfNeeded()
     {
         const previousControls = this.controls;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to