[Extra zoom mode] Implement number pad UI when editing `tel` and `number` inputs
authorwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 5 Feb 2018 21:44:02 +0000 (21:44 +0000)
committerwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 5 Feb 2018 21:44:02 +0000 (21:44 +0000)
commit063365c42343836a9f97cef65942a20ecb6fb179
tree396ad56705fecf644e8994c3cd990e33732fd9c8
parentad86bfbdaabc18a3d78435d19b46dfb61abd38b9
[Extra zoom mode] Implement number pad UI when editing `tel` and `number` inputs
https://bugs.webkit.org/show_bug.cgi?id=182472
<rdar://problem/35143057>

Reviewed by Tim Horton.

Source/WebCore:

Adds a localized string for the "Done" button text in extra zoomed form controls.

* English.lproj/Localizable.strings:
* platform/LocalizedStrings.cpp:
(WebCore::formControlDoneButtonTitle):
* platform/LocalizedStrings.h:

Source/WebKit:

Allows the user to edit numeric input types using a number pad. See below comments for more detail.

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

Dismiss the number pad, if it is present.

(-[WKContentView dismissNumberPadViewController:]):
(-[WKContentView presentNumberPadViewController:]):

Add new helpers for showing and hiding the number pad view controller.

(-[WKContentView presentViewControllerForAssistedNode:]):
(-[WKContentView textInputController:didRequestDismissalWithAction:]):

Dismiss the number pad, if it is present.

(-[WKContentView focusedFormControlControllerDidBeginEditing:]):
(-[WKContentView shouldPresentTextInputViewController:]): Deleted.

Remove -shouldPresentTextInputViewController and replace it with -presentViewControllerForAssistedNode:, which
presents the appropriate view controller given "assisted" node information.

* UIProcess/ios/forms/WKNumberPadView.h: Added.
* UIProcess/ios/forms/WKNumberPadView.mm: Added.
* UIProcess/ios/forms/WKNumberPadViewController.h: Added.
* UIProcess/ios/forms/WKNumberPadViewController.mm: Added.

Add "WebKitAdditions harness" files for the new number pad view and view controller classes.

* WebKit.xcodeproj/project.pbxproj:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228121 268f45cc-cd09-0410-ab3c-d52691b4dbfc
12 files changed:
Source/WebCore/ChangeLog
Source/WebCore/English.lproj/Localizable.strings
Source/WebCore/platform/LocalizedStrings.cpp
Source/WebCore/platform/LocalizedStrings.h
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/ios/WKContentViewInteraction.h
Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
Source/WebKit/UIProcess/ios/forms/WKNumberPadView.h [new file with mode: 0644]
Source/WebKit/UIProcess/ios/forms/WKNumberPadView.mm [new file with mode: 0644]
Source/WebKit/UIProcess/ios/forms/WKNumberPadViewController.h [new file with mode: 0644]
Source/WebKit/UIProcess/ios/forms/WKNumberPadViewController.mm [new file with mode: 0644]
Source/WebKit/WebKit.xcodeproj/project.pbxproj