<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[185915] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/185915">185915</a></dd>
<dt>Author</dt> <dd>beidson@apple.com</dd>
<dt>Date</dt> <dd>2015-06-24 09:57:30 -0700 (Wed, 24 Jun 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Update JavaScript dialog delegates to include a WKSecurityOriginRef argument.
&lt;rdar://problem/21269187&gt; and https://bugs.webkit.org/show_bug.cgi?id=146249

Reviewed by Alex Christensen.

Source/WebKit2:

* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageUIClient): Call the new signature if the client has it set.
  Otherwise fall back to the old signature.
* UIProcess/API/C/WKPageUIClient.h: Deprecate the old method signature, and add the new
  one to the newest V5 client structure.

Tools:

- Update WKTR to the new client structure.
- Update existing TestWebKitAPI tests to either use the new client structure or
  assign the old function signature to the updated variable name.
- Include a new test.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:

* TestWebKitAPI/Tests/WebKit2/CloseFromWithinCreatePage.cpp:
(TestWebKitAPI::runJavaScriptAlert):

* TestWebKitAPI/Tests/WebKit2/DocumentStartUserScriptAlertCrash.cpp:
(TestWebKitAPI::TEST):

* TestWebKitAPI/Tests/WebKit2/ModalAlertsSPI.cpp:
(TestWebKitAPI::analyzeDialogArguments):
(TestWebKitAPI::runJavaScriptAlert):
(TestWebKitAPI::runJavaScriptConfirm):
(TestWebKitAPI::runJavaScriptPrompt):
(TestWebKitAPI::createNewPage):
(TestWebKitAPI::TEST):

* TestWebKitAPI/Tests/mac/FullscreenZoomInitialFrame.mm:
(TestWebKitAPI::FullscreenZoomInitialFrame::initializeView):

* TestWebKitAPI/Tests/mac/PageVisibilityStateWithWindowChanges.mm:
(TestWebKitAPI::PageVisibilityStateWithWindowChanges::initializeView):

