Changeset 238461 in webkit
- Timestamp:
- Nov 23, 2018, 10:18:01 AM (8 years ago)
- Location:
- trunk
- Files:
-
- 16 edited
-
Source/JavaScriptCore/ChangeLog (modified) (1 diff)
-
Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig (modified) (2 diffs)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/Configurations/FeatureDefines.xcconfig (modified) (2 diffs)
-
Source/WebCore/PAL/ChangeLog (modified) (1 diff)
-
Source/WebCore/PAL/Configurations/FeatureDefines.xcconfig (modified) (2 diffs)
-
Source/WebCore/platform/ios/PlatformPasteboardIOS.mm (modified) (8 diffs)
-
Source/WebCore/platform/ios/WebItemProviderPasteboard.mm (modified) (4 diffs)
-
Source/WebKit/ChangeLog (modified) (1 diff)
-
Source/WebKit/Configurations/FeatureDefines.xcconfig (modified) (2 diffs)
-
Source/WebKit/Shared/WebPreferencesDefaultValues.cpp (modified) (1 diff)
-
Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm (modified) (1 diff)
-
Source/WebKitLegacy/mac/ChangeLog (modified) (1 diff)
-
Source/WebKitLegacy/mac/Configurations/FeatureDefines.xcconfig (modified) (2 diffs)
-
Tools/ChangeLog (modified) (1 diff)
-
Tools/TestWebKitAPI/Configurations/FeatureDefines.xcconfig (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r238453 r238461 1 2018-11-23 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 Enable drag and drop support for iOSMac 4 https://bugs.webkit.org/show_bug.cgi?id=191818 5 <rdar://problem/43907454> 6 7 Reviewed by Dean Jackson. 8 9 * Configurations/FeatureDefines.xcconfig: 10 1 11 2018-11-22 Mark Lam <mark.lam@apple.com> 2 12 -
trunk/Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig
r237912 r238461 125 125 ENABLE_DATA_INTERACTION_iphoneos = ENABLE_DATA_INTERACTION; 126 126 ENABLE_DATA_INTERACTION_iphonesimulator = ENABLE_DATA_INTERACTION; 127 ENABLE_DATA_INTERACTION_iosmac = ENABLE_DATA_INTERACTION; 127 128 128 129 ENABLE_DEVICE_ORIENTATION = $(ENABLE_DEVICE_ORIENTATION_$(WK_PLATFORM_NAME)); … … 137 138 ENABLE_DRAG_SUPPORT_iphoneos = ENABLE_DRAG_SUPPORT; 138 139 ENABLE_DRAG_SUPPORT_iphonesimulator = ENABLE_DRAG_SUPPORT; 140 ENABLE_DRAG_SUPPORT_iosmac = ENABLE_DRAG_SUPPORT; 139 141 140 142 ENABLE_ENCRYPTED_MEDIA = $(ENABLE_ENCRYPTED_MEDIA_$(WK_PLATFORM_NAME)); -
trunk/Source/WebCore/ChangeLog
r238460 r238461 1 2018-11-23 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 Enable drag and drop support for iOSMac 4 https://bugs.webkit.org/show_bug.cgi?id=191818 5 <rdar://problem/43907454> 6 7 Reviewed by Dean Jackson. 8 9 Enables drag and drop by default on iOSMac by switching on ENABLE_DATA_INTERACTION and ENABLE_DRAG_SUPPORT. This 10 enables support for dragging links, text selections, and images, though many advanced features (e.g. custom 11 pasteboard data) will require additional support from the platform. 12 13 * Configurations/FeatureDefines.xcconfig: 14 * platform/ios/PlatformPasteboardIOS.mm: 15 (WebCore::PlatformPasteboard::informationForItemAtIndex): 16 (WebCore::registerItemToPasteboard): 17 (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const): 18 * platform/ios/WebItemProviderPasteboard.mm: 19 (-[WebItemProviderLoadResult canBeRepresentedAsFileUpload]): 20 (-[WebItemProviderPasteboard numberOfFiles]): 21 22 Disable codepaths which attempt to access or set `teamData` or `preferredPresentationStyle` on `NSItemProvider` 23 in iOSMac, since these are currently unimplemented. 24 1 25 2018-11-23 Zalan Butjas <zalan@apple.com> 2 26 -
trunk/Source/WebCore/Configurations/FeatureDefines.xcconfig
r237912 r238461 125 125 ENABLE_DATA_INTERACTION_iphoneos = ENABLE_DATA_INTERACTION; 126 126 ENABLE_DATA_INTERACTION_iphonesimulator = ENABLE_DATA_INTERACTION; 127 ENABLE_DATA_INTERACTION_iosmac = ENABLE_DATA_INTERACTION; 127 128 128 129 ENABLE_DEVICE_ORIENTATION = $(ENABLE_DEVICE_ORIENTATION_$(WK_PLATFORM_NAME)); … … 137 138 ENABLE_DRAG_SUPPORT_iphoneos = ENABLE_DRAG_SUPPORT; 138 139 ENABLE_DRAG_SUPPORT_iphonesimulator = ENABLE_DRAG_SUPPORT; 140 ENABLE_DRAG_SUPPORT_iosmac = ENABLE_DRAG_SUPPORT; 139 141 140 142 ENABLE_ENCRYPTED_MEDIA = $(ENABLE_ENCRYPTED_MEDIA_$(WK_PLATFORM_NAME)); -
trunk/Source/WebCore/PAL/ChangeLog
r238438 r238461 1 2018-11-23 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 Enable drag and drop support for iOSMac 4 https://bugs.webkit.org/show_bug.cgi?id=191818 5 <rdar://problem/43907454> 6 7 Reviewed by Dean Jackson. 8 9 * Configurations/FeatureDefines.xcconfig: 10 1 11 2018-11-21 Wenson Hsieh <wenson_hsieh@apple.com> 2 12 -
trunk/Source/WebCore/PAL/Configurations/FeatureDefines.xcconfig
r237912 r238461 125 125 ENABLE_DATA_INTERACTION_iphoneos = ENABLE_DATA_INTERACTION; 126 126 ENABLE_DATA_INTERACTION_iphonesimulator = ENABLE_DATA_INTERACTION; 127 ENABLE_DATA_INTERACTION_iosmac = ENABLE_DATA_INTERACTION; 127 128 128 129 ENABLE_DEVICE_ORIENTATION = $(ENABLE_DEVICE_ORIENTATION_$(WK_PLATFORM_NAME)); … … 137 138 ENABLE_DRAG_SUPPORT_iphoneos = ENABLE_DRAG_SUPPORT; 138 139 ENABLE_DRAG_SUPPORT_iphonesimulator = ENABLE_DRAG_SUPPORT; 140 ENABLE_DRAG_SUPPORT_iosmac = ENABLE_DRAG_SUPPORT; 139 141 140 142 ENABLE_ENCRYPTED_MEDIA = $(ENABLE_ENCRYPTED_MEDIA_$(WK_PLATFORM_NAME)); -
trunk/Source/WebCore/platform/ios/PlatformPasteboardIOS.mm
r238360 r238461 48 48 49 49 #define PASTEBOARD_SUPPORTS_ITEM_PROVIDERS (PLATFORM(IOS_FAMILY) && !(PLATFORM(WATCHOS) || PLATFORM(APPLETV))) 50 #define PASTEBOARD_SUPPORTS_PRESENTATION_STYLE_AND_TEAM_DATA (PASTEBOARD_SUPPORTS_ITEM_PROVIDERS && !PLATFORM(IOSMAC)) 50 51 #define NSURL_SUPPORTS_TITLE (!PLATFORM(IOSMAC)) 51 52 … … 110 111 111 112 #if PASTEBOARD_SUPPORTS_ITEM_PROVIDERS 113 114 #if PASTEBOARD_SUPPORTS_PRESENTATION_STYLE_AND_TEAM_DATA 112 115 113 116 static PasteboardItemPresentationStyle pasteboardItemPresentationStyle(UIPreferredPresentationStyle style) … … 126 129 } 127 130 131 #endif // PASTEBOARD_SUPPORTS_PRESENTATION_STYLE_AND_TEAM_DATA 132 128 133 Vector<PasteboardItemInfo> PlatformPasteboard::allPasteboardItemInfo() 129 134 { … … 147 152 148 153 NSItemProvider *itemProvider = [[m_pasteboard itemProviders] objectAtIndex:index]; 154 #if PASTEBOARD_SUPPORTS_PRESENTATION_STYLE_AND_TEAM_DATA 149 155 info.preferredPresentationStyle = pasteboardItemPresentationStyle(itemProvider.preferredPresentationStyle); 156 #endif 150 157 info.suggestedFileName = itemProvider.suggestedName; 151 158 for (NSString *typeIdentifier in itemProvider.registeredTypeIdentifiers) { … … 286 293 { 287 294 #if PLATFORM(IOSMAC) 288 auto itemDictionary = adoptNS([[NSMutableDictionary alloc] init]); 289 [representationsToRegister enumerateItems:[itemDictionary] (id <WebItemProviderRegistrar> item, NSUInteger) { 290 if ([item respondsToSelector:@selector(typeIdentifierForClient)] && [item respondsToSelector:@selector(dataForClient)]) 291 [itemDictionary setObject:item.dataForClient forKey:item.typeIdentifierForClient]; 292 }]; 293 [pasteboard setItems:@[ itemDictionary.get() ]]; 294 #else 295 // In iOSMac, -[UIPasteboard setItemProviders:] is not yet supported, so we fall back to setting an item dictionary when 296 // populating the pasteboard upon copy. 297 if ([pasteboard isKindOfClass:getUIPasteboardClass()]) { 298 auto itemDictionary = adoptNS([[NSMutableDictionary alloc] init]); 299 [representationsToRegister enumerateItems:[itemDictionary] (id <WebItemProviderRegistrar> item, NSUInteger) { 300 if ([item respondsToSelector:@selector(typeIdentifierForClient)] && [item respondsToSelector:@selector(dataForClient)]) 301 [itemDictionary setObject:item.dataForClient forKey:item.typeIdentifierForClient]; 302 }]; 303 [pasteboard setItems:@[ itemDictionary.get() ]]; 304 return; 305 } 306 #endif // PLATFORM(IOSMAC) 307 295 308 if (NSItemProvider *itemProvider = representationsToRegister.itemProvider) 296 309 [pasteboard setItemProviders:@[ itemProvider ]]; … … 300 313 if ([pasteboard respondsToSelector:@selector(stageRegistrationList:)]) 301 314 [pasteboard stageRegistrationList:representationsToRegister]; 302 #endif303 304 315 } 305 316 … … 467 478 { 468 479 ListHashSet<String> domPasteboardTypes; 480 #if PASTEBOARD_SUPPORTS_PRESENTATION_STYLE_AND_TEAM_DATA 469 481 for (NSItemProvider *provider in [m_pasteboard itemProviders]) { 470 482 if (!provider.teamData.length) … … 488 500 domPasteboardTypes.add(type); 489 501 } 502 #endif // PASTEBOARD_SUPPORTS_PRESENTATION_STYLE_AND_TEAM_DATA 490 503 491 504 if (NSData *serializedCustomData = [m_pasteboard dataForPasteboardType:@(PasteboardCustomData::cocoaType())]) { -
trunk/Source/WebCore/platform/ios/WebItemProviderPasteboard.mm
r238360 r238461 27 27 #import "WebItemProviderPasteboard.h" 28 28 29 #if ENABLE(DATA_INTERACTION) || PLATFORM(IOSMAC)29 #if ENABLE(DATA_INTERACTION) 30 30 31 31 #import <Foundation/NSItemProvider.h> … … 343 343 - (BOOL)canBeRepresentedAsFileUpload 344 344 { 345 #if PLATFORM(IOSMAC) 346 return false; 347 #else 345 348 return [_itemProvider preferredPresentationStyle] != UIPreferredPresentationStyleInline; 349 #endif 346 350 } 347 351 … … 644 648 NSInteger numberOfFiles = 0; 645 649 for (NSItemProvider *itemProvider in _itemProviders.get()) { 650 #if !PLATFORM(IOSMAC) 646 651 if (itemProvider.preferredPresentationStyle == UIPreferredPresentationStyleInline) 647 652 continue; 653 #endif 648 654 649 655 for (NSString *identifier in itemProvider.registeredTypeIdentifiers) { … … 830 836 @end 831 837 832 #endif // ENABLE(DATA_INTERACTION) || PLATFORM(IOSMAC)838 #endif // ENABLE(DATA_INTERACTION) -
trunk/Source/WebKit/ChangeLog
r238459 r238461 1 2018-11-23 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 Enable drag and drop support for iOSMac 4 https://bugs.webkit.org/show_bug.cgi?id=191818 5 <rdar://problem/43907454> 6 7 Reviewed by Dean Jackson. 8 9 * Configurations/FeatureDefines.xcconfig: 10 * Shared/WebPreferencesDefaultValues.cpp: 11 (defaultCustomPasteboardDataEnabled): 12 13 Enable custom pasteboard data by default on iOSMac. While writing and reading custom pasteboard data is 14 currently broken in iOSMac due to the lack of `teamData` and `preferredPresentationStyle`, opting into custom 15 pasteboard data at least allows us to avoid writing unsanitized data types to the pasteboard. 16 17 * WebProcess/WebPage/ios/WebPageIOS.mm: 18 (WebKit::WebPage::platformEditorState const): 19 20 Fix a regression from <https://trac.webkit.org/r236619> wherein the web process crashes when attempting to edit 21 a text field. This happens because the call to `-[UIKeyboard isInHardwareKeyboardMode]` on the iOSMac platform 22 attempts to initialize a `UHASWorkspace` from the web process, which then attempts to connect to the UIKit host 23 application. Instead, we can skip this call altogether on iOSMac, where the platform never considers a hardware 24 keyboard to be "connected", even when typing. 25 1 26 2018-11-23 Antti Koivisto <antti@apple.com> 2 27 -
trunk/Source/WebKit/Configurations/FeatureDefines.xcconfig
r237912 r238461 125 125 ENABLE_DATA_INTERACTION_iphoneos = ENABLE_DATA_INTERACTION; 126 126 ENABLE_DATA_INTERACTION_iphonesimulator = ENABLE_DATA_INTERACTION; 127 ENABLE_DATA_INTERACTION_iosmac = ENABLE_DATA_INTERACTION; 127 128 128 129 ENABLE_DEVICE_ORIENTATION = $(ENABLE_DEVICE_ORIENTATION_$(WK_PLATFORM_NAME)); … … 137 138 ENABLE_DRAG_SUPPORT_iphoneos = ENABLE_DRAG_SUPPORT; 138 139 ENABLE_DRAG_SUPPORT_iphonesimulator = ENABLE_DRAG_SUPPORT; 140 ENABLE_DRAG_SUPPORT_iosmac = ENABLE_DRAG_SUPPORT; 139 141 140 142 ENABLE_ENCRYPTED_MEDIA = $(ENABLE_ENCRYPTED_MEDIA_$(WK_PLATFORM_NAME)); -
trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.cpp
r237607 r238461 47 47 bool defaultCustomPasteboardDataEnabled() 48 48 { 49 #if PLATFORM(IOS_FAMILY) 49 #if PLATFORM(IOSMAC) 50 return true; 51 #elif PLATFORM(IOS_FAMILY) 50 52 return WebCore::IOSApplication::isMobileSafari() || dyld_get_program_sdk_version() >= DYLD_IOS_VERSION_11_3; 51 53 #elif PLATFORM(MAC) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 101300 -
trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm
r238454 r238461 199 199 // immediately so that the UIProcess can update UI, including the position of the caret. 200 200 bool needsLayout = !frame.view() || frame.view()->needsLayout(); 201 if (shouldIncludePostLayoutData == IncludePostLayoutDataHint::No && needsLayout && ![UIKeyboard isInHardwareKeyboardMode] && !frame.editor().hasComposition()) { 201 bool requiresPostLayoutData = frame.editor().hasComposition(); 202 #if !PLATFORM(IOSMAC) 203 requiresPostLayoutData |= [UIKeyboard isInHardwareKeyboardMode]; 204 #endif 205 if (shouldIncludePostLayoutData == IncludePostLayoutDataHint::No && needsLayout && !requiresPostLayoutData) { 202 206 result.isMissingPostLayoutData = true; 203 207 return; -
trunk/Source/WebKitLegacy/mac/ChangeLog
r238454 r238461 1 2018-11-23 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 Enable drag and drop support for iOSMac 4 https://bugs.webkit.org/show_bug.cgi?id=191818 5 <rdar://problem/43907454> 6 7 Reviewed by Dean Jackson. 8 9 * Configurations/FeatureDefines.xcconfig: 10 1 11 2018-11-22 Wenson Hsieh <wenson_hsieh@apple.com> 2 12 -
trunk/Source/WebKitLegacy/mac/Configurations/FeatureDefines.xcconfig
r237912 r238461 125 125 ENABLE_DATA_INTERACTION_iphoneos = ENABLE_DATA_INTERACTION; 126 126 ENABLE_DATA_INTERACTION_iphonesimulator = ENABLE_DATA_INTERACTION; 127 ENABLE_DATA_INTERACTION_iosmac = ENABLE_DATA_INTERACTION; 127 128 128 129 ENABLE_DEVICE_ORIENTATION = $(ENABLE_DEVICE_ORIENTATION_$(WK_PLATFORM_NAME)); … … 137 138 ENABLE_DRAG_SUPPORT_iphoneos = ENABLE_DRAG_SUPPORT; 138 139 ENABLE_DRAG_SUPPORT_iphonesimulator = ENABLE_DRAG_SUPPORT; 140 ENABLE_DRAG_SUPPORT_iosmac = ENABLE_DRAG_SUPPORT; 139 141 140 142 ENABLE_ENCRYPTED_MEDIA = $(ENABLE_ENCRYPTED_MEDIA_$(WK_PLATFORM_NAME)); -
trunk/Tools/ChangeLog
r238460 r238461 1 2018-11-23 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 Enable drag and drop support for iOSMac 4 https://bugs.webkit.org/show_bug.cgi?id=191818 5 <rdar://problem/43907454> 6 7 Reviewed by Dean Jackson. 8 9 * TestWebKitAPI/Configurations/FeatureDefines.xcconfig: 10 1 11 2018-11-23 Zalan Bujtas <zalan@apple.com> 2 12 -
trunk/Tools/TestWebKitAPI/Configurations/FeatureDefines.xcconfig
r237912 r238461 125 125 ENABLE_DATA_INTERACTION_iphoneos = ENABLE_DATA_INTERACTION; 126 126 ENABLE_DATA_INTERACTION_iphonesimulator = ENABLE_DATA_INTERACTION; 127 ENABLE_DATA_INTERACTION_iosmac = ENABLE_DATA_INTERACTION; 127 128 128 129 ENABLE_DEVICE_ORIENTATION = $(ENABLE_DEVICE_ORIENTATION_$(WK_PLATFORM_NAME)); … … 137 138 ENABLE_DRAG_SUPPORT_iphoneos = ENABLE_DRAG_SUPPORT; 138 139 ENABLE_DRAG_SUPPORT_iphonesimulator = ENABLE_DRAG_SUPPORT; 140 ENABLE_DRAG_SUPPORT_iosmac = ENABLE_DRAG_SUPPORT; 139 141 140 142 ENABLE_ENCRYPTED_MEDIA = $(ENABLE_ENCRYPTED_MEDIA_$(WK_PLATFORM_NAME));
Note:
See TracChangeset
for help on using the changeset viewer.