Title: [116124] trunk/Source/WebKit/mac
Revision
116124
Author
beid...@apple.com
Date
2012-05-04 10:44:57 -0700 (Fri, 04 May 2012)

Log Message

<rdar://problem/11312853> and https://bugs.webkit.org/show_bug.cgi?id=85635 Exception in [WebFrame loadRequest:] breaks some WebKit apps

Reviewed by Alexey Proskuryakov.

Some API clients pass in nil requests or requests with nil URLs.
In r112571 we started rewriting these URLs resulting in an exception.
Since we've supported nil requests until now, we should not try to rewrite these URLs.

* WebView/WebFrame.mm:
(-[WebFrame loadRequest:]): Don't try to rewrite invalid URLs if they are also null.

Modified Paths

Diff

Modified: trunk/Source/WebKit/mac/ChangeLog (116123 => 116124)


--- trunk/Source/WebKit/mac/ChangeLog	2012-05-04 17:44:08 UTC (rev 116123)
+++ trunk/Source/WebKit/mac/ChangeLog	2012-05-04 17:44:57 UTC (rev 116124)
@@ -1,3 +1,17 @@
+2012-05-04  Brady Eidson  <beid...@apple.com>
+
+        <rdar://problem/11312853> and https://bugs.webkit.org/show_bug.cgi?id=85635 
+        Exception in [WebFrame loadRequest:] breaks some WebKit apps
+
+        Reviewed by Alexey Proskuryakov.
+
+        Some API clients pass in nil requests or requests with nil URLs.
+        In r112571 we started rewriting these URLs resulting in an exception.
+        Since we've supported nil requests until now, we should not try to rewrite these URLs.
+
+        * WebView/WebFrame.mm:
+        (-[WebFrame loadRequest:]): Don't try to rewrite invalid URLs if they are also null.
+
 2012-05-04  Nate Chapin  <jap...@chromium.org>
 
         Don't require FrameLoaderClient to manufacture a commitData() call for empty documents.

Modified: trunk/Source/WebKit/mac/WebView/WebFrame.mm (116123 => 116124)


--- trunk/Source/WebKit/mac/WebView/WebFrame.mm	2012-05-04 17:44:08 UTC (rev 116123)
+++ trunk/Source/WebKit/mac/WebView/WebFrame.mm	2012-05-04 17:44:57 UTC (rev 116124)
@@ -1395,9 +1395,13 @@
         return;
 
     ResourceRequest resourceRequest(request);
-    // Modifying the original request here breaks -[WebDataSource initialRequest], but we don't want
-    // to implement this "path as URL" quirk anywhere except for API boundary.
-    if (!resourceRequest.url().isValid())
+    
+    // Some users of WebKit API incorrectly use "file path as URL" style requests which are invalid.
+    // By re-writing those URLs here we technically break the -[WebDataSource initialRequest] API
+    // but that is necessary to implement this quirk only at the API boundary.
+    // Note that other users of WebKit API use nil requests or requests with nil URLs, so we
+    // only implement this workaround when the request had a non-nil URL.
+    if (!resourceRequest.url().isValid() && [request URL])
         resourceRequest.setURL([NSURL fileURLWithPath:[[request URL] absoluteString]]);
 
     coreFrame->loader()->load(resourceRequest, false);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to