WebKit Bugzilla
Attachment 341274 Details for
Bug 185619
: Exit fullscreen when javascript alerts are presented.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-185619-20180525054947.patch (text/plain), 8.75 KB, created by
Jeremy Jones
on 2018-05-25 05:49:48 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Jeremy Jones
Created:
2018-05-25 05:49:48 PDT
Size:
8.75 KB
patch
obsolete
>Subversion Revision: 231991 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 3abbd15888ee227cd2c267ff839bc3e1edee6bea..7362b5dacff07ca8003a9b9f3567c970f8526000 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,24 @@ >+2018-05-25 Jeremy Jones <jeremyj@apple.com> >+ >+ Exit fullscreen when javascript alerts are presented. >+ https://bugs.webkit.org/show_bug.cgi?id=185619 >+ rdar://problem/35724264 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ 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-05-18 Brian Burg <bburg@apple.com> > > [Cocoa] Add missing nullability annotations to _WKAutomationSessionDelegate >diff --git a/Source/WebKit/UIProcess/WebPageProxy.cpp b/Source/WebKit/UIProcess/WebPageProxy.cpp >index 1da04d35086bb3a448eea1bdf822cc491146a6d7..73d52699de7e6f962de01e2ba04fde43610e6400 100644 >--- a/Source/WebKit/UIProcess/WebPageProxy.cpp >+++ b/Source/WebKit/UIProcess/WebPageProxy.cpp >@@ -4230,6 +4230,19 @@ void WebPageProxy::showPage() > 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); >@@ -4259,6 +4272,10 @@ void WebPageProxy::runJavaScriptAlert(uint64_t frameID, const SecurityOriginData > 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(); > >@@ -4274,6 +4291,10 @@ void WebPageProxy::runJavaScriptConfirm(uint64_t frameID, const SecurityOriginDa > 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(); > >@@ -4290,6 +4311,9 @@ void WebPageProxy::runJavaScriptPrompt(uint64_t frameID, const SecurityOriginDat > 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(); > >diff --git a/Source/WebKit/UIProcess/WebPageProxy.h b/Source/WebKit/UIProcess/WebPageProxy.h >index 9c24a3f4f73c851481ac0ec9189b1a75e1e3ba48..7a8501f2c5aa60202135d7d935d032964ef16db8 100644 >--- a/Source/WebKit/UIProcess/WebPageProxy.h >+++ b/Source/WebKit/UIProcess/WebPageProxy.h >@@ -356,6 +356,7 @@ public: > bool addsVisitedLinks() const { return m_addsVisitedLinks; } > void setAddsVisitedLinks(bool addsVisitedLinks) { m_addsVisitedLinks = addsVisitedLinks; } > >+ void exitFullscreenImmediately(); > void fullscreenMayReturnToInline(); > void didEnterFullscreen(); > void didExitFullscreen(); >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index d872f0675d36a689129dc0937053e678a0edaab9..bed584563a28a72a639c512ace6eb70d42bcdd69 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,16 @@ >+2018-05-25 Jeremy Jones <jeremyj@apple.com> >+ >+ Exit fullscreen when javascript alerts are presented. >+ https://bugs.webkit.org/show_bug.cgi?id=185619 >+ rdar://problem/35724264 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * TestExpectations: >+ * fullscreen/full-screen-exit-when-alert-expected.txt: Added. >+ * fullscreen/full-screen-exit-when-alert.html: Added. >+ * platform/ios-wk2/TestExpectations: >+ > 2018-05-18 Youenn Fablet <youenn@apple.com> > > NetworkLoadChecker should cancel its content extension retrieval task when being destroyed >diff --git a/LayoutTests/TestExpectations b/LayoutTests/TestExpectations >index 84cc00f7c0f3b253172e34170b7725cae5ececc4..c9fbb159a3a98d933d5eef337cd0fc44d54fc1b7 100644 >--- a/LayoutTests/TestExpectations >+++ b/LayoutTests/TestExpectations >@@ -47,6 +47,7 @@ http/tests/preload/viewport [ Skip ] > http/tests/gzip-content-encoding [ Skip ] > http/tests/cookies/same-site [ Skip ] > system-preview [ Skip ] >+fullscreen/full-screen-exit-when-alert.html [ Skip ] > > # window.showModalDialog is only tested in DumpRenderTree on Mac. > editing/execCommand/show-modal-dialog-during-execCommand.html [ Skip ] >diff --git a/LayoutTests/fullscreen/full-screen-exit-when-alert-expected.txt b/LayoutTests/fullscreen/full-screen-exit-when-alert-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..92745ac1adc092680e96af7e05e99bca7d0d3bdd >--- /dev/null >+++ b/LayoutTests/fullscreen/full-screen-exit-when-alert-expected.txt >@@ -0,0 +1,7 @@ >+ALERT: alert to cause exit fullscreen >+This test requires UIScriptController to run. >+Click here for manual test. >+webkitfullscreenchange [object HTMLDivElement] >+webkitfullscreenchange null >+done. >+ >diff --git a/LayoutTests/fullscreen/full-screen-exit-when-alert.html b/LayoutTests/fullscreen/full-screen-exit-when-alert.html >new file mode 100644 >index 0000000000000000000000000000000000000000..83927ad7ce999829a10f88e274d3518f852236d2 >--- /dev/null >+++ b/LayoutTests/fullscreen/full-screen-exit-when-alert.html >@@ -0,0 +1,68 @@ >+<!DOCTYPE html> >+ >+<html> >+<head> >+ <script> >+ >+ if (window.testRunner) { >+ testRunner.dumpAsText(); >+ testRunner.waitUntilDone(); >+ } >+ >+ function consoleWrite(text) >+ { >+ document.getElementById("target").innerHTML += text + "<br>"; >+ } >+ >+ function getUIScript() >+ { >+ return ` >+ (function() { >+ uiController.singleTapAtPoint(50, 50, function() { >+ uiController.uiScriptComplete("Done"); >+ }); >+ })();`; >+ } >+ >+ function doMouseDown() { >+ document.getElementById("target").webkitRequestFullScreen(); >+ } >+ >+ function fullscreenChanged() { >+ consoleWrite("webkitfullscreenchange " + document.webkitFullscreenElement); >+ if (document.webkitFullscreenElement) >+ alert("alert to cause exit fullscreen"); >+ if (document.webkitFullscreenElement == null) { >+ consoleWrite("done.") >+ testRunner.notifyDone(); >+ } >+ } >+ >+ function runTest() >+ { >+ document.addEventListener('webkitfullscreenchange', fullscreenChanged, false); >+ >+ if (window.testRunner && testRunner.runUIScript) { >+ testRunner.runUIScript(getUIScript(), function(result) { >+ document.getElementById('target').innerHTML = output; >+ }); >+ } >+ } >+ >+ window.addEventListener('load', runTest, false); >+ </script> >+ <style> >+ #target { >+ height: 500px; >+ width: 500px; >+ background-color: silver; >+ } >+ </style> >+</head> >+<body> >+<div id="target" onmousedown="doMouseDown()"> >+ This test requires UIScriptController to run.<br> >+ Click here for manual test.<br> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/platform/ios-wk2/TestExpectations b/LayoutTests/platform/ios-wk2/TestExpectations >index 00fcc7e9b2d4fcdd9ef4944187f9649f85d52097..505b9f36dd7b78821b7752c4b6b6451e0456c5cc 100644 >--- a/LayoutTests/platform/ios-wk2/TestExpectations >+++ b/LayoutTests/platform/ios-wk2/TestExpectations >@@ -65,6 +65,8 @@ http/tests/security/contentSecurityPolicy/manifest-src-allowed.html [ Pass ] > http/tests/security/contentSecurityPolicy/manifest-src-blocked.html [ Pass ] > applicationmanifest/ [ Pass ] > >+fullscreen/full-screen-exit-when-alert.html [ Pass ] >+ > #////////////////////////////////////////////////////////////////////////////////////////// > # End platform-specific directories. > #//////////////////////////////////////////////////////////////////////////////////////////
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 185619
:
340341
|
340367
|
341274
|
341280
|
341765