[Extra zoom mode] Add support for <input type='time'> using time picker UI
authorwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 12 Feb 2018 22:07:10 +0000 (22:07 +0000)
committerwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 12 Feb 2018 22:07:10 +0000 (22:07 +0000)
commit4177542ba207b05077db0e6ecfa5340ac152a4d7
tree2f4e91165740adc754bef71e8b9b0dcd38ba3654
parent1fe415fa147efb552060fd2d47961589d330f93d
[Extra zoom mode] Add support for <input type='time'> using time picker UI
https://bugs.webkit.org/show_bug.cgi?id=182683
<rdar://problem/35143162>

Reviewed by Tim Horton.

Adds support for showing a time picker when an input of type time is focused in extra zoomed mode.

* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _stopAssistingNode]):
(-[WKContentView presentTimePickerViewController:]):
(-[WKContentView dismissTimePickerViewController:]):

Add helpers to dismiss and present the time picker view controller.

(-[WKContentView presentViewControllerForAssistedNode:]):

When focusing InputType::Time, present a time picker. Additionally, tweak the logic here to use the generic text
input view controller as a fallback when the other input view controllers (number pads, select menus and time
pickers thus far) are not relevant. This prevents us from completely being unable to edit form controls that are
currently unsupported.

(-[WKContentView textInputController:didCommitText:]):
(-[WKContentView textInputControllerDidRequestDismissal:]):

Tweak WKContentView for changes to WKTextFormControlViewControllerDelegate.

(-[WKContentView actionNameForFocusedFormControlController:]):

Adjust this implementation to hide the focused form control "Go" button for selects and time inputs. This
currently doesn't work for these form controls because it relies on implicit form submission; this should be
fixed by future changes, after which we should revert this adjustment.

(-[WKContentView _wheelChangedWithEvent:]):

Delegate wheel events to the time picker if needed.

(-[WKContentView textInputController:didRequestDismissalWithAction:]): Deleted.

Renamed to -textInputControllerDidRequestDismissal:.

* UIProcess/ios/forms/WKTimePickerViewController.h: Added.
* UIProcess/ios/forms/WKTimePickerViewController.mm: Added.
* WebKit.xcodeproj/project.pbxproj:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228393 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/ios/WKContentViewInteraction.h
Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
Source/WebKit/UIProcess/ios/forms/WKTimePickerViewController.h [new file with mode: 0644]
Source/WebKit/UIProcess/ios/forms/WKTimePickerViewController.mm [new file with mode: 0644]
Source/WebKit/WebKit.xcodeproj/project.pbxproj