Title: [232315] trunk/Source/WebCore
Revision
232315
Author
[email protected]
Date
2018-05-30 16:23:00 -0700 (Wed, 30 May 2018)

Log Message

Revert changes made to URLWithUserTypedString made in https://trac.webkit.org/changeset/232281
https://bugs.webkit.org/show_bug.cgi?id=186108
<rdar://problem/40663065>

Reviewed by Alex Christensen.

Covered by existing API tests.

* platform/mac/WebCoreNSURLExtras.mm:
(WebCore::URLWithUserTypedString):
Return early if WebCore::URL is not able to create a CFURL.
Use CFURL otherwise to keep the existing behavior as much as possible.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (232314 => 232315)


--- trunk/Source/WebCore/ChangeLog	2018-05-30 23:19:51 UTC (rev 232314)
+++ trunk/Source/WebCore/ChangeLog	2018-05-30 23:23:00 UTC (rev 232315)
@@ -1,5 +1,20 @@
 2018-05-30  Youenn Fablet  <[email protected]>
 
+        Revert changes made to URLWithUserTypedString made in https://trac.webkit.org/changeset/232281
+        https://bugs.webkit.org/show_bug.cgi?id=186108
+        <rdar://problem/40663065>
+
+        Reviewed by Alex Christensen.
+
+        Covered by existing API tests.
+
+        * platform/mac/WebCoreNSURLExtras.mm:
+        (WebCore::URLWithUserTypedString):
+        Return early if WebCore::URL is not able to create a CFURL.
+        Use CFURL otherwise to keep the existing behavior as much as possible.
+
+2018-05-30  Youenn Fablet  <[email protected]>
+
         Rename FromOrigin runtime flag to CrossOriginResourcePolicy and enable it by default
         https://bugs.webkit.org/show_bug.cgi?id=186082
 

Modified: trunk/Source/WebCore/platform/mac/WebCoreNSURLExtras.mm (232314 => 232315)


--- trunk/Source/WebCore/platform/mac/WebCoreNSURLExtras.mm	2018-05-30 23:19:51 UTC (rev 232314)
+++ trunk/Source/WebCore/platform/mac/WebCoreNSURLExtras.mm	2018-05-30 23:23:00 UTC (rev 232315)
@@ -895,8 +895,18 @@
     if (!string)
         return nil;
 
+    // Let's check whether the URL is bogus.
     URL url { URL { nsURL }, string };
-    return (__bridge NSURL*) url.createCFURL().autorelease();
+    if (!url.createCFURL())
+        return nil;
+
+    // FIXME: https://bugs.webkit.org/show_bug.cgi?id=186057
+    // We should be able to use url.createCFURL instead of using directly CFURL parsing routines.
+    NSData *data = ""
+    if (!data)
+        return [NSURL URLWithString:@""];
+
+    return URLWithData(data, nsURL);
 }
 
 NSURL *URLWithUserTypedStringDeprecated(NSString *string, NSURL *URL)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to