* WebKitTestRunner/TestController.cpp:
(WTR::TestController::createOtherPage):
(WTR::TestController::createWebViewWithOptions):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICWKPagecpp">trunk/Source/WebKit2/UIProcess/API/C/WKPage.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICWKPageUIClienth">trunk/Source/WebKit2/UIProcess/API/C/WKPageUIClient.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcesseflPageUIClientEflcpp">trunk/Source/WebKit2/UIProcess/efl/PageUIClientEfl.cpp</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsTestWebKitAPITestWebKitAPIxcodeprojprojectpbxproj">trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKit2CloseFromWithinCreatePagecpp">trunk/Tools/TestWebKitAPI/Tests/WebKit2/CloseFromWithinCreatePage.cpp</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKit2DocumentStartUserScriptAlertCrashcpp">trunk/Tools/TestWebKitAPI/Tests/WebKit2/DocumentStartUserScriptAlertCrash.cpp</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsmacFullscreenZoomInitialFramemm">trunk/Tools/TestWebKitAPI/Tests/mac/FullscreenZoomInitialFrame.mm</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsmacPageVisibilityStateWithWindowChangesmm">trunk/Tools/TestWebKitAPI/Tests/mac/PageVisibilityStateWithWindowChanges.mm</a></li>
<li><a href="#trunkToolsWebKitTestRunnerTestControllercpp">trunk/Tools/WebKitTestRunner/TestController.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkToolsTestWebKitAPITestsWebKit2ModalAlertsSPIcpp">trunk/Tools/TestWebKitAPI/Tests/WebKit2/ModalAlertsSPI.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (185914 => 185915)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2015-06-24 16:38:55 UTC (rev 185914)
+++ trunk/Source/WebKit2/ChangeLog        2015-06-24 16:57:30 UTC (rev 185915)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2015-06-24  Brady Eidson  &lt;beidson@apple.com&gt;
+
+        Update JavaScript dialog delegates to include a WKSecurityOriginRef argument.
+        &lt;rdar://problem/21269187&gt; and https://bugs.webkit.org/show_bug.cgi?id=146249
+
+        Reviewed by Alex Christensen.
+
+        * UIProcess/API/C/WKPage.cpp:
+        (WKPageSetPageUIClient): Call the new signature if the client has it set.
+          Otherwise fall back to the old signature.
+        * UIProcess/API/C/WKPageUIClient.h: Deprecate the old method signature, and add the new
+          one to the newest V5 client structure.
+
</ins><span class="cx"> 2015-06-24  Ryuan Choi  &lt;ryuan.choi@navercorp.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Remove some dead code from Download
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICWKPagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/C/WKPage.cpp (185914 => 185915)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/C/WKPage.cpp        2015-06-24 16:38:55 UTC (rev 185914)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKPage.cpp        2015-06-24 16:57:30 UTC (rev 185915)
</span><span class="lines">@@ -1408,36 +1408,53 @@
</span><span class="cx">             m_client.unfocus(toAPI(page), m_client.base.clientInfo);
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        virtual void runJavaScriptAlert(WebPageProxy* page, const String&amp; message, WebFrameProxy* frame, const SecurityOriginData&amp;, std::function&lt;void ()&gt; completionHandler) override
</del><ins>+        virtual void runJavaScriptAlert(WebPageProxy* page, const String&amp; message, WebFrameProxy* frame, const SecurityOriginData&amp; securityOriginData, std::function&lt;void ()&gt; completionHandler) override
</ins><span class="cx">         {
</span><del>-            if (!m_client.runJavaScriptAlert) {
</del><ins>+            if (!m_client.runJavaScriptAlert &amp;&amp; !m_client.runJavaScriptAlert_deprecatedForUseWithV0) {
</ins><span class="cx">                 completionHandler();
</span><span class="cx">                 return;
</span><span class="cx">             }
</span><span class="cx"> 
</span><del>-            m_client.runJavaScriptAlert(toAPI(page), toAPI(message.impl()), toAPI(frame), m_client.base.clientInfo);
</del><ins>+            if (m_client.runJavaScriptAlert) {
+                RefPtr&lt;API::SecurityOrigin&gt; securityOrigin = API::SecurityOrigin::create(securityOriginData.protocol, securityOriginData.host, securityOriginData.port);
+                m_client.runJavaScriptAlert(toAPI(page), toAPI(message.impl()), toAPI(frame), toAPI(securityOrigin.get()), m_client.base.clientInfo);
+            } else
+                m_client.runJavaScriptAlert_deprecatedForUseWithV0(toAPI(page), toAPI(message.impl()), toAPI(frame), m_client.base.clientInfo);
+
</ins><span class="cx">             completionHandler();
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        virtual void runJavaScriptConfirm(WebPageProxy* page, const String&amp; message, WebFrameProxy* frame, const SecurityOriginData&amp;, std::function&lt;void (bool)&gt; completionHandler) override
</del><ins>+        virtual void runJavaScriptConfirm(WebPageProxy* page, const String&amp; message, WebFrameProxy* frame, const SecurityOriginData&amp; securityOriginData, std::function&lt;void (bool)&gt; completionHandler) override
</ins><span class="cx">         {
</span><del>-            if (!m_client.runJavaScriptConfirm) {
</del><ins>+            if (!m_client.runJavaScriptConfirm &amp;&amp; !m_client.runJavaScriptConfirm_deprecatedForUseWithV0) {
</ins><span class="cx">                 completionHandler(false);
</span><span class="cx">                 return;
</span><span class="cx">             }
</span><span class="cx"> 
</span><del>-            bool result = m_client.runJavaScriptConfirm(toAPI(page), toAPI(message.impl()), toAPI(frame), m_client.base.clientInfo);
</del><ins>+            bool result;
+            if (m_client.runJavaScriptConfirm) {
+                RefPtr&lt;API::SecurityOrigin&gt; securityOrigin = API::SecurityOrigin::create(securityOriginData.protocol, securityOriginData.host, securityOriginData.port);
+                result = m_client.runJavaScriptConfirm(toAPI(page), toAPI(message.impl()), toAPI(frame), toAPI(securityOrigin.get()), m_client.base.clientInfo);
+            } else
+                result = m_client.runJavaScriptConfirm_deprecatedForUseWithV0(toAPI(page), toAPI(message.impl()), toAPI(frame), m_client.base.clientInfo);
+
</ins><span class="cx">             completionHandler(result);
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        virtual void runJavaScriptPrompt(WebPageProxy* page, const String&amp; message, const String&amp; defaultValue, WebFrameProxy* frame, const SecurityOriginData&amp;, std::function&lt;void (const String&amp;)&gt; completionHandler) override
</del><ins>+        virtual void runJavaScriptPrompt(WebPageProxy* page, const String&amp; message, const String&amp; defaultValue, WebFrameProxy* frame, const SecurityOriginData&amp; securityOriginData, std::function&lt;void (const String&amp;)&gt; completionHandler) override
</ins><span class="cx">         {
</span><del>-            if (!m_client.runJavaScriptPrompt) {
</del><ins>+            if (!m_client.runJavaScriptPrompt &amp;&amp; !m_client.runJavaScriptPrompt_deprecatedForUseWithV0) {
</ins><span class="cx">                 completionHandler(String());
</span><span class="cx">                 return;
</span><span class="cx">             }
</span><span class="cx"> 
</span><del>-            RefPtr&lt;API::String&gt; string = adoptRef(toImpl(m_client.runJavaScriptPrompt(toAPI(page), toAPI(message.impl()), toAPI(defaultValue.impl()), toAPI(frame), m_client.base.clientInfo)));
</del><ins>+            RefPtr&lt;API::String&gt; string;
+            if (m_client.runJavaScriptPrompt) {
+                RefPtr&lt;API::SecurityOrigin&gt; securityOrigin = API::SecurityOrigin::create(securityOriginData.protocol, securityOriginData.host, securityOriginData.port);
+                string = adoptRef(toImpl(m_client.runJavaScriptPrompt(toAPI(page), toAPI(message.impl()), toAPI(defaultValue.impl()), toAPI(frame), toAPI(securityOrigin.get()), m_client.base.clientInfo)));
+            } else
+                string = adoptRef(toImpl(m_client.runJavaScriptPrompt_deprecatedForUseWithV0(toAPI(page), toAPI(message.impl()), toAPI(defaultValue.impl()), toAPI(frame), m_client.base.clientInfo)));
+
</ins><span class="cx">             if (!string) {
</span><span class="cx">                 completionHandler(String());
</span><span class="cx">                 return;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICWKPageUIClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/C/WKPageUIClient.h (185914 => 185915)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/C/WKPageUIClient.h        2015-06-24 16:38:55 UTC (rev 185914)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKPageUIClient.h        2015-06-24 16:57:30 UTC (rev 185915)
</span><span class="lines">@@ -50,9 +50,9 @@
</span><span class="cx"> 
</span><span class="cx"> typedef void (*WKPageUIClientCallback)(WKPageRef page, const void* clientInfo);
</span><span class="cx"> typedef WKPageRef (*WKPageCreateNewPageCallback)(WKPageRef page, WKURLRequestRef urlRequest, WKDictionaryRef features, WKEventModifiers modifiers, WKEventMouseButton mouseButton, const void *clientInfo);
</span><del>-typedef void (*WKPageRunJavaScriptAlertCallback)(WKPageRef page, WKStringRef alertText, WKFrameRef frame, const void *clientInfo);
-typedef bool (*WKPageRunJavaScriptConfirmCallback)(WKPageRef page, WKStringRef message, WKFrameRef frame, const void *clientInfo);
-typedef WKStringRef (*WKPageRunJavaScriptPromptCallback)(WKPageRef page, WKStringRef message, WKStringRef defaultValue, WKFrameRef frame, const void *clientInfo);
</del><ins>+typedef void (*WKPageRunJavaScriptAlertCallback)(WKPageRef page, WKStringRef alertText, WKFrameRef frame, WKSecurityOriginRef securityOrigin, const void *clientInfo);
+typedef bool (*WKPageRunJavaScriptConfirmCallback)(WKPageRef page, WKStringRef message, WKFrameRef frame, WKSecurityOriginRef securityOrigin, const void *clientInfo);
+typedef WKStringRef (*WKPageRunJavaScriptPromptCallback)(WKPageRef page, WKStringRef message, WKStringRef defaultValue, WKFrameRef frame, WKSecurityOriginRef securityOrigin, const void *clientInfo);
</ins><span class="cx"> typedef void (*WKPageTakeFocusCallback)(WKPageRef page, WKFocusDirection direction, const void *clientInfo);
</span><span class="cx"> typedef void (*WKPageFocusCallback)(WKPageRef page, const void *clientInfo);
</span><span class="cx"> typedef void (*WKPageUnfocusCallback)(WKPageRef page, const void *clientInfo);
</span><span class="lines">@@ -97,6 +97,9 @@
</span><span class="cx"> typedef void      (*WKPageMouseDidMoveOverElementCallback_deprecatedForUseWithV0)(WKPageRef page, WKEventModifiers modifiers, WKTypeRef userData, const void *clientInfo);
</span><span class="cx"> typedef void (*WKPageMissingPluginButtonClickedCallback_deprecatedForUseWithV0)(WKPageRef page, WKStringRef mimeType, WKStringRef url, WKStringRef pluginsPageURL, const void* clientInfo);
</span><span class="cx"> typedef void (*WKPageUnavailablePluginButtonClickedCallback_deprecatedForUseWithV1)(WKPageRef page, WKPluginUnavailabilityReason pluginUnavailabilityReason, WKStringRef mimeType, WKStringRef url, WKStringRef pluginsPageURL, const void* clientInfo);
</span><ins>+typedef void (*WKPageRunJavaScriptAlertCallback_deprecatedForUseWithV0)(WKPageRef page, WKStringRef alertText, WKFrameRef frame, const void *clientInfo);
+typedef bool (*WKPageRunJavaScriptConfirmCallback_deprecatedForUseWithV0)(WKPageRef page, WKStringRef message, WKFrameRef frame, const void *clientInfo);
+typedef WKStringRef (*WKPageRunJavaScriptPromptCallback_deprecatedForUseWithV0)(WKPageRef page, WKStringRef message, WKStringRef defaultValue, WKFrameRef frame, const void *clientInfo);
</ins><span class="cx"> 
</span><span class="cx"> typedef struct WKPageUIClientBase {
</span><span class="cx">     int                                                                 version;
</span><span class="lines">@@ -113,9 +116,9 @@
</span><span class="cx">     WKPageTakeFocusCallback                                             takeFocus;
</span><span class="cx">     WKPageFocusCallback                                                 focus;
</span><span class="cx">     WKPageUnfocusCallback                                               unfocus;
</span><del>-    WKPageRunJavaScriptAlertCallback                                    runJavaScriptAlert;
-    WKPageRunJavaScriptConfirmCallback                                  runJavaScriptConfirm;
-    WKPageRunJavaScriptPromptCallback                                   runJavaScriptPrompt;
</del><ins>+    WKPageRunJavaScriptAlertCallback_deprecatedForUseWithV0             runJavaScriptAlert_deprecatedForUseWithV0;
+    WKPageRunJavaScriptConfirmCallback_deprecatedForUseWithV0           runJavaScriptConfirm_deprecatedForUseWithV0;
+    WKPageRunJavaScriptPromptCallback_deprecatedForUseWithV0            runJavaScriptPrompt_deprecatedForUseWithV0;
</ins><span class="cx">     WKPageSetStatusTextCallback                                         setStatusText;
</span><span class="cx">     WKPageMouseDidMoveOverElementCallback_deprecatedForUseWithV0        mouseDidMoveOverElement_deprecatedForUseWithV0;
</span><span class="cx">     WKPageMissingPluginButtonClickedCallback_deprecatedForUseWithV0     missingPluginButtonClicked_deprecatedForUseWithV0;
</span><span class="lines">@@ -158,9 +161,9 @@
</span><span class="cx">     WKPageTakeFocusCallback                                             takeFocus;
</span><span class="cx">     WKPageFocusCallback                                                 focus;
</span><span class="cx">     WKPageUnfocusCallback                                               unfocus;
</span><del>-    WKPageRunJavaScriptAlertCallback                                    runJavaScriptAlert;
-    WKPageRunJavaScriptConfirmCallback                                  runJavaScriptConfirm;
-    WKPageRunJavaScriptPromptCallback                                   runJavaScriptPrompt;
</del><ins>+    WKPageRunJavaScriptAlertCallback_deprecatedForUseWithV0             runJavaScriptAlert_deprecatedForUseWithV0;
+    WKPageRunJavaScriptConfirmCallback_deprecatedForUseWithV0           runJavaScriptConfirm_deprecatedForUseWithV0;
+    WKPageRunJavaScriptPromptCallback_deprecatedForUseWithV0            runJavaScriptPrompt_deprecatedForUseWithV0;
</ins><span class="cx">     WKPageSetStatusTextCallback                                         setStatusText;
</span><span class="cx">     WKPageMouseDidMoveOverElementCallback_deprecatedForUseWithV0        mouseDidMoveOverElement_deprecatedForUseWithV0;
</span><span class="cx">     WKPageMissingPluginButtonClickedCallback_deprecatedForUseWithV0     missingPluginButtonClicked_deprecatedForUseWithV0;
</span><span class="lines">@@ -209,9 +212,9 @@
</span><span class="cx">     WKPageTakeFocusCallback                                             takeFocus;
</span><span class="cx">     WKPageFocusCallback                                                 focus;
</span><span class="cx">     WKPageUnfocusCallback                                               unfocus;
</span><del>-    WKPageRunJavaScriptAlertCallback                                    runJavaScriptAlert;
-    WKPageRunJavaScriptConfirmCallback                                  runJavaScriptConfirm;
-    WKPageRunJavaScriptPromptCallback                                   runJavaScriptPrompt;
</del><ins>+    WKPageRunJavaScriptAlertCallback_deprecatedForUseWithV0             runJavaScriptAlert_deprecatedForUseWithV0;
+    WKPageRunJavaScriptConfirmCallback_deprecatedForUseWithV0           runJavaScriptConfirm_deprecatedForUseWithV0;
+    WKPageRunJavaScriptPromptCallback_deprecatedForUseWithV0            runJavaScriptPrompt_deprecatedForUseWithV0;
</ins><span class="cx">     WKPageSetStatusTextCallback                                         setStatusText;
</span><span class="cx">     WKPageMouseDidMoveOverElementCallback_deprecatedForUseWithV0        mouseDidMoveOverElement_deprecatedForUseWithV0;
</span><span class="cx">     WKPageMissingPluginButtonClickedCallback_deprecatedForUseWithV0     missingPluginButtonClicked_deprecatedForUseWithV0;
</span><span class="lines">@@ -265,9 +268,9 @@
</span><span class="cx">     WKPageTakeFocusCallback                                             takeFocus;
</span><span class="cx">     WKPageFocusCallback                                                 focus;
</span><span class="cx">     WKPageUnfocusCallback                                               unfocus;
</span><del>-    WKPageRunJavaScriptAlertCallback                                    runJavaScriptAlert;
-    WKPageRunJavaScriptConfirmCallback                                  runJavaScriptConfirm;
-    WKPageRunJavaScriptPromptCallback                                   runJavaScriptPrompt;
</del><ins>+    WKPageRunJavaScriptAlertCallback_deprecatedForUseWithV0             runJavaScriptAlert_deprecatedForUseWithV0;
+    WKPageRunJavaScriptConfirmCallback_deprecatedForUseWithV0           runJavaScriptConfirm_deprecatedForUseWithV0;
+    WKPageRunJavaScriptPromptCallback_deprecatedForUseWithV0            runJavaScriptPrompt_deprecatedForUseWithV0;
</ins><span class="cx">     WKPageSetStatusTextCallback                                         setStatusText;
</span><span class="cx">     WKPageMouseDidMoveOverElementCallback_deprecatedForUseWithV0        mouseDidMoveOverElement_deprecatedForUseWithV0;
</span><span class="cx">     WKPageMissingPluginButtonClickedCallback_deprecatedForUseWithV0     missingPluginButtonClicked_deprecatedForUseWithV0;
</span><span class="lines">@@ -324,9 +327,9 @@
</span><span class="cx">     WKPageTakeFocusCallback                                             takeFocus;
</span><span class="cx">     WKPageFocusCallback                                                 focus;
</span><span class="cx">     WKPageUnfocusCallback                                               unfocus;
</span><del>-    WKPageRunJavaScriptAlertCallback                                    runJavaScriptAlert;
-    WKPageRunJavaScriptConfirmCallback                                  runJavaScriptConfirm;
-    WKPageRunJavaScriptPromptCallback                                   runJavaScriptPrompt;
</del><ins>+    WKPageRunJavaScriptAlertCallback_deprecatedForUseWithV0             runJavaScriptAlert_deprecatedForUseWithV0;
+    WKPageRunJavaScriptConfirmCallback_deprecatedForUseWithV0           runJavaScriptConfirm_deprecatedForUseWithV0;
+    WKPageRunJavaScriptPromptCallback_deprecatedForUseWithV0            runJavaScriptPrompt_deprecatedForUseWithV0;
</ins><span class="cx">     WKPageSetStatusTextCallback                                         setStatusText;
</span><span class="cx">     WKPageMouseDidMoveOverElementCallback_deprecatedForUseWithV0        mouseDidMoveOverElement_deprecatedForUseWithV0;
</span><span class="cx">     WKPageMissingPluginButtonClickedCallback_deprecatedForUseWithV0     missingPluginButtonClicked_deprecatedForUseWithV0;
</span><span class="lines">@@ -389,9 +392,9 @@
</span><span class="cx">     WKPageTakeFocusCallback                                             takeFocus;
</span><span class="cx">     WKPageFocusCallback                                                 focus;
</span><span class="cx">     WKPageUnfocusCallback                                               unfocus;
</span><del>-    WKPageRunJavaScriptAlertCallback                                    runJavaScriptAlert;
-    WKPageRunJavaScriptConfirmCallback                                  runJavaScriptConfirm;
-    WKPageRunJavaScriptPromptCallback                                   runJavaScriptPrompt;
</del><ins>+    WKPageRunJavaScriptAlertCallback_deprecatedForUseWithV0             runJavaScriptAlert_deprecatedForUseWithV0;
+    WKPageRunJavaScriptConfirmCallback_deprecatedForUseWithV0           runJavaScriptConfirm_deprecatedForUseWithV0;
+    WKPageRunJavaScriptPromptCallback_deprecatedForUseWithV0            runJavaScriptPrompt_deprecatedForUseWithV0;
</ins><span class="cx">     WKPageSetStatusTextCallback                                         setStatusText;
</span><span class="cx">     WKPageMouseDidMoveOverElementCallback_deprecatedForUseWithV0        mouseDidMoveOverElement_deprecatedForUseWithV0;
</span><span class="cx">     WKPageMissingPluginButtonClickedCallback_deprecatedForUseWithV0     missingPluginButtonClicked_deprecatedForUseWithV0;
</span><span class="lines">@@ -446,6 +449,9 @@
</span><span class="cx">     // Version 5.
</span><span class="cx">     WKPageDecidePolicyForUserMediaPermissionRequestCallback             decidePolicyForUserMediaPermissionRequest;
</span><span class="cx">     WKPageDidClickAutoFillButtonCallback                                didClickAutoFillButton;
</span><ins>+    WKPageRunJavaScriptAlertCallback                                    runJavaScriptAlert;
+    WKPageRunJavaScriptConfirmCallback                                  runJavaScriptConfirm;
+    WKPageRunJavaScriptPromptCallback                                   runJavaScriptPrompt;
</ins><span class="cx"> } WKPageUIClientV5;
</span><span class="cx"> 
</span><span class="cx"> enum { kWKPageUIClientCurrentVersion WK_ENUM_DEPRECATED(&quot;Use an explicit version number instead&quot;) = 2 };
</span><span class="lines">@@ -460,9 +466,9 @@
</span><span class="cx">     WKPageTakeFocusCallback                                             takeFocus;
</span><span class="cx">     WKPageFocusCallback                                                 focus;
</span><span class="cx">     WKPageUnfocusCallback                                               unfocus;
</span><del>-    WKPageRunJavaScriptAlertCallback                                    runJavaScriptAlert;
-    WKPageRunJavaScriptConfirmCallback                                  runJavaScriptConfirm;
-    WKPageRunJavaScriptPromptCallback                                   runJavaScriptPrompt;
</del><ins>+    WKPageRunJavaScriptAlertCallback_deprecatedForUseWithV0             runJavaScriptAlert_deprecatedForUseWithV0;
+    WKPageRunJavaScriptConfirmCallback_deprecatedForUseWithV0           runJavaScriptConfirm_deprecatedForUseWithV0;
+    WKPageRunJavaScriptPromptCallback_deprecatedForUseWithV0            runJavaScriptPrompt_deprecatedForUseWithV0;
</ins><span class="cx">     WKPageSetStatusTextCallback                                         setStatusText;
</span><span class="cx">     WKPageMouseDidMoveOverElementCallback_deprecatedForUseWithV0        mouseDidMoveOverElement_deprecatedForUseWithV0;
</span><span class="cx">     WKPageMissingPluginButtonClickedCallback_deprecatedForUseWithV0     missingPluginButtonClicked_deprecatedForUseWithV0;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcesseflPageUIClientEflcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/efl/PageUIClientEfl.cpp (185914 => 185915)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/efl/PageUIClientEfl.cpp        2015-06-24 16:38:55 UTC (rev 185914)
+++ trunk/Source/WebKit2/UIProcess/efl/PageUIClientEfl.cpp        2015-06-24 16:57:30 UTC (rev 185915)
</span><span class="lines">@@ -60,9 +60,9 @@
</span><span class="cx">     uiClient.takeFocus = takeFocus;
</span><span class="cx">     uiClient.focus = focus;
</span><span class="cx">     uiClient.unfocus = unfocus;
</span><del>-    uiClient.runJavaScriptAlert = runJavaScriptAlert;
-    uiClient.runJavaScriptConfirm = runJavaScriptConfirm;
-    uiClient.runJavaScriptPrompt = runJavaScriptPrompt;
</del><ins>+    uiClient.runJavaScriptAlert_deprecatedForUseWithV0 = runJavaScriptAlert;
+    uiClient.runJavaScriptConfirm_deprecatedForUseWithV0 = runJavaScriptConfirm;
+    uiClient.runJavaScriptPrompt_deprecatedForUseWithV0 = runJavaScriptPrompt;
</ins><span class="cx">     uiClient.toolbarsAreVisible = toolbarsAreVisible;
</span><span class="cx">     uiClient.setToolbarsAreVisible = setToolbarsAreVisible;
</span><span class="cx">     uiClient.menuBarIsVisible = menuBarIsVisible;
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (185914 => 185915)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2015-06-24 16:38:55 UTC (rev 185914)
+++ trunk/Tools/ChangeLog        2015-06-24 16:57:30 UTC (rev 185915)
</span><span class="lines">@@ -1,3 +1,41 @@
</span><ins>+2015-06-24  Brady Eidson  &lt;beidson@apple.com&gt;
+
+        Update JavaScript dialog delegates to include a WKSecurityOriginRef argument.
+        &lt;rdar://problem/21269187&gt; and https://bugs.webkit.org/show_bug.cgi?id=146249
+
+        Reviewed by Alex Christensen.
+
+        - Update WKTR to the new client structure.
+        - Update existing TestWebKitAPI tests to either use the new client structure or
+          assign the old function signature to the updated variable name.
+        - Include a new test.
+
+        * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+
+        * TestWebKitAPI/Tests/WebKit2/CloseFromWithinCreatePage.cpp:
+        (TestWebKitAPI::runJavaScriptAlert):
+
+        * TestWebKitAPI/Tests/WebKit2/DocumentStartUserScriptAlertCrash.cpp:
+        (TestWebKitAPI::TEST):
+
+        * TestWebKitAPI/Tests/WebKit2/ModalAlertsSPI.cpp:
+        (TestWebKitAPI::analyzeDialogArguments):
+        (TestWebKitAPI::runJavaScriptAlert):
+        (TestWebKitAPI::runJavaScriptConfirm):
+        (TestWebKitAPI::runJavaScriptPrompt):
+        (TestWebKitAPI::createNewPage):
+        (TestWebKitAPI::TEST):
+
+        * TestWebKitAPI/Tests/mac/FullscreenZoomInitialFrame.mm:
+        (TestWebKitAPI::FullscreenZoomInitialFrame::initializeView):
+
+        * TestWebKitAPI/Tests/mac/PageVisibilityStateWithWindowChanges.mm:
+        (TestWebKitAPI::PageVisibilityStateWithWindowChanges::initializeView):
+
+        * WebKitTestRunner/TestController.cpp:
+        (WTR::TestController::createOtherPage):
+        (WTR::TestController::createWebViewWithOptions):
+
</ins><span class="cx"> 2015-06-23  Dewei Zhu  &lt;dewei_zhu@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Refactoring benchmark runner script to follow pep8 code style.
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestWebKitAPIxcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj (185914 => 185915)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj        2015-06-24 16:38:55 UTC (rev 185914)
+++ trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj        2015-06-24 16:57:30 UTC (rev 185915)
</span><span class="lines">@@ -51,6 +51,7 @@
</span><span class="cx">                 51393E221523952D005F39C5 /* DOMWindowExtensionBasic_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51393E1D1523944A005F39C5 /* DOMWindowExtensionBasic_Bundle.cpp */; };
</span><span class="cx">                 5142B2731517C8C800C32B19 /* ContextMenuCanCopyURL.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 5142B2721517C89100C32B19 /* ContextMenuCanCopyURL.html */; };
</span><span class="cx">                 517E7E04151119C100D0B008 /* MemoryCachePruneWithinResourceLoadDelegate.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 517E7E031511187500D0B008 /* MemoryCachePruneWithinResourceLoadDelegate.html */; };
</span><ins>+                51CB4AD81B3A079C00C1B1C6 /* ModalAlertsSPI.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51CB4AD71B3A079C00C1B1C6 /* ModalAlertsSPI.cpp */; };
</ins><span class="cx">                 51CD1C6C1B38CE4300142CA5 /* ModalAlerts.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51CD1C6A1B38CE3600142CA5 /* ModalAlerts.mm */; };
</span><span class="cx">                 51CD1C721B38D48400142CA5 /* modal-alerts-in-new-about-blank-window.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 51CD1C711B38D48400142CA5 /* modal-alerts-in-new-about-blank-window.html */; };
</span><span class="cx">                 51E5C7021919C3B200D8B3E1 /* simple2.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 51E780361919AFF8001829A2 /* simple2.html */; };
</span><span class="lines">@@ -519,6 +520,7 @@
</span><span class="cx">                 5142B2721517C89100C32B19 /* ContextMenuCanCopyURL.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = ContextMenuCanCopyURL.html; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 517E7DFB15110EA600D0B008 /* MemoryCachePruneWithinResourceLoadDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MemoryCachePruneWithinResourceLoadDelegate.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 517E7E031511187500D0B008 /* MemoryCachePruneWithinResourceLoadDelegate.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = MemoryCachePruneWithinResourceLoadDelegate.html; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                51CB4AD71B3A079C00C1B1C6 /* ModalAlertsSPI.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ModalAlertsSPI.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 51CD1C6A1B38CE3600142CA5 /* ModalAlerts.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ModalAlerts.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 51CD1C711B38D48400142CA5 /* modal-alerts-in-new-about-blank-window.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; path = &quot;modal-alerts-in-new-about-blank-window.html&quot;; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 51E5C7041919EA5F00D8B3E1 /* ShouldKeepCurrentBackForwardListItemInList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ShouldKeepCurrentBackForwardListItemInList.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -1005,6 +1007,7 @@
</span><span class="cx">                                 33DC8910141953A300747EF7 /* LoadCanceledNoServerRedirectCallback.cpp */,
</span><span class="cx">                                 33DC89131419579F00747EF7 /* LoadCanceledNoServerRedirectCallback_Bundle.cpp */,
</span><span class="cx">                                 8AA28C1916D2FA7B002FF4DB /* LoadPageOnCrash.cpp */,
</span><ins>+                                51CB4AD71B3A079C00C1B1C6 /* ModalAlertsSPI.cpp */,
</ins><span class="cx">                                 33BE5AF4137B5A6C00705813 /* MouseMoveAfterCrash.cpp */,
</span><span class="cx">                                 33BE5AF8137B5AAE00705813 /* MouseMoveAfterCrash_Bundle.cpp */,
</span><span class="cx">                                 93F1DB3014DA20760024C362 /* NewFirstVisuallyNonEmptyLayout.cpp */,
</span><span class="lines">@@ -1626,6 +1629,7 @@
</span><span class="cx">                                 2E7765CF16C4D81100BA2BB1 /* mainMac.mm in Sources */,
</span><span class="cx">                                 41973B5B1AF2286A006C7B36 /* FileSystem.cpp in Sources */,
</span><span class="cx">                                 7A5623111AD5AF3E0096B920 /* MenuTypesForMouseEvents.cpp in Sources */,
</span><ins>+                                51CB4AD81B3A079C00C1B1C6 /* ModalAlertsSPI.cpp in Sources */,
</ins><span class="cx">                                 26F6E1F01ADC749B00DE696B /* DFAMinimizer.cpp in Sources */,
</span><span class="cx">                                 260BA5791B1D2E7B004FA07C /* DFACombiner.cpp in Sources */,
</span><span class="cx">                                 7A99D9941AD4A29D00373141 /* MenuTypesForMouseEvents.mm in Sources */,
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKit2CloseFromWithinCreatePagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit2/CloseFromWithinCreatePage.cpp (185914 => 185915)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKit2/CloseFromWithinCreatePage.cpp        2015-06-24 16:38:55 UTC (rev 185914)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2/CloseFromWithinCreatePage.cpp        2015-06-24 16:57:30 UTC (rev 185915)
</span><span class="lines">@@ -35,7 +35,7 @@
</span><span class="cx"> static bool testDone;
</span><span class="cx"> static std::unique_ptr&lt;PlatformWebView&gt; openedWebView;
</span><span class="cx"> 
</span><del>-static void runJavaScriptAlert(WKPageRef page, WKStringRef alertText, WKFrameRef frame, const void* clientInfo)
</del><ins>+static void runJavaScriptAlert(WKPageRef page, WKStringRef alertText, WKFrameRef frame, WKSecurityOriginRef, const void* clientInfo)
</ins><span class="cx"> {
</span><span class="cx">     // FIXME: Check that the alert text matches the storage.
</span><span class="cx">     testDone = true;
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKit2DocumentStartUserScriptAlertCrashcpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit2/DocumentStartUserScriptAlertCrash.cpp (185914 => 185915)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKit2/DocumentStartUserScriptAlertCrash.cpp        2015-06-24 16:38:55 UTC (rev 185914)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2/DocumentStartUserScriptAlertCrash.cpp        2015-06-24 16:57:30 UTC (rev 185915)
</span><span class="lines">@@ -36,7 +36,7 @@
</span><span class="cx"> 
</span><span class="cx"> static bool done;
</span><span class="cx"> 
</span><del>-static void runJavaScriptAlert(WKPageRef page, WKStringRef alertText, WKFrameRef frame, const void* clientInfo)
</del><ins>+static void runJavaScriptAlert_deprecatedForUseWithV0(WKPageRef page, WKStringRef alertText, WKFrameRef frame, const void* clientInfo)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT_NOT_NULL(frame);
</span><span class="cx"> 
</span><span class="lines">@@ -57,7 +57,7 @@
</span><span class="cx">     memset(&amp;uiClient, 0, sizeof(uiClient));
</span><span class="cx"> 
</span><span class="cx">     uiClient.base.version = 0;
</span><del>-    uiClient.runJavaScriptAlert = runJavaScriptAlert;
</del><ins>+    uiClient.runJavaScriptAlert_deprecatedForUseWithV0 = runJavaScriptAlert_deprecatedForUseWithV0;
</ins><span class="cx"> 
</span><span class="cx">     WKPageSetPageUIClient(webView.page(), &amp;uiClient.base);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKit2ModalAlertsSPIcppfromrev185914trunkToolsTestWebKitAPITestsWebKit2CloseFromWithinCreatePagecpp"></a>
<div class="copfile"><h4>Copied: trunk/Tools/TestWebKitAPI/Tests/WebKit2/ModalAlertsSPI.cpp (from rev 185914, trunk/Tools/TestWebKitAPI/Tests/WebKit2/CloseFromWithinCreatePage.cpp) (0 => 185915)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKit2/ModalAlertsSPI.cpp                                (rev 0)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2/ModalAlertsSPI.cpp        2015-06-24 16:57:30 UTC (rev 185915)
</span><span class="lines">@@ -0,0 +1,123 @@
</span><ins>+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+
+#if WK_HAVE_C_SPI
+
+#include &quot;PlatformUtilities.h&quot;
+#include &quot;PlatformWebView.h&quot;
+#include &quot;Test.h&quot;
+#include &lt;WebKit/WKFrame.h&gt;
+#include &lt;WebKit/WKRetainPtr.h&gt;
+#include &lt;WebKit/WKSecurityOriginRef.h&gt;
+
+namespace TestWebKitAPI {
+
+static bool done;
+static unsigned dialogsSeen;
+static const unsigned dialogsExpected = 3;
+
+static void analyzeDialogArguments(WKPageRef page, WKFrameRef frame, WKSecurityOriginRef securityOrigin)
+{
+    EXPECT_EQ(page, WKFrameGetPage(frame));
+
+    WKRetainPtr&lt;WKURLRef&gt; url = adoptWK(WKFrameCopyURL(frame));
+    WKRetainPtr&lt;WKStringRef&gt; urlString = adoptWK(WKURLCopyString(url.get()));
+    EXPECT_WK_STREQ(&quot;about:blank&quot;, urlString.get());
+
+    WKRetainPtr&lt;WKStringRef&gt; protocol = adoptWK(WKSecurityOriginCopyProtocol(securityOrigin));
+    EXPECT_WK_STREQ(&quot;file&quot;, protocol.get());
+
+    WKRetainPtr&lt;WKStringRef&gt; host = adoptWK(WKSecurityOriginCopyHost(securityOrigin));
+    EXPECT_WK_STREQ(&quot;&quot;, host.get());
+
+    EXPECT_EQ(WKSecurityOriginGetPort(securityOrigin), 0);
+
+    if (++dialogsSeen == dialogsExpected)
+        done = true;
+}
+
+static void runJavaScriptAlert(WKPageRef page, WKStringRef, WKFrameRef frame, WKSecurityOriginRef securityOrigin, const void*)
+{
+    analyzeDialogArguments(page, frame, securityOrigin);
+}
+
+static bool runJavaScriptConfirm(WKPageRef page, WKStringRef, WKFrameRef frame, WKSecurityOriginRef securityOrigin, const void*)
+{
+    analyzeDialogArguments(page, frame, securityOrigin);
+    return false;
+}
+
+static WKStringRef runJavaScriptPrompt(WKPageRef page, WKStringRef, WKStringRef, WKFrameRef frame, WKSecurityOriginRef securityOrigin, const void*)
+{
+    analyzeDialogArguments(page, frame, securityOrigin);
+    return nullptr;
+}
+
+static std::unique_ptr&lt;PlatformWebView&gt; openedWebView;
+
+static WKPageRef createNewPage(WKPageRef page, WKURLRequestRef urlRequest, WKDictionaryRef features, WKEventModifiers modifiers, WKEventMouseButton mouseButton, const void *clientInfo)
+{
+    EXPECT_TRUE(openedWebView == nullptr);
+
+    openedWebView = std::make_unique&lt;PlatformWebView&gt;(page);
+
+    WKPageUIClientV5 uiClient;
+    memset(&amp;uiClient, 0, sizeof(uiClient));
+
+    uiClient.base.version = 5;
+    uiClient.runJavaScriptAlert = runJavaScriptAlert;
+    uiClient.runJavaScriptConfirm = runJavaScriptConfirm;
+    uiClient.runJavaScriptPrompt = runJavaScriptPrompt;
+
+    WKPageSetPageUIClient(openedWebView-&gt;page(), &amp;uiClient.base);
+
+    WKRetain(openedWebView-&gt;page());
+    return openedWebView-&gt;page();
+}
+
+TEST(WebKit2, ModalAlertsSPI)
+{
+    WKRetainPtr&lt;WKContextRef&gt; context = adoptWK(WKContextCreate());
+    PlatformWebView webView(context.get());
+
+    WKPageUIClientV5 uiClient;
+    memset(&amp;uiClient, 0, sizeof(uiClient));
+
+    uiClient.base.version = 5;
+    uiClient.createNewPage = createNewPage;
+
+    WKPageSetPageUIClient(webView.page(), &amp;uiClient.base);
+
+    WKRetainPtr&lt;WKURLRef&gt; url(AdoptWK, Util::createURLForResource(&quot;modal-alerts-in-new-about-blank-window&quot;, &quot;html&quot;));
+    WKPageLoadURL(webView.page(), url.get());
+
+    Util::run(&amp;done);
+}
+
+} // namespace TestWebKitAPI
+
+#endif
</ins></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsmacFullscreenZoomInitialFramemm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/mac/FullscreenZoomInitialFrame.mm (185914 => 185915)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/mac/FullscreenZoomInitialFrame.mm        2015-06-24 16:38:55 UTC (rev 185914)
+++ trunk/Tools/TestWebKitAPI/Tests/mac/FullscreenZoomInitialFrame.mm        2015-06-24 16:57:30 UTC (rev 185915)
</span><span class="lines">@@ -57,7 +57,7 @@
</span><span class="cx"> 
</span><span class="cx"> // WebKit2 WKPageUIClient
</span><span class="cx"> 
</span><del>-static void runJavaScriptAlert(WKPageRef page, WKStringRef alertText, WKFrameRef frame, const void* clientInfo)
</del><ins>+static void runJavaScriptAlert_deprecatedForUseWithV0(WKPageRef page, WKStringRef alertText, WKFrameRef frame, const void* clientInfo)
</ins><span class="cx"> {
</span><span class="cx">     EXPECT_TRUE(isWaitingForPageSignalToContinue);
</span><span class="cx">     isWaitingForPageSignalToContinue = false;
</span><span class="lines">@@ -112,7 +112,7 @@
</span><span class="cx">     memset(&amp;uiClient, 0, sizeof(uiClient));
</span><span class="cx"> 
</span><span class="cx">     uiClient.base.version = 0;
</span><del>-    uiClient.runJavaScriptAlert = runJavaScriptAlert;
</del><ins>+    uiClient.runJavaScriptAlert_deprecatedForUseWithV0 = runJavaScriptAlert_deprecatedForUseWithV0;
</ins><span class="cx"> 
</span><span class="cx">     WKPageSetPageUIClient(wkView.pageRef, &amp;uiClient.base);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsmacPageVisibilityStateWithWindowChangesmm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/mac/PageVisibilityStateWithWindowChanges.mm (185914 => 185915)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/mac/PageVisibilityStateWithWindowChanges.mm        2015-06-24 16:38:55 UTC (rev 185914)
+++ trunk/Tools/TestWebKitAPI/Tests/mac/PageVisibilityStateWithWindowChanges.mm        2015-06-24 16:57:30 UTC (rev 185915)
</span><span class="lines">@@ -52,7 +52,7 @@
</span><span class="cx"> 
</span><span class="cx"> // WebKit2 WKPageUIClient
</span><span class="cx"> 
</span><del>-static void runJavaScriptAlert(WKPageRef page, WKStringRef alertText, WKFrameRef frame, const void* clientInfo)
</del><ins>+static void runJavaScriptAlert_deprecatedForUseWithV0(WKPageRef page, WKStringRef alertText, WKFrameRef frame, const void* clientInfo)
</ins><span class="cx"> {
</span><span class="cx">     EXPECT_TRUE(isWaitingForPageSignalToContinue);
</span><span class="cx">     isWaitingForPageSignalToContinue = false;
</span><span class="lines">@@ -99,7 +99,7 @@
</span><span class="cx">     memset(&amp;uiClient, 0, sizeof(uiClient));
</span><span class="cx"> 
</span><span class="cx">     uiClient.base.version = 0;
</span><del>-    uiClient.runJavaScriptAlert = runJavaScriptAlert;
</del><ins>+    uiClient.runJavaScriptAlert_deprecatedForUseWithV0 = runJavaScriptAlert_deprecatedForUseWithV0;
</ins><span class="cx"> 
</span><span class="cx">     WKPageSetPageUIClient(wkView.pageRef, &amp;uiClient.base);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerTestControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/TestController.cpp (185914 => 185915)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/TestController.cpp        2015-06-24 16:38:55 UTC (rev 185914)
+++ trunk/Tools/WebKitTestRunner/TestController.cpp        2015-06-24 16:57:30 UTC (rev 185915)
</span><span class="lines">@@ -213,9 +213,9 @@
</span><span class="cx">         0, // takeFocus
</span><span class="cx">         focus,
</span><span class="cx">         unfocus,
</span><del>-        0, // runJavaScriptAlert
-        0, // runJavaScriptConfirm
-        0, // runJavaScriptPrompt
</del><ins>+        0, // runJavaScriptAlert_deprecatedForUseWithV0
+        0, // runJavaScriptAlert_deprecatedForUseWithV0
+        0, // runJavaScriptAlert_deprecatedForUseWithV0
</ins><span class="cx">         0, // setStatusText
</span><span class="cx">         0, // mouseDidMoveOverElement_deprecatedForUseWithV0
</span><span class="cx">         0, // missingPluginButtonClicked
</span><span class="lines">@@ -260,6 +260,9 @@
</span><span class="cx">         0, // isPlayingAudioDidChange
</span><span class="cx">         decidePolicyForUserMediaPermissionRequest,
</span><span class="cx">         0, // didClickAutofillButton
</span><ins>+        0, // runJavaScriptAlert
+        0, // runJavaScriptConfirm
+        0, // runJavaScriptPrompt
</ins><span class="cx">     };
</span><span class="cx">     WKPageSetPageUIClient(newPage, &amp;otherPageUIClient.base);
</span><span class="cx">     
</span><span class="lines">@@ -458,9 +461,9 @@
</span><span class="cx">         0, // takeFocus
</span><span class="cx">         focus,
</span><span class="cx">         unfocus,
</span><del>-        0, // runJavaScriptAlert
-        0, // runJavaScriptConfirm
-        0, // runJavaScriptPrompt
</del><ins>+        0, // runJavaScriptAlert_deprecatedForUseWithV0
+        0, // runJavaScriptAlert_deprecatedForUseWithV0
+        0, // runJavaScriptAlert_deprecatedForUseWithV0
</ins><span class="cx">         0, // setStatusText
</span><span class="cx">         0, // mouseDidMoveOverElement_deprecatedForUseWithV0
</span><span class="cx">         0, // missingPluginButtonClicked
</span><span class="lines">@@ -505,6 +508,9 @@
</span><span class="cx">         0, // isPlayingAudioDidChange
</span><span class="cx">         decidePolicyForUserMediaPermissionRequest,
</span><span class="cx">         0, // didClickAutofillButton
</span><ins>+        0, // runJavaScriptAlert
+        0, // runJavaScriptConfirm
+        0, // runJavaScriptPrompt
</ins><span class="cx">     };
</span><span class="cx">     WKPageSetPageUIClient(m_mainWebView-&gt;page(), &amp;pageUIClient.base);
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>