Changeset 212574 in webkit
- Timestamp:
- Feb 17, 2017 1:43:41 PM (7 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r212557 r212574 1 2017-02-17 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 [WK2] Action sheet should not dismiss when a DDAction with user interface is being presented 4 https://bugs.webkit.org/show_bug.cgi?id=168528 5 <rdar://problem/30515324> 6 7 Reviewed by Beth Dakin. 8 9 After r211643, -[WKActionSheet doneWithSheet] now dismisses the presenting view controller. This is called when 10 interaction with the sheet is finished and is a reasonable thing to do in most cases. However, when using data 11 detectors, we don't want to dismiss the presenting view controller, since DataDetector handles dismissing on its 12 own and expects that its completion handler will be invoked. 13 14 To fix this, we add a parameter to doneWithSheet: to indicate whether or not we should additionally dismiss the 15 presenting view controller, and pass in NO in the case where we are handing control over to DataDetector. 16 17 * UIProcess/ios/WKActionSheet.h: 18 * UIProcess/ios/WKActionSheet.mm: 19 (-[WKActionSheet doneWithSheet:]): 20 (-[WKActionSheet doneWithSheet]): Deleted. 21 * UIProcess/ios/WKActionSheetAssistant.mm: 22 (-[WKActionSheetAssistant showDataDetectorsSheet]): 23 (-[WKActionSheetAssistant cleanupSheet]): 24 1 25 2017-02-17 Michael Catanzaro <mcatanzaro@igalia.com> 2 26 -
trunk/Source/WebKit2/UIProcess/ios/WKActionSheet.h
r212342 r212574 42 42 @property (nonatomic, assign) id <WKActionSheetDelegate> sheetDelegate; 43 43 @property (nonatomic) UIPopoverArrowDirection arrowDirections; 44 - (void)doneWithSheet ;44 - (void)doneWithSheet:(BOOL)dismiss; 45 45 - (BOOL)presentSheet:(WKActionSheetPresentationStyle)style; 46 46 - (BOOL)presentSheetFromRect:(CGRect)presentationRect; -
trunk/Source/WebKit2/UIProcess/ios/WKActionSheet.mm
r212342 r212574 120 120 } 121 121 122 - (void)doneWithSheet 123 { 124 if ( _currentPresentingViewController)122 - (void)doneWithSheet:(BOOL)dismiss 123 { 124 if (dismiss && _currentPresentingViewController) 125 125 [_currentPresentingViewController dismissViewControllerAnimated:YES completion:nil]; 126 126 -
trunk/Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.mm
r212342 r212574 91 91 UIView *_view; 92 92 BOOL _needsLinkIndicator; 93 BOOL _isPresentingDDUserInterface; 93 94 } 94 95 … … 546 547 for (NSUInteger actionNumber = 0; actionNumber < [dataDetectorsActions count]; actionNumber++) { 547 548 DDAction *action = [dataDetectorsActions objectAtIndex:actionNumber]; 549 RetainPtr<WKActionSheetAssistant> retainedSelf = self; 548 550 _WKElementAction *elementAction = [_WKElementAction elementActionWithTitle:[action localizedName] actionHandler:^(_WKActivatedElementInfo *actionInfo) { 549 [[getDDDetectionControllerClass() sharedController] performAction:action 550 fromAlertController:_interactionSheet.get() 551 interactionDelegate:self]; 551 retainedSelf.get()->_isPresentingDDUserInterface = action.hasUserInterface; 552 [[getDDDetectionControllerClass() sharedController] performAction:action fromAlertController:retainedSelf.get()->_interactionSheet.get() interactionDelegate:retainedSelf.get()]; 552 553 }]; 553 554 elementAction.dismissalHandler = ^{ … … 574 575 [delegate actionSheetAssistantDidStopInteraction:self]; 575 576 576 [_interactionSheet doneWithSheet ];577 [_interactionSheet doneWithSheet:!_isPresentingDDUserInterface]; 577 578 [_interactionSheet setSheetDelegate:nil]; 578 579 _interactionSheet = nil; 579 580 _elementInfo = nil; 580 581 _needsLinkIndicator = NO; 582 _isPresentingDDUserInterface = NO; 581 583 } 582 584
Note: See TracChangeset
for help on using the changeset viewer.