<!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>[184151] 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/184151">184151</a></dd>
<dt>Author</dt> <dd>mitz@apple.com</dd>
<dt>Date</dt> <dd>2015-05-11 22:38:11 -0700 (Mon, 11 May 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>
Source/WebCore:
WebCore part of &lt;rdar://problem/20878075&gt; Trying to navigate to an invalid URL loads about:blank, but -[WKWebView URL] returns the invalid URL

Reviewed by Alexey Proskuryakov.

Test: TestWebKitAPI/Tests/WebKit2Cocoa/ProvisionalURLChange.mm

In some cases, trying to navigate to an invalid URL results in navigation to about:blank.
When the about:blank load is committed, the UI process still thinks that the provisional
URL is the original, invalid URL, and updates its state to reflect that that’s the URL that
has been committed.

The provisional URL changes (1) when a provisional load begins, (2) when a server redirect
happens, (3) when the client changes the request in willSendRequest, and (4) in this
about:blank case. For (1) and (2), there are frame loader client callbacks. (3) is client-
initiated. So this patch addresses (4).

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::maybeLoadEmpty): If our request URL is changing to about:blank and
while loading the main resource, call FrameLoaderClient::dispatchDidChangeProvisionalURL.
* loader/FrameLoaderClient.h: Added dispatchDidChangeProvisionalURL with an empty
implementation.

Source/WebKit2:
WebKit2 part of &lt;rdar://problem/20878075&gt; Trying to navigate to an invalid URL loads about:blank, but -[WKWebView URL] returns the invalid URL

Reviewed by Alexey Proskuryakov.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didChangeProvisionalURLForFrame): Added. Update internal state the
same way we update it for server redirects, but don’t make client callbacks. Clients
observing the URL property will see it change.
* UIProcess/WebPageProxy.h:

* UIProcess/WebPageProxy.messages.in: Added DidChangeProvisionalURLForFrame.

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDidChangeProvisionalURL): Override this new
FrameLoaderClient function to send a DidChangeProvisionalURLForFrame message to the UI
process.
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:

Tools:
Test for &lt;rdar://problem/20878075&gt; Trying to navigate to an invalid URL loads about:blank, but -[WKWebView URL] returns the invalid URL

