Changeset 243519 in webkit
- Timestamp:
- Mar 26, 2019, 2:15:16 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
-
Source/WebKit/ChangeLog (modified) (1 diff)
-
Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (modified) (1 diff)
-
Tools/ChangeLog (modified) (1 diff)
-
Tools/TestWebKitAPI/Tests/ios/UIPasteboardTests.mm (modified) (4 diffs)
-
Tools/TestWebKitAPI/Tests/ios/WKWebViewAutofillTests.mm (modified) (1 diff)
-
Tools/TestWebKitAPI/ios/DragAndDropSimulatorIOS.mm (modified) (1 diff)
-
Tools/TestWebKitAPI/ios/UIKitSPI.h (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r243511 r243519 1 2019-03-26 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 Implement async paste method on UIWKInteractionViewProtocol 4 https://bugs.webkit.org/show_bug.cgi?id=196267 5 <rdar://problem/49236346> 6 7 Reviewed by Tim Horton. 8 9 Implement a new UIWKInteractionViewProtocol hook to perform a paste command, and invoke the given completion 10 handler when pasting is finished. 11 12 Test: UIPasteboardTests.PasteWithCompletionHandler 13 14 * UIProcess/ios/WKContentViewInteraction.mm: 15 (-[WKContentView pasteWithCompletionHandler:]): 16 1 17 2019-03-26 Per Arne Vollan <pvollan@apple.com> 2 18 -
trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
r243454 r243519 2383 2383 } 2384 2384 2385 - (void)pasteWithCompletionHandler:(void (^)(void))completionHandler 2386 { 2387 _page->executeEditCommand("Paste"_s, { }, [completion = makeBlockPtr(completionHandler)] (auto) { 2388 if (completion) 2389 completion(); 2390 }); 2391 } 2392 2385 2393 - (void)clearSelection 2386 2394 { -
trunk/Tools/ChangeLog
r243518 r243519 1 2019-03-26 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 Implement async paste method on UIWKInteractionViewProtocol 4 https://bugs.webkit.org/show_bug.cgi?id=196267 5 <rdar://problem/49236346> 6 7 Reviewed by Tim Horton. 8 9 Add a new test to exercise the new SPI. Additionally, add staging forward declarations for 10 -pasteWithCompletionHandler:, and remove some old existing staging declarations for other bits of UIKit SPI that 11 are now a part of all iOS 12 internal SDKs. 12 13 * TestWebKitAPI/Tests/ios/UIPasteboardTests.mm: 14 15 While we're here, also change a few iOS 11.3 checks to just be about PLATFORM(IOS) (since we don't build for iOS 16 prior to 12, these version checks are effectively only about iOS vs. tvOS or watchOS). 17 18 * TestWebKitAPI/Tests/ios/WKWebViewAutofillTests.mm: 19 * TestWebKitAPI/ios/DragAndDropSimulatorIOS.mm: 20 (-[DragAndDropSimulator _sendQueuedAdditionalItemRequest]): 21 * TestWebKitAPI/ios/UIKitSPI.h: 22 1 23 2019-03-26 Aakash Jain <aakash_jain@apple.com> 2 24 -
trunk/Tools/TestWebKitAPI/Tests/ios/UIPasteboardTests.mm
r242339 r243519 39 39 typedef void (^DataLoadCompletionBlock)(NSData *, NSError *); 40 40 41 #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 11030041 #if PLATFORM(IOS) 42 42 43 43 static void checkJSONWithLogging(NSString *jsonString, NSDictionary *expected) … … 49 49 } 50 50 51 #endif // __IPHONE_OS_VERSION_MIN_REQUIRED >= 11030051 #endif // PLATFORM(IOS) 52 52 53 53 namespace TestWebKitAPI { … … 146 146 } 147 147 148 #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 110300 148 TEST(UIPasteboardTests, PasteWithCompletionHandler) 149 { 150 auto webView = setUpWebViewForPasteboardTests(@"DataTransfer"); 151 [UIPasteboard generalPasteboard].URL = [NSURL URLWithString:@"https://www.apple.com/"]; 152 153 bool done = false; 154 [(id <UIWKInteractionViewProtocol_Staging_49236384>)[webView textInputContentView] pasteWithCompletionHandler:[webView, &done] { 155 [UIPasteboard generalPasteboard].items = @[ ]; 156 done = true; 157 }]; 158 159 Util::run(&done); 160 161 EXPECT_WK_STREQ("text/uri-list, text/plain", [webView stringByEvaluatingJavaScript:@"types.textContent"]); 162 EXPECT_WK_STREQ("(STRING, text/uri-list), (STRING, text/plain)", [webView stringByEvaluatingJavaScript:@"items.textContent"]); 163 EXPECT_WK_STREQ("https://www.apple.com/", [webView stringByEvaluatingJavaScript:@"urlData.textContent"]); 164 EXPECT_WK_STREQ("https://www.apple.com/", [webView stringByEvaluatingJavaScript:@"textData.textContent"]); 165 } 166 167 #if PLATFORM(IOS) 149 168 150 169 TEST(UIPasteboardTests, DataTransferGetDataWhenPastingURL) … … 284 303 } 285 304 286 #endif // __IPHONE_OS_VERSION_MIN_REQUIRED >= 110300305 #endif // PLATFORM(IOS) 287 306 288 307 } // namespace TestWebKitAPI -
trunk/Tools/TestWebKitAPI/Tests/ios/WKWebViewAutofillTests.mm
r242339 r243519 36 36 #import <wtf/BlockPtr.h> 37 37 38 typedef UIView <UITextInput Traits_Private_Proposed_SPI_34583628> AutofillInputView;38 typedef UIView <UITextInputPrivate> AutofillInputView; 39 39 40 40 @interface AutofillTestView : TestWKWebView -
trunk/Tools/TestWebKitAPI/ios/DragAndDropSimulatorIOS.mm
r242339 r243519 505 505 506 506 auto requestLocation = [[_webView window] convertPoint:[requestLocationValue CGPointValue] toView:_webView.get()]; 507 [(id <UIDragInteractionDelegate_ Proposed_SPI_33146803>)[_webView dragInteractionDelegate] _dragInteraction:[_webView dragInteraction] itemsForAddingToSession:_dragSession.get() withTouchAtPoint:requestLocation completion:[dragSession = _dragSession, dropSession = _dropSession] (NSArray *items) {507 [(id <UIDragInteractionDelegate_ForWebKitOnly>)[_webView dragInteractionDelegate] _dragInteraction:[_webView dragInteraction] itemsForAddingToSession:_dragSession.get() withTouchAtPoint:requestLocation completion:[dragSession = _dragSession, dropSession = _dropSession] (NSArray *items) { 508 508 [dragSession addItems:items]; 509 509 [dropSession addItems:items]; -
trunk/Tools/TestWebKitAPI/ios/UIKitSPI.h
r243370 r243519 40 40 #import <UIKit/UIWKTextInteractionAssistant.h> 41 41 42 #if ENABLE(DRAG_SUPPORT)42 #if PLATFORM(IOS) 43 43 @protocol UIDragSession; 44 44 @class UIDragInteraction; … … 46 46 #import <UIKit/NSItemProvider+UIKitAdditions_Private.h> 47 47 #import <UIKit/UIDragInteraction_Private.h> 48 #endif // ENABLE(DRAG_SUPPORT)48 #endif // PLATFORM(IOS) 49 49 50 50 #else … … 66 66 @optional 67 67 - (void)_dragInteraction:(UIDragInteraction *)interaction prepareForSession:(id<UIDragSession>)session completion:(void(^)(void))completion; 68 - (void)_dragInteraction:(UIDragInteraction *)interaction itemsForAddingToSession:(id <UIDragSession>)session withTouchAtPoint:(CGPoint)point completion:(void(^)(NSArray<UIDragItem *> *))completion; 68 69 @end 69 70 … … 80 81 - (void)handleKeyWebEvent:(WebEvent *)theEvent withCompletionHandler:(void (^)(WebEvent *, BOOL))completionHandler; 81 82 - (BOOL)_shouldSuppressSelectionCommands; 83 - (NSDictionary *)_autofillContext; 82 84 @end 83 85 … … 134 136 #endif 135 137 136 @protocol UITextInputTraits_Private_Proposed_SPI_34583628 <UITextInputPrivate>137 - (NSDictionary *)_autofillContext;138 @end139 140 #if ENABLE(DRAG_SUPPORT)141 @protocol UIDragInteractionDelegate_Proposed_SPI_33146803 <UIDragInteractionDelegate>142 - (void)_dragInteraction:(UIDragInteraction *)interaction itemsForAddingToSession:(id <UIDragSession>)session withTouchAtPoint:(CGPoint)point completion:(void(^)(NSArray<UIDragItem *> *))completion;143 @end144 #endif145 146 138 #if __has_include(<UIKit/UITextAutofillSuggestion.h>) 147 139 // FIXME: Move this import under USE(APPLE_INTERNAL_SDK) once <rdar://problem/34583628> lands in the SDK. … … 175 167 @end 176 168 169 @protocol UIWKInteractionViewProtocol_Staging_49236384 170 - (void)pasteWithCompletionHandler:(void (^)(void))completionHandler; 171 @end 172 177 173 #endif // PLATFORM(IOS_FAMILY)
Note:
See TracChangeset
for help on using the changeset viewer.