Title: [238348] trunk/Tools
Revision
238348
Author
jer.no...@apple.com
Date
2018-11-17 07:13:07 -0800 (Sat, 17 Nov 2018)

Log Message

Regression(r233865): Causes synchronous IPC in the middle of layout
https://bugs.webkit.org/show_bug.cgi?id=188307
<rdar://problem/42807306>

Reviewed by Eric Carlson.

Follow-up test fix for r238322:

In ExitFullscreenOnEnterPiP.ElementFullScreen, explicitly make the video
element in element fullscreen the "main content" by playing the video during
a user gesture; only "main content" videos will cause fullscreen mode to exit
when that element is taken into PiP.

In FullscreenZoomInitialFrame.WebKit, the WebView is not visible, so the Page
is considered hidden, and fullscreen is not allowed when the WebView is hidden.
Make the WebView visible by ordering the test window on-screen.

* TestWebKitAPI/Tests/WebKitCocoa/ExitFullscreenOnEnterPiP.html:
* TestWebKitAPI/Tests/WebKitCocoa/ExitFullscreenOnEnterPiP.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/mac/FullscreenZoomInitialFrame.mm:
(TestWebKitAPI::FullscreenZoomInitialFrame::runTest):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (238347 => 238348)


--- trunk/Tools/ChangeLog	2018-11-17 11:01:12 UTC (rev 238347)
+++ trunk/Tools/ChangeLog	2018-11-17 15:13:07 UTC (rev 238348)
@@ -1,3 +1,28 @@
+2018-11-17  Jer Noble  <jer.no...@apple.com>
+
+        Regression(r233865): Causes synchronous IPC in the middle of layout
+        https://bugs.webkit.org/show_bug.cgi?id=188307
+        <rdar://problem/42807306>
+
+        Reviewed by Eric Carlson.
+
+        Follow-up test fix for r238322:
+
+        In ExitFullscreenOnEnterPiP.ElementFullScreen, explicitly make the video
+        element in element fullscreen the "main content" by playing the video during
+        a user gesture; only "main content" videos will cause fullscreen mode to exit
+        when that element is taken into PiP.
+
+        In FullscreenZoomInitialFrame.WebKit, the WebView is not visible, so the Page
+        is considered hidden, and fullscreen is not allowed when the WebView is hidden.
+        Make the WebView visible by ordering the test window on-screen.
+
+        * TestWebKitAPI/Tests/WebKitCocoa/ExitFullscreenOnEnterPiP.html:
+        * TestWebKitAPI/Tests/WebKitCocoa/ExitFullscreenOnEnterPiP.mm:
+        (TestWebKitAPI::TEST):
+        * TestWebKitAPI/Tests/mac/FullscreenZoomInitialFrame.mm:
+        (TestWebKitAPI::FullscreenZoomInitialFrame::runTest):
+
 2018-11-16  Alex Christensen  <achristen...@webkit.org>
 
         Tweak _showSafeBrowsingWarningWithTitle SPI

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ExitFullscreenOnEnterPiP.html (238347 => 238348)


--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ExitFullscreenOnEnterPiP.html	2018-11-17 11:01:12 UTC (rev 238347)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ExitFullscreenOnEnterPiP.html	2018-11-17 15:13:07 UTC (rev 238348)
@@ -1,12 +1,23 @@
 <!DOCTYPE html>
 <html>
 <head>
+    <script>
+    window.addEventListener('load', event => {
+        let video = document.querySelector('video');
+        video.addEventListener('playing', event => {
+            try {
+                window.webkit.messageHandlers.testHandler.postMessage('playing');
+            } catch (e) { }
+        });
+    }, {once: true});
+    </script>
 </head>
 <button id="enter-video-fullscreen" _onclick_="document.querySelector('video').webkitEnterFullscreen()">enter video fullscreen</button>
 <button id="enter-element-fullscreen" _onclick_="document.querySelector('#target').webkitRequestFullscreen()">enter element fullscreen</button>
 <button id="enter-pip" _onclick_="document.querySelector('video').webkitSetPresentationMode('picture-in-picture')">enter pip</button>
 <button id="exit-pip" _onclick_="document.querySelector('video').webkitSetPresentationMode('inline')">exit pip</button>
-<body _onload_="load(); window._onloadcompleted_ = true; ">
+<button id="play" _onclick_="document.querySelector('video').play()">play video</button>
+<body>
     <div id="target">
         <video id="video" playsinline src="" />
     </div>

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ExitFullscreenOnEnterPiP.mm (238347 => 238348)


--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ExitFullscreenOnEnterPiP.mm	2018-11-17 11:01:12 UTC (rev 238347)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ExitFullscreenOnEnterPiP.mm	2018-11-17 15:13:07 UTC (rev 238348)
@@ -114,6 +114,12 @@
     TestWebKitAPI::Util::run(&didEnterFullscreen);
     ASSERT_TRUE(didEnterFullscreen);
 
+    // Make the video the "main content" by playing with a user gesture.
+    __block bool didBeginPlaying = false;
+    [webView performAfterReceivingMessage:@"playing" action:^{ didBeginPlaying = true; }];
+    [webView evaluateJavaScript:@"document.getElementById('play').click()" completionHandler:nil];
+    TestWebKitAPI::Util::run(&didBeginPlaying);
+
     didEnterPiP = false;
     didExitFullscreen = false;
     [webView evaluateJavaScript:@"document.getElementById('enter-pip').click()" completionHandler: nil];

Modified: trunk/Tools/TestWebKitAPI/Tests/mac/FullscreenZoomInitialFrame.mm (238347 => 238348)


--- trunk/Tools/TestWebKitAPI/Tests/mac/FullscreenZoomInitialFrame.mm	2018-11-17 11:01:12 UTC (rev 238347)
+++ trunk/Tools/TestWebKitAPI/Tests/mac/FullscreenZoomInitialFrame.mm	2018-11-17 15:13:07 UTC (rev 238348)
@@ -156,6 +156,7 @@
 {
     RetainPtr<NSWindow> window = adoptNS([[NSWindow alloc] initWithContentRect:view.frame styleMask:NSWindowStyleMaskBorderless backing:NSBackingStoreBuffered defer:NO]);
     [window.get().contentView addSubview:view];
+    [window makeKeyAndOrderFront:view];
 
     setPageScale(view, 2);
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to