[Extra zoom mode] Adopt list view controller UI for numeric input types
authorwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 31 Mar 2018 00:12:36 +0000 (00:12 +0000)
committerwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 31 Mar 2018 00:12:36 +0000 (00:12 +0000)
https://bugs.webkit.org/show_bug.cgi?id=184184
<rdar://problem/37238916>

Reviewed by Timothy Hatcher.

Source/WebCore:

Add a localized string for the OK button shown on number pads in extra zoomed form controls.

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

Source/WebKit:

Remove existing logic for presenting a number pad view controller, since number pads will now be handled as a
special case of general text form controls in extra zoom mode.

* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView presentViewControllerForCurrentAssistedNode]):
(-[WKContentView dismissAllInputViewControllers]):
(-[WKContentView _wheelChangedWithEvent:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@230122 268f45cc-cd09-0410-ab3c-d52691b4dbfc

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

index 38cbbd5..9b0948c 100644 (file)
@@ -1,3 +1,18 @@
+2018-03-30  Wenson Hsieh  <wenson_hsieh@apple.com>
+
+        [Extra zoom mode] Adopt list view controller UI for numeric input types
+        https://bugs.webkit.org/show_bug.cgi?id=184184
+        <rdar://problem/37238916>
+
+        Reviewed by Timothy Hatcher.
+
+        Add a localized string for the OK button shown on number pads in extra zoomed form controls.
+
+        * English.lproj/Localizable.strings:
+        * platform/LocalizedStrings.cpp:
+        (WebCore::numberPadOKButtonTitle):
+        * platform/LocalizedStrings.h:
+
 2018-03-30  Ryosuke Niwa  <rniwa@webkit.org>
 
         Copying a list from Microsoft Word to TinyMCE fails when mso-list is the first property
index eeea530..9b40638 100644 (file)
 /* Option in segmented control for inserting a numbered list in text editing */
 "Numbered list" = "Numbered list";
 
+/* Title of the OK button for the number pad in zoomed form controls. */
+"OK (OK button title in extra zoomed number pad)" = "OK";
+
 /* OK button label in document password failure alert */
 "OK (document password failure alert)" = "OK";
 
 /* accessibility help text for hide closed captions button */
 "stop displaying closed captions" = "stop displaying closed captions";
 
-/* Label for the strong password confirmation auto fill button inside a text field. */
-"strong password confirmation auto fill" = "strong password confirmation auto fill";
-
 /* Label for the strong password auto fill button inside a text field. */
 "strong password auto fill" = "strong password auto fill";
 
+/* Label for the strong password confirmation auto fill button inside a text field. */
+"strong password confirmation auto fill" = "strong password confirmation auto fill";
+
 /* The suboptimal value description for a meter element. */
 "suboptimal value" = "suboptimal value";
 
index 357afe7..e8e7f7e 100644 (file)
@@ -1036,6 +1036,11 @@ String webCryptoMasterKeyKeychainComment()
 
 #if ENABLE(EXTRA_ZOOM_MODE)
 
+String numberPadOKButtonTitle()
+{
+    return WEB_UI_STRING_KEY("OK", "OK (OK button title in extra zoomed number pad)", "Title of the OK button for the number pad in zoomed form controls.");
+}
+
 String formControlDoneButtonTitle()
 {
     return WEB_UI_STRING("Done", "Title of the Done button for zoomed form controls.");
index b714a8e..6ae921c 100644 (file)
@@ -317,6 +317,7 @@ namespace WebCore {
 #endif
 
 #if ENABLE(EXTRA_ZOOM_MODE)
+    WEBCORE_EXPORT String numberPadOKButtonTitle();
     WEBCORE_EXPORT String formControlCancelButtonTitle();
     WEBCORE_EXPORT String formControlDoneButtonTitle();
     WEBCORE_EXPORT String formControlHideButtonTitle();
index f8f7393..a3d39ed 100644 (file)
@@ -1,3 +1,20 @@
+2018-03-30  Wenson Hsieh  <wenson_hsieh@apple.com>
+
+        [Extra zoom mode] Adopt list view controller UI for numeric input types
+        https://bugs.webkit.org/show_bug.cgi?id=184184
+        <rdar://problem/37238916>
+
+        Reviewed by Timothy Hatcher.
+
+        Remove existing logic for presenting a number pad view controller, since number pads will now be handled as a
+        special case of general text form controls in extra zoom mode.
+
+        * UIProcess/ios/WKContentViewInteraction.h:
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (-[WKContentView presentViewControllerForCurrentAssistedNode]):
+        (-[WKContentView dismissAllInputViewControllers]):
+        (-[WKContentView _wheelChangedWithEvent:]):
+
 2018-03-30  Dan Bernstein  <mitz@apple.com>
 
         Update availability annotations to match the macOS 10.13.4 and iOS 11.3 GM SDKs
index 718fa18..d4b59de 100644 (file)
@@ -86,7 +86,6 @@ class WebPageProxy;
 #if ENABLE(EXTRA_ZOOM_MODE)
 @class WKDatePickerViewController;
 @class WKFocusedFormControlViewController;
-@class WKNumberPadViewController;
 @class WKSelectMenuListViewController;
 @class WKTextInputListViewController;
 @class WKTimePickerViewController;
@@ -255,7 +254,6 @@ struct WKAutoCorrectionData {
     RetainPtr<WKDatePickerViewController> _datePickerViewController;
     RetainPtr<WKTextInputListViewController> _textInputListViewController;
     RetainPtr<WKFocusedFormControlViewController> _focusedFormControlViewController;
-    RetainPtr<WKNumberPadViewController> _numberPadViewController;
     RetainPtr<WKSelectMenuListViewController> _selectMenuListViewController;
     RetainPtr<WKTimePickerViewController> _timePickerViewController;
 
index 7a28c5a..1182f0a 100644 (file)
@@ -49,7 +49,6 @@
 #import "WKImagePreviewViewController.h"
 #import "WKInspectorNodeSearchGestureRecognizer.h"
 #import "WKNSURLExtras.h"
-#import "WKNumberPadViewController.h"
 #import "WKPreviewActionItemIdentifiers.h"
 #import "WKPreviewActionItemInternal.h"
 #import "WKPreviewElementInfoInternal.h"
@@ -4222,15 +4221,6 @@ static bool isAssistableInputType(InputType type)
     _shouldRestoreFirstResponderStatusAfterLosingFocus = self.isFirstResponder;
 
     switch (_assistedNodeInformation.elementType) {
-    case InputType::Number:
-    case InputType::NumberPad:
-    case InputType::Phone:
-        if (!_numberPadViewController) {
-            _numberPadViewController = adoptNS([[WKNumberPadViewController alloc] initWithText:_assistedNodeInformation.value textSuggestions:@[]]);
-            [_numberPadViewController setDelegate:self];
-            [_focusedFormControlViewController presentViewController:_numberPadViewController.get() animated:YES completion:nil];
-        }
-        break;
     case InputType::Select:
         if (!_selectMenuListViewController) {
             _selectMenuListViewController = adoptNS([[WKSelectMenuListViewController alloc] initWithDelegate:self]);
@@ -4268,9 +4258,6 @@ static bool isAssistableInputType(InputType type)
     if (auto controller = WTFMove(_textInputListViewController))
         [controller dismissViewControllerAnimated:YES completion:nil];
 
-    if (auto controller = WTFMove(_numberPadViewController))
-        [controller dismissViewControllerAnimated:YES completion:nil];
-
     if (auto controller = WTFMove(_selectMenuListViewController))
         [controller dismissViewControllerAnimated:YES completion:nil];
 
@@ -4474,9 +4461,6 @@ static bool isAssistableInputType(InputType type)
 - (void)_wheelChangedWithEvent:(UIEvent *)event
 {
 #if ENABLE(EXTRA_ZOOM_MODE)
-    if ([_numberPadViewController handleWheelEvent:event])
-        return;
-
     if ([_timePickerViewController handleWheelEvent:event])
         return;