Changeset 218899 in webkit
- Timestamp:
- Jun 28, 2017 3:58:16 PM (7 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r218894 r218899 1 2017-06-28 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 Followup to r218885: adjust for further UIKit SPI changes 4 https://bugs.webkit.org/show_bug.cgi?id=173927 5 <rdar://problem/33020792> 6 7 Reviewed by Tim Horton. 8 9 On ToT, UIKit now invokes -_dragInteraction:item:shouldDelaySetDownAnimationWithCompletion: before the 10 completion block of -dragInteraction:willAnimateLiftWithAnimator:session: is called. This means we now need to 11 store the completion block in -shouldDelaySetDownAnimationWithCompletion: and wait until the UIDragAnimating 12 completion block in -willAnimateCancelWithAnimator: before invoking it. 13 14 * UIProcess/ios/WKContentViewInteraction.h: 15 * UIProcess/ios/WKContentViewInteraction.mm: 16 (-[WKContentView cleanUpDragSourceSessionState]): 17 18 Ensure that the set-down completion block is invoked when a drag session ends (e.g., if the web content process 19 crashes). 20 21 (-[WKContentView _dragInteraction:item:shouldDelaySetDownAnimationWithCompletion:]): 22 (-[WKContentView _api_dragInteraction:item:willAnimateCancelWithAnimator:]): 23 1 24 2017-06-28 Wenson Hsieh <wenson_hsieh@apple.com> 2 25 -
trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.h
r218837 r218899 129 129 RetainPtr<id <UIDropSession>> dropSession; 130 130 BlockPtr<void()> dragStartCompletionBlock; 131 BlockPtr<void()> dragCancelSetDownBlock; 131 132 WebCore::DragSourceAction sourceAction { WebCore::DragSourceActionNone }; 132 133 -
trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm
r218894 r218899 4376 4376 } 4377 4377 4378 if (auto completionBlock = _dataInteractionState.dragCancelSetDownBlock) { 4379 _dataInteractionState.dragCancelSetDownBlock = nil; 4380 completionBlock(); 4381 } 4382 4378 4383 if (auto completionBlock = _dataInteractionState.dragStartCompletionBlock) { 4379 4384 // If the previous drag session is still initializing, we need to ensure that its completion block is called to prevent UIKit from getting out of state. … … 4661 4666 - (BOOL)_dragInteraction:(UIDragInteraction *)interaction item:(UIDragItem *)item shouldDelaySetDownAnimationWithCompletion:(void(^)(void))completion 4662 4667 { 4663 _page->callAfterNextPresentationUpdate([capturedBlock = makeBlockPtr(completion)] (CallbackBase::Error) { 4664 capturedBlock(); 4665 }); 4668 _dataInteractionState.dragCancelSetDownBlock = completion; 4666 4669 return YES; 4667 4670 } … … 4669 4672 - (void)_api_dragInteraction:(UIDragInteraction *)interaction item:(UIDragItem *)item willAnimateCancelWithAnimator:(id <UIDragAnimating>)animator 4670 4673 { 4671 [animator addCompletion:[p age = _page] (UIViewAnimatingPosition finalPosition) {4674 [animator addCompletion:[protectedSelf = retainPtr(self), page = _page] (UIViewAnimatingPosition finalPosition) { 4672 4675 page->dragCancelled(); 4676 if (auto completion = protectedSelf->_dataInteractionState.dragCancelSetDownBlock) { 4677 protectedSelf->_dataInteractionState.dragCancelSetDownBlock = nil; 4678 page->callAfterNextPresentationUpdate([completion] (CallbackBase::Error) { 4679 completion(); 4680 }); 4681 } 4673 4682 }]; 4674 4683 }
Note: See TracChangeset
for help on using the changeset viewer.