[Extra zoom mode] Refactor input view controller presentation and dismissal helpers
authorwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 26 Mar 2018 21:00:30 +0000 (21:00 +0000)
committerwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 26 Mar 2018 21:00:30 +0000 (21:00 +0000)
commit7698d4474dba1b560af25588e268746f8f0cda86
tree402f476c8238874f30fe608053372b747538f564
parentde31f6b669ad8ba325758e868d8db6d9b760da83
[Extra zoom mode] Refactor input view controller presentation and dismissal helpers
https://bugs.webkit.org/show_bug.cgi?id=184020
Work towards <rdar://problem/38758727>

Reviewed by Tim Horton.

We currently have separate presentation and dismissal helpers for each type of view controller corresponding to
a focused element type. This is excessive, considering that all of these helpers are only invoked from one place
(either -presentViewControllerForCurrentAssistedNode or -dismissAllInputViewControllers), with the exception of
the focused form control overlay.

This refactoring allows us to then adjust the timing of first responder restoration logic, such that the focused
form control view controller can receive forwarded events from the web view. See below for more detail.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView presentFocusedFormControlViewController:]):
(-[WKContentView dismissFocusedFormControlViewController:]):

Remove logic to restore the web view as first responder.

(-[WKContentView presentViewControllerForCurrentAssistedNode]):
(-[WKContentView dismissAllInputViewControllers]):

Restore first responder after dismissing a view controller that was presented when focusing a form control, only
if the web view was first responder before presentation.

(-[WKContentView presentDatePickerViewController:]): Deleted.
(-[WKContentView dismissDatePickerViewController:]): Deleted.
(-[WKContentView presentTimePickerViewController:]): Deleted.
(-[WKContentView dismissTimePickerViewController:]): Deleted.
(-[WKContentView presentSelectMenuViewController:]): Deleted.
(-[WKContentView dismissSelectMenuViewController:]): Deleted.
(-[WKContentView dismissNumberPadViewController:]): Deleted.
(-[WKContentView presentNumberPadViewController:]): Deleted.
(-[WKContentView presentTextInputViewController:]): Deleted.
(-[WKContentView dismissTextInputViewController:]): Deleted.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229986 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm