Changeset 259840 in webkit
- Timestamp:
- Apr 9, 2020, 4:58:49 PM (6 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 4 edited
-
ChangeLog (modified) (1 diff)
-
UIProcess/ios/WKContentViewInteraction.h (modified) (1 diff)
-
UIProcess/ios/WKContentViewInteraction.mm (modified) (1 diff)
-
UIProcess/ios/forms/WKFormInputControl.mm (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r259833 r259840 1 2020-04-09 Megan Gardner <megan_gardner@apple.com> 2 3 Popovers are dismissed immediately when they try and bring up the keyboard. 4 https://bugs.webkit.org/show_bug.cgi?id=210230 5 <rdar://problem/60385504> 6 7 Reviewed by Darin Adler. 8 9 When popovers use keyboards we dismiss them because the 10 web view loses firstResponder. We already have ways of 11 retaining focus when we lose first responde, so extend that 12 code to cover the case where a keyboard comes up in a popover. 13 14 We are also callling controlBeginEditing twice on refocusing a 15 popover due to behaviour with touch and syntheticClick, so 16 keep up from presenting the popover twice, and allow for the focus 17 count to be correclty incremented and decremented. 18 19 * UIProcess/ios/WKContentViewInteraction.h: 20 * UIProcess/ios/WKContentViewInteraction.mm: 21 (-[WKContentView preserveFocus]): 22 (-[WKContentView releaseFocus]): 23 * UIProcess/ios/forms/WKFormInputControl.mm: 24 (-[WKDateTimePopover popoverWasDismissed:]): 25 (-[WKDateTimePopover controlBeginEditing]): 26 (-[WKDateTimePopover controlEndEditing]): 27 1 28 2020-04-09 David Kilzer <ddkilzer@apple.com> 2 29 -
trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h
r259091 r259840 531 531 - (void)generateSyntheticEditingCommand:(WebKit::SyntheticEditingCommandType)command; 532 532 533 - (void)preserveFocus; 534 - (void)releaseFocus; 535 533 536 // UIWebFormAccessoryDelegate protocol 534 537 - (void)accessoryDone; -
trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
r259669 r259840 6659 6659 } 6660 6660 6661 - (void)preserveFocus 6662 { 6663 [_webView _incrementFocusPreservationCount]; 6664 } 6665 6666 - (void)releaseFocus 6667 { 6668 [_webView _decrementFocusPreservationCount]; 6669 } 6670 6661 6671 - (void)_preserveFocusWithToken:(id <NSCopying, NSSecureCoding>)token destructively:(BOOL)destructively 6662 6672 { -
trunk/Source/WebKit/UIProcess/ios/forms/WKFormInputControl.mm
r259806 r259840 51 51 RetainPtr<WKDateTimePopoverViewController> _viewController; 52 52 WKContentView *_view; 53 BOOL _presenting; 54 BOOL _preservingFocus; 53 55 } 54 56 - (id)initWithView:(WKContentView *)view datePickerMode:(UIDatePickerMode)mode; … … 335 337 } 336 338 339 - (void)popoverWasDismissed:(WKRotatingPopover *)popover 340 { 341 [super popoverWasDismissed:popover]; 342 343 if (popover == self) { 344 if (_preservingFocus) { 345 [_view releaseFocus]; 346 _preservingFocus = NO; 347 } 348 } 349 } 350 337 351 - (id)initWithView:(WKContentView *)view datePickerMode:(UIDatePickerMode)mode 338 352 { … … 378 392 - (void)controlBeginEditing 379 393 { 380 [self presentPopoverAnimated:NO]; 381 [_viewController.get().innerControl controlBeginEditing]; 394 if (!_presenting) { 395 _presenting = YES; 396 [self presentPopoverAnimated:NO]; 397 [_viewController.get().innerControl controlBeginEditing]; 398 399 if (_view.focusedElementInformation.elementType == InputType::Time || _view.focusedElementInformation.elementType == InputType::DateTimeLocal) { 400 _preservingFocus = YES; 401 [_view preserveFocus]; 402 } 403 } 382 404 } 383 405 384 406 - (void)controlEndEditing 385 407 { 408 _presenting = NO; 386 409 [self dismissPopoverAnimated:NO]; 387 410 [_viewController.get().innerControl controlEndEditing];
Note:
See TracChangeset
for help on using the changeset viewer.