Title: [232437] trunk/Source/WebKit
Revision
232437
Author
[email protected]
Date
2018-06-02 09:02:14 -0700 (Sat, 02 Jun 2018)

Log Message

Exit fullscreen when _javascript_ alerts are presented.
https://bugs.webkit.org/show_bug.cgi?id=185619
rdar://problem/35724264

Patch by Jeremy Jones <[email protected]> on 2018-06-02
Reviewed by Jer Noble.

Prevent users from being trapped in fullscreen by alert cycles.
Prevent fullscreen from becoming unresponsive due to alerts hidden behind fullscreen.

Fullscreen exit is initiated here in the UI process so that fullscreen UI is torn down immediately,
before the alert is shown.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::exitFullscreenImmediately):
(WebKit::WebPageProxy::runJavaScriptAlert):
(WebKit::WebPageProxy::runJavaScriptConfirm):
(WebKit::WebPageProxy::runJavaScriptPrompt):
* UIProcess/WebPageProxy.h:

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (232436 => 232437)


--- trunk/Source/WebKit/ChangeLog	2018-06-02 15:59:53 UTC (rev 232436)
+++ trunk/Source/WebKit/ChangeLog	2018-06-02 16:02:14 UTC (rev 232437)
@@ -1,3 +1,24 @@
+2018-06-02  Jeremy Jones  <[email protected]>
+
+        Exit fullscreen when _javascript_ alerts are presented.
+        https://bugs.webkit.org/show_bug.cgi?id=185619
+        rdar://problem/35724264
+
+        Reviewed by Jer Noble.
+
+        Prevent users from being trapped in fullscreen by alert cycles.
+        Prevent fullscreen from becoming unresponsive due to alerts hidden behind fullscreen.
+
+        Fullscreen exit is initiated here in the UI process so that fullscreen UI is torn down immediately,
+        before the alert is shown.
+
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::exitFullscreenImmediately):
+        (WebKit::WebPageProxy::runJavaScriptAlert):
+        (WebKit::WebPageProxy::runJavaScriptConfirm):
+        (WebKit::WebPageProxy::runJavaScriptPrompt):
+        * UIProcess/WebPageProxy.h:
+
 2018-06-02  Youenn Fablet  <[email protected]>
 
         Add a sandbox profile for com.cisco.webex.plugin.gpc64 plugin

Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.cpp (232436 => 232437)


--- trunk/Source/WebKit/UIProcess/WebPageProxy.cpp	2018-06-02 15:59:53 UTC (rev 232436)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.cpp	2018-06-02 16:02:14 UTC (rev 232437)
@@ -4244,6 +4244,19 @@
     m_uiClient->showPage(this);
 }
 
+void WebPageProxy::exitFullscreenImmediately()
+{
+#if ENABLE(FULLSCREEN_API)
+    if (fullScreenManager())
+        fullScreenManager()->close();
+#endif
+
+#if (PLATFORM(IOS) && HAVE(AVKIT)) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
+    if (videoFullscreenManager())
+        videoFullscreenManager()->requestHideAndExitFullscreen();
+#endif
+}
+
 void WebPageProxy::fullscreenMayReturnToInline()
 {
     m_uiClient->fullscreenMayReturnToInline(this);
@@ -4273,6 +4286,10 @@
     WebFrameProxy* frame = m_process->webFrame(frameID);
     MESSAGE_CHECK(frame);
 
+#if PLATFORM(IOS)
+    exitFullscreenImmediately();
+#endif
+
     // Since runJavaScriptAlert() can spin a nested run loop we need to turn off the responsiveness timer.
     m_process->responsivenessTimer().stop();
 
@@ -4288,6 +4305,10 @@
     WebFrameProxy* frame = m_process->webFrame(frameID);
     MESSAGE_CHECK(frame);
 
+#if PLATFORM(IOS)
+    exitFullscreenImmediately();
+#endif
+
     // Since runJavaScriptConfirm() can spin a nested run loop we need to turn off the responsiveness timer.
     m_process->responsivenessTimer().stop();
 
@@ -4304,6 +4325,9 @@
     WebFrameProxy* frame = m_process->webFrame(frameID);
     MESSAGE_CHECK(frame);
 
+#if PLATFORM(IOS)
+    exitFullscreenImmediately();
+#endif
     // Since runJavaScriptPrompt() can spin a nested run loop we need to turn off the responsiveness timer.
     m_process->responsivenessTimer().stop();
 

Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.h (232436 => 232437)


--- trunk/Source/WebKit/UIProcess/WebPageProxy.h	2018-06-02 15:59:53 UTC (rev 232436)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.h	2018-06-02 16:02:14 UTC (rev 232437)
@@ -356,6 +356,7 @@
     bool addsVisitedLinks() const { return m_addsVisitedLinks; }
     void setAddsVisitedLinks(bool addsVisitedLinks) { m_addsVisitedLinks = addsVisitedLinks; }
 
+    void exitFullscreenImmediately();
     void fullscreenMayReturnToInline();
     void didEnterFullscreen();
     void didExitFullscreen();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to