Changeset 245882 in webkit
- Timestamp:
- May 29, 2019 7:41:10 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r245881 r245882 1 2019-05-29 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 Remove some logic to suppress the text selection assistant during drop 4 https://bugs.webkit.org/show_bug.cgi?id=198354 5 6 Reviewed by Tim Horton. 7 8 This logic was originally added to hide the ranged selection after performing a drop in editable content. 9 However, after r245803, we (1) no longer show the keyboard and/or text selection views when dropping, and (2) 10 the final selection is now a caret, so it's no longer necessary to suppress the selection assistant. 11 12 * UIProcess/ios/WKContentViewInteraction.h: 13 * UIProcess/ios/WKContentViewInteraction.mm: 14 (-[WKContentView dropInteraction:performDrop:]): 15 (-[WKContentView dropInteraction:concludeDrop:]): 16 1 17 2019-05-29 Sihui Liu <sihui_liu@apple.com> 2 18 -
trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h
r245778 r245882 166 166 EditableRootIsTransparentOrFullyClipped = 1 << 0, 167 167 FocusedElementIsTooSmall = 1 << 1, 168 DropAnimationIsRunning = 1 << 2, 169 InteractionIsHappening = 1 << 3 168 InteractionIsHappening = 1 << 2 170 169 }; 171 170 -
trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
r245803 r245882 6892 6892 retainedSelf->_page->createSandboxExtensionsIfNeeded(filenames, sandboxExtensionHandle, sandboxExtensionForUpload); 6893 6893 retainedSelf->_page->performDragOperation(capturedDragData, "data interaction pasteboard", WTFMove(sandboxExtensionHandle), WTFMove(sandboxExtensionForUpload)); 6894 6895 6894 retainedSelf->_visibleContentViewSnapshot = [retainedSelf snapshotViewAfterScreenUpdates:NO]; 6896 [retainedSelf _startSuppressingSelectionAssistantForReason:WebKit::DropAnimationIsRunning];6897 6895 [UIView performWithoutAnimation:[retainedSelf] { 6898 6896 [retainedSelf->_visibleContentViewSnapshot setFrame:[retainedSelf bounds]]; … … 6911 6909 - (void)dropInteraction:(UIDropInteraction *)interaction concludeDrop:(id <UIDropSession>)session 6912 6910 { 6913 [self _stopSuppressingSelectionAssistantForReason:WebKit::DropAnimationIsRunning];6914 6911 [std::exchange(_visibleContentViewSnapshot, nil) removeFromSuperview]; 6915 6912 [std::exchange(_unselectedContentSnapshot, nil) removeFromSuperview]; -
trunk/Tools/ChangeLog
r245881 r245882 1 2019-05-29 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 Remove some logic to suppress the text selection assistant during drop 4 https://bugs.webkit.org/show_bug.cgi?id=198354 5 6 Reviewed by Tim Horton. 7 8 Adjust some API tests that currently check whether or not the selection assistant was suppressed during drop. 9 10 * TestWebKitAPI/Tests/ios/DragAndDropTestsIOS.mm: 11 (TestWebKitAPI::TEST): 12 * TestWebKitAPI/cocoa/DragAndDropSimulator.h: 13 * TestWebKitAPI/ios/DragAndDropSimulatorIOS.mm: 14 (-[DragAndDropSimulator _resetSimulatedState]): 15 (-[DragAndDropSimulator _webView:dataInteractionOperationWasHandled:forSession:itemProviders:]): 16 1 17 2019-05-29 Sihui Liu <sihui_liu@apple.com> 2 18 -
trunk/Tools/TestWebKitAPI/Tests/ios/DragAndDropTestsIOS.mm
r245803 r245882 371 371 [simulator runFrom:CGPointMake(100, 50) to:CGPointMake(100, 300)]; 372 372 373 EXPECT_TRUE([simulator suppressedSelectionCommandsDuringDrop]);374 373 EXPECT_EQ([webView stringByEvaluatingJavaScript:@"source.textContent"].length, 0UL); 375 374 EXPECT_WK_STREQ("Hello world", [webView stringByEvaluatingJavaScript:@"editor.textContent"].UTF8String); … … 395 394 [simulator runFrom:CGPointMake(100, 50) to:CGPointMake(100, 300)]; 396 395 397 EXPECT_TRUE([simulator suppressedSelectionCommandsDuringDrop]);398 396 EXPECT_EQ([webView stringByEvaluatingJavaScript:@"source.textContent"].length, 0UL); 399 397 EXPECT_WK_STREQ("Hello world", [webView editorValue].UTF8String); … … 456 454 NSUInteger secondParagraphOffset = [finalTextContent rangeOfString:@"This is the second paragraph"].location; 457 455 458 EXPECT_TRUE([simulator suppressedSelectionCommandsDuringDrop]);459 456 EXPECT_FALSE(firstParagraphOffset == NSNotFound); 460 457 EXPECT_FALSE(secondParagraphOffset == NSNotFound); … … 483 480 [simulator runFrom:CGPointMake(100, 50) to:CGPointMake(100, 300)]; 484 481 485 EXPECT_TRUE([simulator suppressedSelectionCommandsDuringDrop]);486 482 EXPECT_EQ([webView stringByEvaluatingJavaScript:@"source.value"].length, 0UL); 487 483 EXPECT_WK_STREQ("Hello world", [webView editorValue].UTF8String); … … 499 495 [webView stringByEvaluatingJavaScript:@"source.selectionEnd = source.value.length"]; 500 496 [simulator runFrom:CGPointMake(100, 50) to:CGPointMake(100, 300)]; 501 502 EXPECT_TRUE([simulator suppressedSelectionCommandsDuringDrop]);503 497 504 498 NSItemProvider *itemProvider = [simulator sourceItemProviders].firstObject; … … 521 515 [webView stringByEvaluatingJavaScript:@"source.selectionEnd = source.value.length"]; 522 516 [simulator runFrom:CGPointMake(100, 50) to:CGPointMake(100, 300)]; 523 524 EXPECT_TRUE([simulator suppressedSelectionCommandsDuringDrop]);525 517 526 518 NSItemProvider *itemProvider = [simulator sourceItemProviders].firstObject; -
trunk/Tools/TestWebKitAPI/cocoa/DragAndDropSimulator.h
r245803 r245882 114 114 @property (nonatomic, readonly) NSArray *dropPreviews; 115 115 @property (nonatomic, readonly) NSArray *delayedDropPreviews; 116 @property (nonatomic, readonly) BOOL suppressedSelectionCommandsDuringDrop;117 116 118 117 #endif // PLATFORM(IOS_FAMILY) -
trunk/Tools/TestWebKitAPI/ios/DragAndDropSimulatorIOS.mm
r245803 r245882 324 324 DragAndDropPhase _phase; 325 325 326 BOOL _suppressedSelectionCommandsDuringDrop;327 326 RetainPtr<UIDropProposal> _lastKnownDropProposal; 328 327 … … 374 373 - (void)_resetSimulatedState 375 374 { 376 _suppressedSelectionCommandsDuringDrop = NO;377 375 _phase = DragAndDropPhaseBeginning; 378 376 _currentProgress = 0; … … 764 762 - (void)_webView:(WKWebView *)webView dataInteractionOperationWasHandled:(BOOL)handled forSession:(id)session itemProviders:(NSArray<NSItemProvider *> *)itemProviders 765 763 { 766 _suppressedSelectionCommandsDuringDrop = [_webView textInputContentView]._shouldSuppressSelectionCommands;767 768 764 if (self.dropCompletionBlock) 769 765 self.dropCompletionBlock(handled, itemProviders);
Note: See TracChangeset
for help on using the changeset viewer.