Title: [119339] trunk/Source/WebKit/mac
Revision
119339
Author
[email protected]
Date
2012-06-02 14:30:01 -0700 (Sat, 02 Jun 2012)

Log Message

loadRequest should check for empty URLs.
https://bugs.webkit.org/show_bug.cgi?id=88154

In [WebFrame loadRequest], if the url is invalid and not nil, we transform it to file: url.
However, WebKit client could send down an empty URL that makes us transform it to file: url
as well.  We should skip that as we did for nil URLs.

Patch by Yongjun Zhang <[email protected]> on 2012-06-02
Reviewed by Brady Eidson.

* WebView/WebFrame.mm:
(-[WebFrame loadRequest:]):

Modified Paths

Diff

Modified: trunk/Source/WebKit/mac/ChangeLog (119338 => 119339)


--- trunk/Source/WebKit/mac/ChangeLog	2012-06-02 20:32:02 UTC (rev 119338)
+++ trunk/Source/WebKit/mac/ChangeLog	2012-06-02 21:30:01 UTC (rev 119339)
@@ -1,3 +1,17 @@
+2012-06-02  Yongjun Zhang  <[email protected]>
+
+        loadRequest should check for empty URLs.
+        https://bugs.webkit.org/show_bug.cgi?id=88154
+
+        In [WebFrame loadRequest], if the url is invalid and not nil, we transform it to file: url.
+        However, WebKit client could send down an empty URL that makes us transform it to file: url
+        as well.  We should skip that as we did for nil URLs.
+
+        Reviewed by Brady Eidson.
+
+        * WebView/WebFrame.mm:
+        (-[WebFrame loadRequest:]):
+
 2012-06-01  Michael Saboff  <[email protected]>
 
         WebFrame::_stringByEvaluatingJavaScriptFromString methods don't handle nil string

Modified: trunk/Source/WebKit/mac/WebView/WebFrame.mm (119338 => 119339)


--- trunk/Source/WebKit/mac/WebView/WebFrame.mm	2012-06-02 20:32:02 UTC (rev 119338)
+++ trunk/Source/WebKit/mac/WebView/WebFrame.mm	2012-06-02 21:30:01 UTC (rev 119339)
@@ -1375,9 +1375,9 @@
     // 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])
+    // Note that other users of WebKit API use nil requests or requests with nil URLs or empty URLs, so we
+    // only implement this workaround when the request had a non-nil or non-empty URL.
+    if (!resourceRequest.url().isValid() && !resourceRequest.url().isEmpty())
         resourceRequest.setURL([NSURL URLWithString:[@"file:" stringByAppendingString:[[request URL] absoluteString]]]);
 
     coreFrame->loader()->load(resourceRequest, false);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to