REGRESSION (r182648): UIWebView does not set location.hash synchronously
authorap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 22 Sep 2015 00:21:22 +0000 (00:21 +0000)
committerap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 22 Sep 2015 00:21:22 +0000 (00:21 +0000)
https://bugs.webkit.org/show_bug.cgi?id=149415
<rdar://problem/22169467>

Reviewed by Darin Adler.

The problem was that the delegate in UI thread became asynchronous due to calling
into LaunchServices.

* WebCoreSupport/WebFrameLoaderClient.mm: (shouldTryAppLink): Don't attempt app
links for same domain navigations. This check is part of substantially more complicated
logic in WebKit2 that I don't understand, but that should be enough to demonstrate
that this fix is an improvement at least.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@190092 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm

index 2bd18be..0282e5a 100644 (file)
@@ -1,3 +1,19 @@
+2015-09-21  Alexey Proskuryakov  <ap@apple.com>
+
+        REGRESSION (r182648): UIWebView does not set location.hash synchronously
+        https://bugs.webkit.org/show_bug.cgi?id=149415
+        <rdar://problem/22169467>
+
+        Reviewed by Darin Adler.
+
+        The problem was that the delegate in UI thread became asynchronous due to calling
+        into LaunchServices.
+
+        * WebCoreSupport/WebFrameLoaderClient.mm: (shouldTryAppLink): Don't attempt app
+        links for same domain navigations. This check is part of substantially more complicated
+        logic in WebKit2 that I don't understand, but that should be enough to demonstrate
+        that this fix is an improvement at least.
+
 2015-09-20  Youenn Fablet  <youenn.fablet@crf.canon.fr>
 
         Remove XHR_TIMEOUT compilation guard
index fa6b90d..6979c95 100644 (file)
@@ -886,6 +886,9 @@ static BOOL shouldTryAppLink(WebView *webView, const NavigationAction& action, F
     if (!action.processingUserGesture())
         return NO;
 
+    if (targetFrame && targetFrame->document() && protocolHostAndPortAreEqual(targetFrame->document()->url(), action.url()))
+        return NO;
+
     return YES;
 #else
     return NO;