Changeset 211354 in webkit
- Timestamp:
- Jan 29, 2017, 4:26:36 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 5 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r211350 r211354 1 2017-01-29 Dan Bernstein <mitz@apple.com> 2 3 [iOS] Expose WebCore::DataDetection::detectContentInRange WKWebProcessPlugInRangeHandle 4 https://bugs.webkit.org/show_bug.cgi?id=167565 5 6 Reviewed by Sam Weinig. 7 8 Test: TestWebKitAPI/Tests/WebKit2Cocoa/BundleRangeHandle.mm 9 10 * Shared/API/Cocoa/WKDataDetectorTypes.h: Added. Moved the enum definition from 11 WKWebViewConfiguration.h to here. 12 * Shared/API/Cocoa/WKDataDetectorTypesInternal.h: Added. 13 (fromWKDataDetectorTypes): Moved from WKWebView.mm. 14 15 * UIProcess/API/Cocoa/WKWebView.mm: 16 (fromWKDataDetectorTypes): Moved to WKDataDetectorTypesInternal.h. 17 18 * UIProcess/API/Cocoa/WKWebViewConfiguration.h: Moved WKDataDetectorTypes definition out 19 to WKDataDetectorTypes.h. 20 21 * WebKit2.xcodeproj/project.pbxproj: Added references to new files. 22 23 * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandle.h: 24 * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandle.mm: 25 (-[WKWebProcessPlugInRangeHandle detectDataWithTypes:context:]): Added. Calls 26 DataDetection::detectContentInRange. 27 1 28 2017-01-29 Carlos Garcia Campos <cgarcia@igalia.com> 2 29 -
trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm
r211221 r211354 51 51 #import "WKBackForwardListItemInternal.h" 52 52 #import "WKBrowsingContextHandleInternal.h" 53 #import "WKDataDetectorTypesInternal.h" 53 54 #import "WKErrorInternal.h" 54 55 #import "WKHistoryDelegatePrivate.h" … … 352 353 #endif 353 354 } 354 355 #if ENABLE(DATA_DETECTION) && PLATFORM(IOS)356 static WebCore::DataDetectorTypes fromWKDataDetectorTypes(uint64_t types)357 {358 if (static_cast<WKDataDetectorTypes>(types) == WKDataDetectorTypeNone)359 return WebCore::DataDetectorTypeNone;360 if (static_cast<WKDataDetectorTypes>(types) == WKDataDetectorTypeAll)361 return WebCore::DataDetectorTypeAll;362 363 uint32_t value = WebCore::DataDetectorTypeNone;364 if (types & WKDataDetectorTypePhoneNumber)365 value |= WebCore::DataDetectorTypePhoneNumber;366 if (types & WKDataDetectorTypeLink)367 value |= WebCore::DataDetectorTypeLink;368 if (types & WKDataDetectorTypeAddress)369 value |= WebCore::DataDetectorTypeAddress;370 if (types & WKDataDetectorTypeCalendarEvent)371 value |= WebCore::DataDetectorTypeCalendarEvent;372 if (types & WKDataDetectorTypeTrackingNumber)373 value |= WebCore::DataDetectorTypeTrackingNumber;374 if (types & WKDataDetectorTypeFlightNumber)375 value |= WebCore::DataDetectorTypeFlightNumber;376 if (types & WKDataDetectorTypeLookupSuggestion)377 value |= WebCore::DataDetectorTypeLookupSuggestion;378 379 return static_cast<WebCore::DataDetectorTypes>(value);380 }381 #endif382 355 383 356 #if PLATFORM(MAC) -
trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.h
r205559 r211354 29 29 30 30 #import <Foundation/Foundation.h> 31 #import <WebKit/WKDataDetectorTypes.h> 31 32 32 33 NS_ASSUME_NONNULL_BEGIN … … 51 52 WKSelectionGranularityCharacter, 52 53 } WK_API_AVAILABLE(ios(8.0)); 53 54 /*! @enum WKDataDetectorTypes55 @abstract The type of data detected.56 @constant WKDataDetectorTypeNone No detection is performed.57 @constant WKDataDetectorTypePhoneNumber Phone numbers are detected and turned into links.58 @constant WKDataDetectorTypeLink URLs in text are detected and turned into links.59 @constant WKDataDetectorTypeAddress Addresses are detected and turned into links.60 @constant WKDataDetectorTypeCalendarEvent Dates and times that are in the future are detected and turned into links.61 @constant WKDataDetectorTypeAll All of the above data types are turned into links when detected. Choosing this value will62 automatically include any new detection type that is added.63 */64 typedef NS_OPTIONS(NSUInteger, WKDataDetectorTypes) {65 WKDataDetectorTypeNone = 0,66 WKDataDetectorTypePhoneNumber = 1 << 0,67 WKDataDetectorTypeLink = 1 << 1,68 WKDataDetectorTypeAddress = 1 << 2,69 WKDataDetectorTypeCalendarEvent = 1 << 3,70 WKDataDetectorTypeTrackingNumber = 1 << 4,71 WKDataDetectorTypeFlightNumber = 1 << 5,72 WKDataDetectorTypeLookupSuggestion = 1 << 6,73 WKDataDetectorTypeAll = NSUIntegerMax,74 75 WKDataDetectorTypeSpotlightSuggestion WK_API_DEPRECATED_WITH_REPLACEMENT("WKDataDetectorTypeLookupSuggestion", ios(10.0, 10.0)) = WKDataDetectorTypeLookupSuggestion,76 } WK_API_AVAILABLE(ios(10.0));77 54 78 55 #else -
trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
r210943 r211354 841 841 37A64E5518F38E3C00EB30F1 /* _WKInputDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 37A64E5418F38E3C00EB30F1 /* _WKInputDelegate.h */; settings = {ATTRIBUTES = (Private, ); }; }; 842 842 37A64E5718F38F4600EB30F1 /* _WKFormInputSession.h in Headers */ = {isa = PBXBuildFile; fileRef = 37A64E5618F38F4600EB30F1 /* _WKFormInputSession.h */; settings = {ATTRIBUTES = (Private, ); }; }; 843 37A709A71E3EA0FD00CA5969 /* WKDataDetectorTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 37A709A61E3EA0FD00CA5969 /* WKDataDetectorTypes.h */; settings = {ATTRIBUTES = (Public, ); }; }; 844 37A709A91E3EA40C00CA5969 /* WKDataDetectorTypesInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 37A709A81E3EA40C00CA5969 /* WKDataDetectorTypesInternal.h */; }; 843 845 37B0D1841C1E499A00D40D64 /* PluginProcessShim.dylib in Copy Shims */ = {isa = PBXBuildFile; fileRef = 1AC25FB012A48EA700BD2671 /* PluginProcessShim.dylib */; }; 844 846 37B0D1851C1E499A00D40D64 /* SecItemShim.dylib in Copy Shims */ = {isa = PBXBuildFile; fileRef = 510031F61379CACB00C8DFE4 /* SecItemShim.dylib */; }; … … 2951 2953 37A64E5418F38E3C00EB30F1 /* _WKInputDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _WKInputDelegate.h; sourceTree = "<group>"; }; 2952 2954 37A64E5618F38F4600EB30F1 /* _WKFormInputSession.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _WKFormInputSession.h; sourceTree = "<group>"; }; 2955 37A709A61E3EA0FD00CA5969 /* WKDataDetectorTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKDataDetectorTypes.h; sourceTree = "<group>"; }; 2956 37A709A81E3EA40C00CA5969 /* WKDataDetectorTypesInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKDataDetectorTypesInternal.h; sourceTree = "<group>"; }; 2953 2957 37B418EB1C9624F20031E63B /* WebContent-OSX.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "WebContent-OSX.entitlements"; sourceTree = "<group>"; }; 2954 2958 37B47E2C1D64DB76005F4EFF /* objcSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = objcSPI.h; sourceTree = "<group>"; }; … … 5514 5518 1AE00D4E182D6F5000087DD7 /* WKBrowsingContextHandleInternal.h */, 5515 5519 373D122418A473B30066D9CC /* WKBrowsingContextHandleInternal.h */, 5520 37A709A61E3EA0FD00CA5969 /* WKDataDetectorTypes.h */, 5521 37A709A81E3EA40C00CA5969 /* WKDataDetectorTypesInternal.h */, 5516 5522 37DFA6FF1810BB92001F4A9F /* WKFoundation.h */, 5517 5523 1A9E32991822E1CC00F5D04C /* WKRemoteObject.h */, … … 7663 7669 files = ( 7664 7670 1A85E4721E303F3700914599 /* WebKit.apinotes in Headers */, 7671 1A6280C51919949F006AD9F9 /* WebKit.h in Headers */, 7672 37C4C08D1814AC5C003688B9 /* WKBackForwardList.h in Headers */, 7673 37C4C08718149C5B003688B9 /* WKBackForwardListItem.h in Headers */, 7665 7674 37A5E01418BBF93F000A081E /* _WKActivatedElementInfo.h in Headers */, 7666 7675 379A873618BBFA4300588AF2 /* _WKActivatedElementInfoInternal.h in Headers */, 7676 37A709A71E3EA0FD00CA5969 /* WKDataDetectorTypes.h in Headers */, 7667 7677 99E714C51C124A0400665B3A /* _WKAutomationDelegate.h in Headers */, 7668 7678 990D28AB1C6420C600986977 /* _WKAutomationSession.h in Headers */, … … 8207 8217 A55BA82B1BA38E61007CD33D /* WebInspectorUtilities.h in Headers */, 8208 8218 2DA944A01884E4F000ED86DB /* WebIOSEventFactory.h in Headers */, 8209 1A6280C51919949F006AD9F9 /* WebKit.h in Headers */,8210 8219 BCB63478116BF10600603215 /* WebKit2_C.h in Headers */, 8211 8220 BC9BA5051697C45300E44616 /* WebKit2Initialize.h in Headers */, … … 8255 8264 BC5750971268F3C6006F0F12 /* WebPopupMenuProxyMac.h in Headers */, 8256 8265 BCD597FF112B57BE00EC8C23 /* WebPreferences.h in Headers */, 8266 37A709A91E3EA40C00CA5969 /* WKDataDetectorTypesInternal.h in Headers */, 8257 8267 7C85FD7C193415A8000177C4 /* WebPreferencesDefinitions.h in Headers */, 8258 8268 7C85FD8019341665000177C4 /* WebPreferencesKeys.h in Headers */, … … 8309 8319 512F58F612A88A5400629530 /* WKAuthenticationChallenge.h in Headers */, 8310 8320 512F58F812A88A5400629530 /* WKAuthenticationDecisionListener.h in Headers */, 8311 37C4C08D1814AC5C003688B9 /* WKBackForwardList.h in Headers */,8312 8321 37C4C0951814B9E6003688B9 /* WKBackForwardListInternal.h in Headers */, 8313 37C4C08718149C5B003688B9 /* WKBackForwardListItem.h in Headers */,8314 8322 37C4C08918149F23003688B9 /* WKBackForwardListItemInternal.h in Headers */, 8315 8323 2DFF7B6F1DA4CFAF00814614 /* WKBackForwardListItemPrivate.h in Headers */, -
trunk/Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandle.h
r211321 r211354 30 30 #import <Foundation/Foundation.h> 31 31 #import <JavaScriptCore/JavaScriptCore.h> 32 #import <WebKit/WKDataDetectorTypes.h> 32 33 33 34 @class WKWebProcessPlugInFrame; … … 41 42 @property (nonatomic, readonly, copy) NSString *text WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA)); 42 43 44 #if TARGET_OS_IPHONE 45 - (NSArray *)detectDataWithTypes:(WKDataDetectorTypes)types context:(NSDictionary *)context WK_API_AVAILABLE(ios(WK_IOS_TBA)); 46 #endif 47 43 48 @end 44 49 -
trunk/Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandle.mm
r211321 r211354 30 30 31 31 #import "InjectedBundleNodeHandle.h" 32 #import "WKDataDetectorTypesInternal.h" 32 33 #import "WKWebProcessPlugInFrameInternal.h" 34 #import <WebCore/DataDetection.h> 35 #import <WebCore/Range.h> 33 36 34 37 using namespace WebKit; … … 65 68 } 66 69 70 #if TARGET_OS_IPHONE 71 - (NSArray *)detectDataWithTypes:(WKDataDetectorTypes)types context:(NSDictionary *)context WK_API_AVAILABLE(ios(WK_IOS_TBA)) 72 { 73 RefPtr<WebCore::Range> coreRange = _rangeHandle->coreRange(); 74 return WebCore::DataDetection::detectContentInRange(coreRange, fromWKDataDetectorTypes(types), context); 75 } 76 #endif 77 67 78 - (InjectedBundleRangeHandle&)_rangeHandle 68 79 { -
trunk/Tools/ChangeLog
r211341 r211354 1 2017-01-29 Dan Bernstein <mitz@apple.com> 2 3 [iOS] Expose WebCore::DataDetection::detectContentInRange WKWebProcessPlugInRangeHandle 4 https://bugs.webkit.org/show_bug.cgi?id=167565 5 6 Reviewed by Sam Weinig. 7 8 * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: 9 * TestWebKitAPI/Tests/WebKit2Cocoa/BundleRangeHandle.mm: Added. 10 (-[BundleRangeHandleRemoteObject textFromBodyRange:]): 11 (-[BundleRangeHandleRemoteObject bodyInnerHTMLAfterDetectingData:]): 12 (TEST): 13 * TestWebKitAPI/Tests/WebKit2Cocoa/BundleRangeHandlePlugIn.mm: Added. 14 (-[BundleRangeHandlePlugIn webProcessPlugIn:didCreateBrowserContextController:]): 15 (-[BundleRangeHandlePlugIn webProcessPlugInBrowserContextController:didFinishDocumentLoadForFrame:]): 16 * TestWebKitAPI/Tests/WebKit2Cocoa/BundleRangeHandleProtocol.h: Added. 17 1 18 2017-01-28 Yoav Weiss <yoav@yoav.ws> 2 19 -
trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
r211322 r211354 103 103 379028B914FAC24C007E6B43 /* acceptsFirstMouse.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 379028B814FABE49007E6B43 /* acceptsFirstMouse.html */; }; 104 104 37A22AA71DCAA27200AFBFC4 /* ObservedRenderingProgressEventsAfterCrash.mm in Sources */ = {isa = PBXBuildFile; fileRef = 37A22AA51DCAA27200AFBFC4 /* ObservedRenderingProgressEventsAfterCrash.mm */; }; 105 37A709AE1E3EA8B000CA5969 /* BundleRangeHandle.mm in Sources */ = {isa = PBXBuildFile; fileRef = 37A709AD1E3EA8B000CA5969 /* BundleRangeHandle.mm */; }; 106 37A709AF1E3EA97E00CA5969 /* BundleRangeHandlePlugIn.mm in Sources */ = {isa = PBXBuildFile; fileRef = 37A709AA1E3EA79000CA5969 /* BundleRangeHandlePlugIn.mm */; }; 105 107 37B47E301D64E7CA005F4EFF /* WKObject.mm in Sources */ = {isa = PBXBuildFile; fileRef = 37B47E2E1D64E7CA005F4EFF /* WKObject.mm */; }; 106 108 37BCA61C1B596BA9002012CA /* ShouldOpenExternalURLsInNewWindowActions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 37BCA61B1B596BA9002012CA /* ShouldOpenExternalURLsInNewWindowActions.mm */; }; … … 925 927 37A22AA51DCAA27200AFBFC4 /* ObservedRenderingProgressEventsAfterCrash.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ObservedRenderingProgressEventsAfterCrash.mm; sourceTree = "<group>"; }; 926 928 37A6895D148A9B50005100FA /* SubresourceErrorCrash.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SubresourceErrorCrash.mm; sourceTree = "<group>"; }; 929 37A709AA1E3EA79000CA5969 /* BundleRangeHandlePlugIn.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = BundleRangeHandlePlugIn.mm; sourceTree = "<group>"; }; 930 37A709AC1E3EA7E800CA5969 /* BundleRangeHandleProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BundleRangeHandleProtocol.h; sourceTree = "<group>"; }; 931 37A709AD1E3EA8B000CA5969 /* BundleRangeHandle.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = BundleRangeHandle.mm; sourceTree = "<group>"; }; 927 932 37B47E2E1D64E7CA005F4EFF /* WKObject.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKObject.mm; sourceTree = "<group>"; }; 928 933 37BCA61B1B596BA9002012CA /* ShouldOpenExternalURLsInNewWindowActions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ShouldOpenExternalURLsInNewWindowActions.mm; sourceTree = "<group>"; }; … … 1503 1508 A13EBBAC1B87436F00097110 /* BundleParameters.mm */, 1504 1509 A13EBBAE1B87436F00097110 /* BundleParametersPlugIn.mm */, 1510 37A709AD1E3EA8B000CA5969 /* BundleRangeHandle.mm */, 1511 37A709AA1E3EA79000CA5969 /* BundleRangeHandlePlugIn.mm */, 1512 37A709AC1E3EA7E800CA5969 /* BundleRangeHandleProtocol.h */, 1505 1513 1C2B817E1C891E4200A5529F /* CancelFontSubresource.mm */, 1506 1514 1C2B81811C891EFA00A5529F /* CancelFontSubresourcePlugIn.mm */, … … 1525 1533 51B1EE8D1C80F5880064FB98 /* IndexedDBPersistence.mm */, 1526 1534 37D36ED61AF42ECD00BAF5D9 /* LoadAlternateHTMLString.mm */, 1535 A125478D1DB18B9400358564 /* LoadDataWithNilMIMEType.mm */, 1527 1536 57901FAC1CAF12C200ED64F9 /* LoadInvalidURLRequest.mm */, 1528 1537 51E6A8921D2F1BEC00C004B6 /* LocalStorageClear.mm */, … … 1530 1539 7A6A2C6F1DCCF87B00C0D085 /* LocalStorageQuirkTest.mm */, 1531 1540 51CD1C6A1B38CE3600142CA5 /* ModalAlerts.mm */, 1532 A10F047C1E3AD29C00C95E19 /* NSFileManagerExtras.mm */,1533 1541 1ABC3DED1899BE6D004F0626 /* Navigation.mm */, 1534 1542 2ECFF5541D9B12F800B55394 /* NowPlayingControlsTests.mm */, 1543 A10F047C1E3AD29C00C95E19 /* NSFileManagerExtras.mm */, 1535 1544 37A22AA51DCAA27200AFBFC4 /* ObservedRenderingProgressEventsAfterCrash.mm */, 1536 1545 CEA6CF2219CCF5BD0064F5A7 /* OpenAndCloseWindow.mm */, … … 1563 1572 0F3B94A51A77266C00DE3272 /* WKWebViewEvaluateJavaScript.mm */, 1564 1573 9984FACA1CFFAEEE008D198C /* WKWebViewTextInput.mm */, 1565 A125478D1DB18B9400358564 /* LoadDataWithNilMIMEType.mm */,1566 1574 ); 1567 1575 name = "WebKit2 Cocoa"; … … 2606 2614 7C83E0B81D0A64BD00FEBCF3 /* InjectedBundleMakeAllShadowRootsOpen.cpp in Sources */, 2607 2615 7CCE7EC31A411A7E00447C4C /* InspectorBar.mm in Sources */, 2616 37A709AE1E3EA8B000CA5969 /* BundleRangeHandle.mm in Sources */, 2608 2617 7CCE7EDA1A411A8700447C4C /* InstanceMethodSwizzler.mm in Sources */, 2609 2618 5C726D6F1D3EE06E00C5E1A1 /* InstanceMethodSwizzler.mm in Sources */, … … 2785 2794 1A4F81CF1BDFFD53004E672E /* RemoteObjectRegistryPlugIn.mm in Sources */, 2786 2795 7C882E091C80C630006BF731 /* UserContentWorldPlugIn.mm in Sources */, 2796 37A709AF1E3EA97E00CA5969 /* BundleRangeHandlePlugIn.mm in Sources */, 2787 2797 374B7A611DF371CF00ACCB6C /* BundleEditingDelegatePlugIn.mm in Sources */, 2788 2798 7C83E03D1D0A60D600FEBCF3 /* UtilitiesCocoa.mm in Sources */,
Note:
See TracChangeset
for help on using the changeset viewer.