Reviewed by Alexey Proskuryakov.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2Cocoa/LoadAlternateHTMLString.mm: Fixed copyright header.
* TestWebKitAPI/Tests/WebKit2Cocoa/ProvisionalURLChange.mm: Added.
(-[ProvisionalURLChangeController webView:didFinishNavigation:]):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreloaderDocumentLoadercpp">trunk/Source/WebCore/loader/DocumentLoader.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderFrameLoaderClienth">trunk/Source/WebCore/loader/FrameLoaderClient.h</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxycpp">trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxyh">trunk/Source/WebKit2/UIProcess/WebPageProxy.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxymessagesin">trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebCoreSupportWebFrameLoaderClientcpp">trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebCoreSupportWebFrameLoaderClienth">trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.h</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="#trunkToolsTestWebKitAPITestsWebKit2CocoaLoadAlternateHTMLStringmm">trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/LoadAlternateHTMLString.mm</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkToolsTestWebKitAPITestsWebKit2CocoaProvisionalURLChangemm">trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/ProvisionalURLChange.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (184150 => 184151)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-05-12 04:01:50 UTC (rev 184150)
+++ trunk/Source/WebCore/ChangeLog        2015-05-12 05:38:11 UTC (rev 184151)
</span><span class="lines">@@ -1,3 +1,27 @@
</span><ins>+2015-05-11  Dan Bernstein  &lt;mitz@apple.com&gt;
+
+        WebCore part of &lt;rdar://problem/20878075&gt; Trying to navigate to an invalid URL loads about:blank, but -[WKWebView URL] returns the invalid URL
+
+        Reviewed by Alexey Proskuryakov.
+
+        Test: TestWebKitAPI/Tests/WebKit2Cocoa/ProvisionalURLChange.mm
+
+        In some cases, trying to navigate to an invalid URL results in navigation to about:blank.
+        When the about:blank load is committed, the UI process still thinks that the provisional
+        URL is the original, invalid URL, and updates its state to reflect that that’s the URL that
+        has been committed.
+
+        The provisional URL changes (1) when a provisional load begins, (2) when a server redirect
+        happens, (3) when the client changes the request in willSendRequest, and (4) in this
+        about:blank case. For (1) and (2), there are frame loader client callbacks. (3) is client-
+        initiated. So this patch addresses (4).
+
+        * loader/DocumentLoader.cpp:
+        (WebCore::DocumentLoader::maybeLoadEmpty): If our request URL is changing to about:blank and
+        while loading the main resource, call FrameLoaderClient::dispatchDidChangeProvisionalURL.
+        * loader/FrameLoaderClient.h: Added dispatchDidChangeProvisionalURL with an empty
+        implementation.
+
</ins><span class="cx"> 2015-05-11  Zalan Bujtas  &lt;zalan@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Text is misplaced when custom font does not have space glyph.
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderDocumentLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/DocumentLoader.cpp (184150 => 184151)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/DocumentLoader.cpp        2015-05-12 04:01:50 UTC (rev 184150)
+++ trunk/Source/WebCore/loader/DocumentLoader.cpp        2015-05-12 05:38:11 UTC (rev 184151)
</span><span class="lines">@@ -1354,8 +1354,12 @@
</span><span class="cx">     if (!shouldLoadEmpty &amp;&amp; !frameLoader()-&gt;client().representationExistsForURLScheme(m_request.url().protocol()))
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    if (m_request.url().isEmpty() &amp;&amp; !frameLoader()-&gt;stateMachine().creatingInitialEmptyDocument())
</del><ins>+    if (m_request.url().isEmpty() &amp;&amp; !frameLoader()-&gt;stateMachine().creatingInitialEmptyDocument()) {
</ins><span class="cx">         m_request.setURL(blankURL());
</span><ins>+        if (isLoadingMainResource())
+            frameLoader()-&gt;client().dispatchDidChangeProvisionalURL();
+    }
+
</ins><span class="cx">     String mimeType = shouldLoadEmpty ? &quot;text/html&quot; : frameLoader()-&gt;client().generatedMIMETypeForURLScheme(m_request.url().protocol());
</span><span class="cx">     m_response = ResourceResponse(m_request.url(), mimeType, 0, String());
</span><span class="cx">     finishedLoading(monotonicallyIncreasingTime());
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderFrameLoaderClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/FrameLoaderClient.h (184150 => 184151)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/FrameLoaderClient.h        2015-05-12 04:01:50 UTC (rev 184150)
+++ trunk/Source/WebCore/loader/FrameLoaderClient.h        2015-05-12 05:38:11 UTC (rev 184151)
</span><span class="lines">@@ -154,6 +154,7 @@
</span><span class="cx"> 
</span><span class="cx">         virtual void dispatchDidHandleOnloadEvents() = 0;
</span><span class="cx">         virtual void dispatchDidReceiveServerRedirectForProvisionalLoad() = 0;
</span><ins>+        virtual void dispatchDidChangeProvisionalURL() { }
</ins><span class="cx">         virtual void dispatchDidCancelClientRedirect() = 0;
</span><span class="cx">         virtual void dispatchWillPerformClientRedirect(const URL&amp;, double interval, double fireDate) = 0;
</span><span class="cx">         virtual void dispatchDidNavigateWithinPage() { }
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (184150 => 184151)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2015-05-12 04:01:50 UTC (rev 184150)
+++ trunk/Source/WebKit2/ChangeLog        2015-05-12 05:38:11 UTC (rev 184151)
</span><span class="lines">@@ -1,5 +1,25 @@
</span><span class="cx"> 2015-05-11  Dan Bernstein  &lt;mitz@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        WebKit2 part of &lt;rdar://problem/20878075&gt; Trying to navigate to an invalid URL loads about:blank, but -[WKWebView URL] returns the invalid URL
+
+        Reviewed by Alexey Proskuryakov.
+
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::didChangeProvisionalURLForFrame): Added. Update internal state the
+        same way we update it for server redirects, but don’t make client callbacks. Clients
+        observing the URL property will see it change.
+        * UIProcess/WebPageProxy.h:
+
+        * UIProcess/WebPageProxy.messages.in: Added DidChangeProvisionalURLForFrame.
+
+        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebKit::WebFrameLoaderClient::dispatchDidChangeProvisionalURL): Override this new
+        FrameLoaderClient function to send a DidChangeProvisionalURLForFrame message to the UI
+        process.
+        * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
+
+2015-05-11  Dan Bernstein  &lt;mitz@apple.com&gt;
+
</ins><span class="cx">         &lt;rdar://problem/19773721&gt; [iOS] Find on page feels like it zooms in too much
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=144891
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (184150 => 184151)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp        2015-05-12 04:01:50 UTC (rev 184150)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp        2015-05-12 05:38:11 UTC (rev 184151)
</span><span class="lines">@@ -2838,6 +2838,23 @@
</span><span class="cx">         m_loaderClient-&gt;didReceiveServerRedirectForProvisionalLoadForFrame(*this, *frame, navigation.get(), m_process-&gt;transformHandlesToObjects(userData.object()).get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebPageProxy::didChangeProvisionalURLForFrame(uint64_t frameID, uint64_t, const String&amp; url)
+{
+    WebFrameProxy* frame = m_process-&gt;webFrame(frameID);
+    MESSAGE_CHECK(frame);
+    MESSAGE_CHECK(frame-&gt;frameLoadState().state() == FrameLoadState::State::Provisional);
+    MESSAGE_CHECK_URL(url);
+
+    auto transaction = m_pageLoadState.transaction();
+
+    // Internally, we handle this the same way we handle a server redirect. There are no client callbacks
+    // for this, but if this is the main frame, clients may observe a change to the page's URL.
+    if (frame-&gt;isMainFrame())
+        m_pageLoadState.didReceiveServerRedirectForProvisionalLoad(transaction, url);
+
+    frame-&gt;didReceiveServerRedirectForProvisionalLoad(url);
+}
+
</ins><span class="cx"> void WebPageProxy::didFailProvisionalLoadForFrame(uint64_t frameID, uint64_t navigationID, const String&amp; provisionalURL, const ResourceError&amp; error, const UserData&amp; userData)
</span><span class="cx"> {
</span><span class="cx">     WebFrameProxy* frame = m_process-&gt;webFrame(frameID);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (184150 => 184151)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2015-05-12 04:01:50 UTC (rev 184150)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2015-05-12 05:38:11 UTC (rev 184151)
</span><span class="lines">@@ -1088,6 +1088,7 @@
</span><span class="cx"> 
</span><span class="cx">     void didStartProvisionalLoadForFrame(uint64_t frameID, uint64_t navigationID, const String&amp; url, const String&amp; unreachableURL, const UserData&amp;);
</span><span class="cx">     void didReceiveServerRedirectForProvisionalLoadForFrame(uint64_t frameID, uint64_t navigationID, const String&amp;, const UserData&amp;);
</span><ins>+    void didChangeProvisionalURLForFrame(uint64_t frameID, uint64_t navigationID, const String&amp; url);
</ins><span class="cx">     void didFailProvisionalLoadForFrame(uint64_t frameID, uint64_t navigationID, const String&amp; provisionalURL, const WebCore::ResourceError&amp;, const UserData&amp;);
</span><span class="cx">     void didCommitLoadForFrame(uint64_t frameID, uint64_t navigationID, const String&amp; mimeType, bool frameHasCustomContentProvider, uint32_t frameLoadType, const WebCore::CertificateInfo&amp;, const UserData&amp;);
</span><span class="cx">     void didFinishDocumentLoadForFrame(uint64_t frameID, uint64_t navigationID, const UserData&amp;);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxymessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in (184150 => 184151)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in        2015-05-12 04:01:50 UTC (rev 184150)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in        2015-05-12 05:38:11 UTC (rev 184151)
</span><span class="lines">@@ -129,6 +129,7 @@
</span><span class="cx">     # Frame load messages
</span><span class="cx">     DidStartProvisionalLoadForFrame(uint64_t frameID, uint64_t navigationID, String url, String unreachableURL, WebKit::UserData userData)
</span><span class="cx">     DidReceiveServerRedirectForProvisionalLoadForFrame(uint64_t frameID, uint64_t navigationID, String url, WebKit::UserData userData)
</span><ins>+    DidChangeProvisionalURLForFrame(uint64_t frameID, uint64_t navigationID, String url)
</ins><span class="cx">     DidFailProvisionalLoadForFrame(uint64_t frameID, uint64_t navigationID, String provisionalURL, WebCore::ResourceError error, WebKit::UserData userData)
</span><span class="cx">     DidCommitLoadForFrame(uint64_t frameID, uint64_t navigationID, String mimeType, bool hasCustomContentProvider, uint32_t loadType, WebCore::CertificateInfo certificateInfo, WebKit::UserData userData)
</span><span class="cx">     DidFailLoadForFrame(uint64_t frameID, uint64_t navigationID, WebCore::ResourceError error, WebKit::UserData userData)
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportWebFrameLoaderClientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp (184150 => 184151)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp        2015-05-12 04:01:50 UTC (rev 184150)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp        2015-05-12 05:38:11 UTC (rev 184151)
</span><span class="lines">@@ -294,6 +294,16 @@
</span><span class="cx">     webPage-&gt;send(Messages::WebPageProxy::DidReceiveServerRedirectForProvisionalLoadForFrame(m_frame-&gt;frameID(), documentLoader.navigationID(), url, UserData(WebProcess::singleton().transformObjectsToHandles(userData.get()).get())));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebFrameLoaderClient::dispatchDidChangeProvisionalURL()
+{
+    WebPage* webPage = m_frame-&gt;page();
+    if (!webPage)
+        return;
+
+    WebDocumentLoader&amp; documentLoader = static_cast&lt;WebDocumentLoader&amp;&gt;(*m_frame-&gt;coreFrame()-&gt;loader().provisionalDocumentLoader());
+    webPage-&gt;send(Messages::WebPageProxy::DidChangeProvisionalURLForFrame(m_frame-&gt;frameID(), documentLoader.navigationID(), documentLoader.url().string()));
+}
+
</ins><span class="cx"> void WebFrameLoaderClient::dispatchDidCancelClientRedirect()
</span><span class="cx"> {
</span><span class="cx">     WebPage* webPage = m_frame-&gt;page();
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportWebFrameLoaderClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.h (184150 => 184151)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.h        2015-05-12 04:01:50 UTC (rev 184150)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.h        2015-05-12 05:38:11 UTC (rev 184151)
</span><span class="lines">@@ -80,6 +80,7 @@
</span><span class="cx">     
</span><span class="cx">     virtual void dispatchDidHandleOnloadEvents() override;
</span><span class="cx">     virtual void dispatchDidReceiveServerRedirectForProvisionalLoad() override;
</span><ins>+    virtual void dispatchDidChangeProvisionalURL() override;
</ins><span class="cx">     virtual void dispatchDidCancelClientRedirect() override;
</span><span class="cx">     virtual void dispatchWillPerformClientRedirect(const WebCore::URL&amp;, double interval, double fireDate) override;
</span><span class="cx">     virtual void dispatchDidChangeLocationWithinPage() override;
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (184150 => 184151)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2015-05-12 04:01:50 UTC (rev 184150)
+++ trunk/Tools/ChangeLog        2015-05-12 05:38:11 UTC (rev 184151)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2015-05-11  Dan Bernstein  &lt;mitz@apple.com&gt;
+
+        Test for &lt;rdar://problem/20878075&gt; Trying to navigate to an invalid URL loads about:blank, but -[WKWebView URL] returns the invalid URL
+
+        Reviewed by Alexey Proskuryakov.
+
+        * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+        * TestWebKitAPI/Tests/WebKit2Cocoa/LoadAlternateHTMLString.mm: Fixed copyright header.
+        * TestWebKitAPI/Tests/WebKit2Cocoa/ProvisionalURLChange.mm: Added.
+        (-[ProvisionalURLChangeController webView:didFinishNavigation:]):
+
</ins><span class="cx"> 2015-05-11  Jake Nielsen  &lt;jacob_nielsen@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Fix internal build configuration issues
</span><span class="lines">@@ -812,6 +823,18 @@
</span><span class="cx"> 
</span><span class="cx">         * gtk/install-dependencies:
</span><span class="cx"> 
</span><ins>+2015-05-01  Dan Bernstein  &lt;mitz@apple.com&gt;
+
+        Test for &lt;rdar://problem/8636045&gt; Back/forward navigation to an error page in Safari breaks the back-forward list
+        https://bugs.webkit.org/show_bug.cgi?id=144501
+
+        Reviewed by Darin Adler.
+
+        * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+        * TestWebKitAPI/Tests/WebKit2Cocoa/LoadAlternateHTMLString.mm: Added.
+        (-[LoadAlternateHTMLStringFromProvisionalLoadErrorController webView:didFailProvisionalNavigation:withError:]):
+        (-[LoadAlternateHTMLStringFromProvisionalLoadErrorController webView:didFinishNavigation:]):
+
</ins><span class="cx"> 2015-05-01  Mario Sanchez Prada  &lt;mario@endlessm.com&gt;
</span><span class="cx"> 
</span><span class="cx">         check-webkit-style fails due to system pylint
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestWebKitAPIxcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj (184150 => 184151)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj        2015-05-12 04:01:50 UTC (rev 184150)
+++ trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj        2015-05-12 05:38:11 UTC (rev 184151)
</span><span class="lines">@@ -42,6 +42,7 @@
</span><span class="cx">                 378E64791632707400B6C676 /* link-with-title.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 378E647816326FDF00B6C676 /* link-with-title.html */; };
</span><span class="cx">                 379028B914FAC24C007E6B43 /* acceptsFirstMouse.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 379028B814FABE49007E6B43 /* acceptsFirstMouse.html */; };
</span><span class="cx">                 37D36ED71AF42ECD00BAF5D9 /* LoadAlternateHTMLString.mm in Sources */ = {isa = PBXBuildFile; fileRef = 37D36ED61AF42ECD00BAF5D9 /* LoadAlternateHTMLString.mm */; };
</span><ins>+                37D36F321B004DD400BAF5D9 /* ProvisionalURLChange.mm in Sources */ = {isa = PBXBuildFile; fileRef = 37D36F311B004DD400BAF5D9 /* ProvisionalURLChange.mm */; };
</ins><span class="cx">                 37DC6791140D7D7600ABCCDB /* DOMRangeOfString.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 37DC678F140D7D3A00ABCCDB /* DOMRangeOfString.html */; };
</span><span class="cx">                 37E1064C1697681800B78BD0 /* DOMHTMLTableCellElementCellAbove.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 37E1064B169767F700B78BD0 /* DOMHTMLTableCellElementCellAbove.html */; };
</span><span class="cx">                 4BFDFFA71314776C0061F24B /* HitTestResultNodeHandle_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BFDFFA61314776C0061F24B /* HitTestResultNodeHandle_Bundle.cpp */; };
</span><span class="lines">@@ -490,6 +491,7 @@
</span><span class="cx">                 37A6895D148A9B50005100FA /* SubresourceErrorCrash.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SubresourceErrorCrash.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 37C784DE197C8F2E0010A496 /* RenderedImageFromDOMNode.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RenderedImageFromDOMNode.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 37D36ED61AF42ECD00BAF5D9 /* LoadAlternateHTMLString.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = LoadAlternateHTMLString.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                37D36F311B004DD400BAF5D9 /* ProvisionalURLChange.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ProvisionalURLChange.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 37DC678B140D7C5000ABCCDB /* DOMRangeOfString.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMRangeOfString.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 37DC678F140D7D3A00ABCCDB /* DOMRangeOfString.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = DOMRangeOfString.html; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 37E1064A1697676400B78BD0 /* DOMHTMLTableCellCellAbove.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMHTMLTableCellCellAbove.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -829,12 +831,13 @@
</span><span class="cx">                                 7CEFA9641AC0B9E200B910FD /* _WKUserContentExtensionStore.mm */,
</span><span class="cx">                                 A1A4FE5D18DD3DB700B5EA8A /* Download.mm */,
</span><span class="cx">                                 2D1FE0AF1AD465C1006CD9E6 /* FixedLayoutSize.mm */,
</span><ins>+                                37D36ED61AF42ECD00BAF5D9 /* LoadAlternateHTMLString.mm */,
</ins><span class="cx">                                 1ABC3DED1899BE6D004F0626 /* Navigation.mm */,
</span><span class="cx">                                 CEA6CF2219CCF5BD0064F5A7 /* OpenAndCloseWindow.mm */,
</span><span class="cx">                                 C95501BE19AD2FAF0049BE3E /* Preferences.mm */,
</span><ins>+                                37D36F311B004DD400BAF5D9 /* ProvisionalURLChange.mm */,
</ins><span class="cx">                                 7CC3E1FA197E234100BE6252 /* UserContentController.mm */,
</span><span class="cx">                                 0F3B94A51A77266C00DE3272 /* WKWebViewEvaluateJavaScript.mm */,
</span><del>-                                37D36ED61AF42ECD00BAF5D9 /* LoadAlternateHTMLString.mm */,
</del><span class="cx">                         );
</span><span class="cx">                         name = &quot;WebKit2 Cocoa&quot;;
</span><span class="cx">                         path = WebKit2Cocoa;
</span><span class="lines">@@ -1425,6 +1428,7 @@
</span><span class="cx">                                 7CCE7EB91A411A7E00447C4C /* DeviceScaleFactorInDashboardRegions.mm in Sources */,
</span><span class="cx">                                 7CCE7EBA1A411A7E00447C4C /* DeviceScaleFactorOnBack.mm in Sources */,
</span><span class="cx">                                 7CCE7EE91A411AE600447C4C /* DidAssociateFormControls.cpp in Sources */,
</span><ins>+                                37D36F321B004DD400BAF5D9 /* ProvisionalURLChange.mm in Sources */,
</ins><span class="cx">                                 7CCE7EEA1A411AE600447C4C /* DidNotHandleKeyDown.cpp in Sources */,
</span><span class="cx">                                 7CCE7EEB1A411AE600447C4C /* DocumentStartUserScriptAlertCrash.cpp in Sources */,
</span><span class="cx">                                 7CCE7EBB1A411A7E00447C4C /* DOMHTMLTableCellCellAbove.mm in Sources */,
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKit2CocoaLoadAlternateHTMLStringmm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/LoadAlternateHTMLString.mm (184150 => 184151)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/LoadAlternateHTMLString.mm        2015-05-12 04:01:50 UTC (rev 184150)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/LoadAlternateHTMLString.mm        2015-05-12 05:38:11 UTC (rev 184151)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2014 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2015 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKit2CocoaProvisionalURLChangemm"></a>
<div class="addfile"><h4>Added: trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/ProvisionalURLChange.mm (0 => 184151)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/ProvisionalURLChange.mm                                (rev 0)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/ProvisionalURLChange.mm        2015-05-12 05:38:11 UTC (rev 184151)
</span><span class="lines">@@ -0,0 +1,66 @@
</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.
+ */
+
+#import &quot;config.h&quot;
+#import &lt;WebKit/WKFoundation.h&gt;
+
+#if WK_API_ENABLED
+
+#import &quot;PlatformUtilities.h&quot;
+#import &quot;Test.h&quot;
+#import &lt;wtf/RetainPtr.h&gt;
+
+static bool isDone;
+
+@interface ProvisionalURLChangeController : NSObject &lt;WKNavigationDelegate&gt;
+@end
+
+@implementation ProvisionalURLChangeController
+
+- (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation
+{
+    isDone = true;
+}
+
+@end
+
+TEST(WKWebView, ProvisionalURLChange)
+{
+    auto webView = adoptNS([[WKWebView alloc] init]);
+    auto controller = adoptNS([[ProvisionalURLChangeController alloc] init]);
+    [webView setNavigationDelegate:controller.get()];
+
+    [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@&quot;data:text/html,start&quot;]]];
+    TestWebKitAPI::Util::run(&amp;isDone);
+    isDone = false;
+
+    [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@&quot;http://www.webkit.org!&quot;]]];
+    TestWebKitAPI::Util::run(&amp;isDone);
+    isDone = false;
+
+    EXPECT_STREQ([webView URL].absoluteString.UTF8String, &quot;about:blank&quot;);
+}
+
+#endif
</ins></span></pre>
</div>
</div>

</body>
</html>