⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 243698 in webkit


Ignore:
Timestamp:
Apr 1, 2019, 11:21:01 AM (7 years ago)
Author:
commit-queue@webkit.org
Message:

Add SPI to canonicalize NSURLs with WTF::URL
https://bugs.webkit.org/show_bug.cgi?id=196415
<rdar://problem/44980271>

Patch by Alex Christensen <achristensen@webkit.org> on 2019-04-01
Reviewed by Darin Adler.

Source/WebKitLegacy/mac:

  • Misc/WebNSURLExtras.h:
  • Misc/WebNSURLExtras.mm:

(-[NSURL _webkit_canonicalize_with_wtf]):
_webkit_canonicalize is old and changing it causes strange bugs like rdar://problem/5315926
Instead, make a new version that uses WTF::URL to canonicalize an NSURL.

Tools:

  • TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
  • TestWebKitAPI/Tests/WebKitLegacy/mac/URLCanonicalization.mm: Added.

(TestWebKitAPI::TEST):

Location:
trunk
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKitLegacy/mac/ChangeLog

    r243683 r243698  
     12019-04-01  Alex Christensen  <achristensen@webkit.org>
     2
     3        Add SPI to canonicalize NSURLs with WTF::URL
     4        https://bugs.webkit.org/show_bug.cgi?id=196415
     5        <rdar://problem/44980271>
     6
     7        Reviewed by Darin Adler.
     8
     9        * Misc/WebNSURLExtras.h:
     10        * Misc/WebNSURLExtras.mm:
     11        (-[NSURL _webkit_canonicalize_with_wtf]):
     12        _webkit_canonicalize is old and changing it causes strange bugs like rdar://problem/5315926
     13        Instead, make a new version that uses WTF::URL to canonicalize an NSURL.
     14
    1152019-03-31  Sam Weinig  <weinig@apple.com>
    216
  • trunk/Source/WebKitLegacy/mac/Misc/WebNSURLExtras.h

    r222239 r243698  
    6161
    6262- (NSURL *)_webkit_canonicalize;
     63- (NSURL *)_webkit_canonicalize_with_wtf;
    6364- (NSURL *)_webkit_URLByRemovingFragment;
    6465- (NSURL *)_web_URLByRemovingUserInfo;
  • trunk/Source/WebKitLegacy/mac/Misc/WebNSURLExtras.mm

    r238771 r243698  
    134134}
    135135
     136- (NSURL *)_webkit_canonicalize_with_wtf
     137{
     138    auto url = WTF::URL(self);
     139    return url.isValid() ? (NSURL *)url : nil;
     140}
     141
    136142- (NSURL *)_webkit_URLByRemovingFragment
    137143{
  • trunk/Tools/ChangeLog

    r243689 r243698  
     12019-04-01  Alex Christensen  <achristensen@webkit.org>
     2
     3        Add SPI to canonicalize NSURLs with WTF::URL
     4        https://bugs.webkit.org/show_bug.cgi?id=196415
     5        <rdar://problem/44980271>
     6
     7        Reviewed by Darin Adler.
     8
     9        * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
     10        * TestWebKitAPI/Tests/WebKitLegacy/mac/URLCanonicalization.mm: Added.
     11        (TestWebKitAPI::TEST):
     12
    1132019-04-01  Zan Dobersek  <zdobersek@igalia.com>
    214
  • trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj

    r243682 r243698  
    313313                5C4A84951F7EEFFC00ACFC54 /* Configuration.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5C4A84941F7EEFD400ACFC54 /* Configuration.mm */; };
    314314                5C69BDD51F82A7EF000F4F4B /* JavaScriptDuringNavigation.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5C69BDD41F82A7EB000F4F4B /* JavaScriptDuringNavigation.mm */; };
     315                5C6E27A7224EEBEA00128736 /* URLCanonicalization.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5C6E27A6224EEBEA00128736 /* URLCanonicalization.mm */; };
    315316                5C7148952123A40A00FDE3C5 /* WKWebsiteDatastore.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5C7148942123A40700FDE3C5 /* WKWebsiteDatastore.mm */; };
    316317                5C75716122124C5200B9E5AC /* BundleRetainPagePlugIn.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5C75715F221249BD00B9E5AC /* BundleRetainPagePlugIn.mm */; };
     
    17191720                5C5E633D1D0B67940085A025 /* UniqueRef.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UniqueRef.cpp; sourceTree = "<group>"; };
    17201721                5C69BDD41F82A7EB000F4F4B /* JavaScriptDuringNavigation.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = JavaScriptDuringNavigation.mm; sourceTree = "<group>"; };
     1722                5C6E27A6224EEBEA00128736 /* URLCanonicalization.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = URLCanonicalization.mm; sourceTree = "<group>"; };
    17211723                5C7148942123A40700FDE3C5 /* WKWebsiteDatastore.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKWebsiteDatastore.mm; sourceTree = "<group>"; };
    17221724                5C75715F221249BD00B9E5AC /* BundleRetainPagePlugIn.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = BundleRetainPagePlugIn.mm; sourceTree = "<group>"; };
     
    28512853                                9BD5111B1FE8E11600D2B630 /* AccessingPastedImage.mm */,
    28522854                                6B306105218A372900F5A802 /* ClosingWebView.mm */,
     2855                                5C6E27A6224EEBEA00128736 /* URLCanonicalization.mm */,
    28532856                        );
    28542857                        path = mac;
     
    43414344                                5CB40B4E1F4B98D3007DC7B9 /* UIDelegate.mm in Sources */,
    43424345                                F46849BE1EEF58E400B937FE /* UIPasteboardTests.mm in Sources */,
     4346                                5C6E27A7224EEBEA00128736 /* URLCanonicalization.mm in Sources */,
    43434347                                E3A1E77F21B25B39008C6007 /* URLParserTextEncoding.cpp in Sources */,
    43444348                                7CCE7F271A411AF600447C4C /* UserContentController.mm in Sources */,
Note: See TracChangeset for help on using the changeset viewer.