Changeset 219113 in webkit
- Timestamp:
- Jul 3, 2017, 9:33:21 PM (8 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r219106 r219113 1 2017-07-03 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 [iOS DnD] [WK2] Callout bar should reappear after dragging ends for a text selection 4 https://bugs.webkit.org/show_bug.cgi?id=174116 5 <rdar://problem/33017845> 6 7 Reviewed by Ryosuke Niwa. 8 9 -willStartScrollingOverflow -didEndScrollingOverflow are helper methods on both the UIWKTextInteractionAssistant 10 and UIWebSelectionAssistant that handle hiding selection and callout bar UI during overflow scrolling and making 11 it reappear after scrolling ends. However, these hooks do not contain logic specific to scrolling, and simply 12 tell the inner UIWebSelectionView to either show or hide and are safe to invoke outside of the context of 13 scrolling. 14 15 This patch invokes these hooks when beginning a drag on a selection, and when a dragging ends, if it called 16 -willStartScrollingOverflow to begin with. We should rename these in the future to be something along the lines 17 of -hideSelectionViewAndControls and -showSelectionViewAndControls, respectively, and adopt these new names in 18 WebKit. We also move logic to hide the callout out of -itemsForBeginningSession: and into 19 -willAnimateLiftWithAnimator:, when the lift actually begins. 20 21 * UIProcess/ios/WKContentViewInteraction.h: 22 * UIProcess/ios/WKContentViewInteraction.mm: 23 (-[WKContentView cleanUpDragSourceSessionState]): 24 (-[WKContentView _restoreCalloutBarIfNeeded]): 25 (-[WKContentView dragInteraction:itemsForBeginningSession:]): 26 (-[WKContentView dragInteraction:willAnimateLiftWithAnimator:session:]): 27 (-[WKContentView dragInteraction:session:didEndWithOperation:]): 28 1 29 2017-07-03 Matt Rajca <mrajca@apple.com> 2 30 -
trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.h
r218899 r219113 126 126 BOOL isPerformingOperation { NO }; 127 127 BOOL isAnimatingConcludeEditDrag { NO }; 128 BOOL shouldRestoreCalloutBar { NO }; 128 129 RetainPtr<id <UIDragSession>> dragSession; 129 130 RetainPtr<id <UIDropSession>> dropSession; -
trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm
r219055 r219113 4377 4377 } 4378 4378 4379 [self _restoreCalloutBarIfNeeded]; 4379 4380 [_dataInteractionState.caretView remove]; 4380 4381 [_dataInteractionState.visibleContentViewSnapshot removeFromSuperview]; … … 4507 4508 } 4508 4509 4510 - (void)_restoreCalloutBarIfNeeded 4511 { 4512 if (!_dataInteractionState.shouldRestoreCalloutBar) 4513 return; 4514 4515 // FIXME: This SPI should be renamed in UIKit to reflect a more general purpose of revealing hidden interaction assistant controls. 4516 [_webSelectionAssistant didEndScrollingOverflow]; 4517 [_textSelectionAssistant didEndScrollingOverflow]; 4518 _dataInteractionState.shouldRestoreCalloutBar = NO; 4519 } 4520 4509 4521 #pragma mark - UIDragInteractionDelegate 4510 4522 … … 4552 4564 return @[ ]; 4553 4565 } 4554 4555 [UICalloutBar fadeSharedCalloutBar];4556 4566 4557 4567 // Give internal clients such as Mail one final chance to augment the contents of each UIItemProvider before sending the drag items off to UIKit. … … 4601 4611 - (void)dragInteraction:(UIDragInteraction *)interaction willAnimateLiftWithAnimator:(id <UIDragAnimating>)animator session:(id <UIDragSession>)session 4602 4612 { 4613 if (!_dataInteractionState.shouldRestoreCalloutBar && (_dataInteractionState.sourceAction & DragSourceActionSelection)) { 4614 // FIXME: This SPI should be renamed in UIKit to reflect a more general purpose of hiding interaction assistant controls. 4615 [_webSelectionAssistant willStartScrollingOverflow]; 4616 [_textSelectionAssistant willStartScrollingOverflow]; 4617 _dataInteractionState.shouldRestoreCalloutBar = YES; 4618 } 4619 4603 4620 auto adjustedOrigin = _dataInteractionState.adjustedOrigin; 4604 4621 RetainPtr<WKContentView> protectedSelf(self); … … 4632 4649 { 4633 4650 RELEASE_LOG(DragAndDrop, "Drag session ended: %p (with operation: %tu, performing operation: %d, began dragging: %d)", session, operation, _dataInteractionState.isPerformingOperation, _dataInteractionState.didBeginDragging); 4651 4652 [self _restoreCalloutBarIfNeeded]; 4653 4634 4654 id <WKUIDelegatePrivate> uiDelegate = self.webViewUIDelegate; 4635 4655 if ([uiDelegate respondsToSelector:@selector(_webView:dataInteraction:session:didEndWithOperation:)])
Note:
See TracChangeset
for help on using the changeset viewer.