Title: [240497] trunk
Revision
240497
Author
rn...@webkit.org
Date
2019-01-25 12:45:04 -0800 (Fri, 25 Jan 2019)

Log Message

iOS: inputmode="none" disables hardware keyboard's globe key
https://bugs.webkit.org/show_bug.cgi?id=193811
<rdar://problem/47406553>

Reviewed by Wenson Hsieh.

Source/WebKit:

Removed the support for inputmode="none" for now since we need a new SPI from UIKit
to properly implement this feature some time in the future.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _zoomToRevealFocusedElement]):
(-[WKContentView inputView]):
(-[WKContentView requiresAccessoryView]):
(-[WKContentView textInputTraits]):

LayoutTests:

Updated and renamed the test expecting the keyboard to update upon inputmode content attribute changed
to use inputmode="decimal" instead of inputmode="none", and updated another test to expect inputmode="none"
has no effect instead of hiding the keyboard.

* fast/forms/ios/inputmode-change-update-keyboard-expected.txt: Renamed from inputmode-none-removed-expected.txt.
* fast/forms/ios/inputmode-change-update-keyboard.html: Renamed from inputmode-none-removed.html.
* fast/forms/ios/inputmode-none-expected.txt:
* fast/forms/ios/inputmode-none.html:

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (240496 => 240497)


--- trunk/LayoutTests/ChangeLog	2019-01-25 20:39:44 UTC (rev 240496)
+++ trunk/LayoutTests/ChangeLog	2019-01-25 20:45:04 UTC (rev 240497)
@@ -1,3 +1,20 @@
+2019-01-25  Ryosuke Niwa  <rn...@webkit.org>
+
+        iOS: inputmode="none" disables hardware keyboard's globe key
+        https://bugs.webkit.org/show_bug.cgi?id=193811
+        <rdar://problem/47406553>
+
+        Reviewed by Wenson Hsieh.
+
+        Updated and renamed the test expecting the keyboard to update upon inputmode content attribute changed
+        to use inputmode="decimal" instead of inputmode="none", and updated another test to expect inputmode="none"
+        has no effect instead of hiding the keyboard.
+
+        * fast/forms/ios/inputmode-change-update-keyboard-expected.txt: Renamed from inputmode-none-removed-expected.txt.
+        * fast/forms/ios/inputmode-change-update-keyboard.html: Renamed from inputmode-none-removed.html.
+        * fast/forms/ios/inputmode-none-expected.txt:
+        * fast/forms/ios/inputmode-none.html:
+
 2019-01-25  Jonathan Bedard  <jbed...@apple.com>
 
         webkitpy: Implement device type specific expected results (Gardening)

Added: trunk/LayoutTests/fast/forms/ios/inputmode-change-update-keyboard-expected.txt (0 => 240497)


--- trunk/LayoutTests/fast/forms/ios/inputmode-change-update-keyboard-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/forms/ios/inputmode-change-update-keyboard-expected.txt	2019-01-25 20:45:04 UTC (rev 240497)
@@ -0,0 +1,16 @@
+This tests updating inputmode of an input element from "none" to "text". The software keyboard should be updated.
+To manually test, focus the input element below. The software keyboard should show up after 3 seconds
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+inputmode="text"
+PASS textHeight = keyboardRect.height; keyboardRect.height > 0 is true
+
+inputmode="number"
+PASS keyboardRect.height is not textHeight
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
+

Added: trunk/LayoutTests/fast/forms/ios/inputmode-change-update-keyboard.html (0 => 240497)


--- trunk/LayoutTests/fast/forms/ios/inputmode-change-update-keyboard.html	                        (rev 0)
+++ trunk/LayoutTests/fast/forms/ios/inputmode-change-update-keyboard.html	2019-01-25 20:45:04 UTC (rev 240497)
@@ -0,0 +1,68 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
+<script src=""
+<script src=""
+</head>
+<body>
+<input inputmode="text">
+<div id="countdown"></div>
+<script>
+jsTestIsAsync = true;
+
+description('This tests updating inputmode of an input element from "none" to "text". The software keyboard should be updated.<br>'
+    + 'To manually test, focus the input element below. The software keyboard should show up after 3 seconds');
+
+const input = document.querySelector("input");
+if (!window.testRunner) {
+    input.addEventListener('focus', () => {
+        let countdown = 3;
+        const id = setInterval(() => {
+            document.getElementById('countdown').textContent = countdown ? countdown : '';
+            if (!countdown) {
+                clearInterval(id);
+                input.setAttribute('inputmode', 'decimal');
+            }
+            countdown--;
+        }, 1000);
+    });
+}
+
+async function runTest() {
+    debug('inputmode="text"');
+
+    let didResize = () => { };
+    window.visualViewport.addEventListener('resize', () => didResize());
+
+    if (window.testRunner) {
+        await UIHelper.activateFormControl(input);
+        window.keyboardRect = await UIHelper.inputViewBounds();
+        shouldBeTrue('textHeight = keyboardRect.height; keyboardRect.height > 0');
+    } else {
+        await new Promise((resolve) => { didResize = resolve; });
+        shouldBeTrue('textHeight = document.documentElement.clientHeight - visualViewport.height; document.documentElement.clientHeight - visualViewport.height < 100');
+    }
+
+    if (window.testRunner)
+        input.setAttribute('inputmode', 'decimal');
+
+    await new Promise((resolve) => { didResize = resolve; });
+
+    debug('');
+    debug('inputmode="number"');
+
+    if (window.testRunner) {
+        window.keyboardRect = await UIHelper.inputViewBounds();
+        shouldNotBe('keyboardRect.height', 'textHeight');
+    } else
+        shouldNotBe('document.documentElement.clientHeight - visualViewport.height', 'textHeight');
+
+    finishJSTest();
+}
+
+window._onload_ = () => setTimeout(runTest, 0);
+
+</script>
+</body>
+</html>

Modified: trunk/LayoutTests/fast/forms/ios/inputmode-none-expected.txt (240496 => 240497)


--- trunk/LayoutTests/fast/forms/ios/inputmode-none-expected.txt	2019-01-25 20:39:44 UTC (rev 240496)
+++ trunk/LayoutTests/fast/forms/ios/inputmode-none-expected.txt	2019-01-25 20:45:04 UTC (rev 240497)
@@ -5,11 +5,11 @@
 
 
 ACTIVATE input with inputmode=text
-PASS systemKeyboardRect.height > 0 is true
+PASS textKeyboardHeight = systemKeyboardRect.height; systemKeyboardRect.height > 0 is true
 PASS inputWithSystemKeyboard.value is "Text"
 
 ACTIVATE input with inputmode=none
-PASS systemKeyboardRect.height === 0 is true
+PASS systemKeyboardRect.height is textKeyboardHeight
 
 TEST enter text in input with inputmode=none
 PASS inputWithoutSystemKeyboard.value is "None"

Deleted: trunk/LayoutTests/fast/forms/ios/inputmode-none-removed-expected.txt (240496 => 240497)


--- trunk/LayoutTests/fast/forms/ios/inputmode-none-removed-expected.txt	2019-01-25 20:39:44 UTC (rev 240496)
+++ trunk/LayoutTests/fast/forms/ios/inputmode-none-removed-expected.txt	2019-01-25 20:45:04 UTC (rev 240497)
@@ -1,16 +0,0 @@
-This tests updating inputmode of an input element from "none" to "text". The software keyboard should be updated.
-To manually test, focus the input element below. The software keyboard should show up after 3 seconds
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Element has inputmode=none
-PASS keyboardRect.height is 0
-
-inputmode has been removed
-PASS keyboardRect.height > 0 is true
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
-

Deleted: trunk/LayoutTests/fast/forms/ios/inputmode-none-removed.html (240496 => 240497)


--- trunk/LayoutTests/fast/forms/ios/inputmode-none-removed.html	2019-01-25 20:39:44 UTC (rev 240496)
+++ trunk/LayoutTests/fast/forms/ios/inputmode-none-removed.html	2019-01-25 20:45:04 UTC (rev 240497)
@@ -1,68 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
-<script src=""
-<script src=""
-</head>
-<body>
-<input inputmode="none">
-<div id="countdown"></div>
-<script>
-jsTestIsAsync = true;
-
-description('This tests updating inputmode of an input element from "none" to "text". The software keyboard should be updated.<br>'
-    + 'To manually test, focus the input element below. The software keyboard should show up after 3 seconds');
-
-const input = document.querySelector("input");
-if (!window.testRunner) {
-    input.addEventListener('focus', () => {
-        let countdown = 3;
-        const id = setInterval(() => {
-            document.getElementById('countdown').textContent = countdown ? countdown : '';
-            if (!countdown) {
-                clearInterval(id);
-                input.removeAttribute('inputmode');
-            }
-            countdown--;
-        }, 1000);
-    });
-}
-
-async function runTest() {
-    debug('Element has inputmode=none');
-
-    let didResize = () => { };
-    window.visualViewport.addEventListener('resize', () => didResize());
-
-    if (window.testRunner) {
-        await UIHelper.activateFormControl(input);
-        window.keyboardRect = await UIHelper.inputViewBounds();
-        shouldBe('keyboardRect.height', '0');
-    } else {
-        await new Promise((resolve) => { didResize = resolve; });
-        shouldBeTrue('document.documentElement.clientHeight - visualViewport.height < 100');
-    }
-
-    if (window.testRunner)
-        input.removeAttribute('inputmode');
-
-    await new Promise((resolve) => { didResize = resolve; });
-
-    debug('');
-    debug('inputmode has been removed');
-
-    if (window.testRunner) {
-        window.keyboardRect = await UIHelper.inputViewBounds();
-        shouldBeTrue('keyboardRect.height > 0');
-    } else
-        shouldBeTrue('document.documentElement.clientHeight - visualViewport.height > 300');
-
-    finishJSTest();
-}
-
-window._onload_ = () => setTimeout(runTest, 0);
-
-</script>
-</body>
-</html>

Modified: trunk/LayoutTests/fast/forms/ios/inputmode-none.html (240496 => 240497)


--- trunk/LayoutTests/fast/forms/ios/inputmode-none.html	2019-01-25 20:39:44 UTC (rev 240496)
+++ trunk/LayoutTests/fast/forms/ios/inputmode-none.html	2019-01-25 20:45:04 UTC (rev 240497)
@@ -20,7 +20,7 @@
     debug('\nACTIVATE input with inputmode=text');
     await UIHelper.activateFormControl(inputWithSystemKeyboard);
     systemKeyboardRect = await UIHelper.inputViewBounds();
-    shouldBe('systemKeyboardRect.height > 0', 'true');
+    shouldBe('textKeyboardHeight = systemKeyboardRect.height; systemKeyboardRect.height > 0', 'true');
     await UIHelper.enterText("Text");
     shouldBe('inputWithSystemKeyboard.value', '"Text"');
 
@@ -27,7 +27,7 @@
     debug('\nACTIVATE input with inputmode=none');
     await UIHelper.activateFormControl(inputWithoutSystemKeyboard);
     systemKeyboardRect = await UIHelper.inputViewBounds();
-    shouldBe('systemKeyboardRect.height === 0', 'true');
+    shouldBe('systemKeyboardRect.height', 'textKeyboardHeight');
 
     debug('\nTEST enter text in input with inputmode=none');
     await UIHelper.enterText("None");

Modified: trunk/Source/WebKit/ChangeLog (240496 => 240497)


--- trunk/Source/WebKit/ChangeLog	2019-01-25 20:39:44 UTC (rev 240496)
+++ trunk/Source/WebKit/ChangeLog	2019-01-25 20:45:04 UTC (rev 240497)
@@ -1,3 +1,20 @@
+2019-01-25  Ryosuke Niwa  <rn...@webkit.org>
+
+        iOS: inputmode="none" disables hardware keyboard's globe key
+        https://bugs.webkit.org/show_bug.cgi?id=193811
+        <rdar://problem/47406553>
+
+        Reviewed by Wenson Hsieh.
+
+        Removed the support for inputmode="none" for now since we need a new SPI from UIKit
+        to properly implement this feature some time in the future.
+
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (-[WKContentView _zoomToRevealFocusedElement]):
+        (-[WKContentView inputView]):
+        (-[WKContentView requiresAccessoryView]):
+        (-[WKContentView textInputTraits]):
+
 2019-01-25  David Kilzer  <ddkil...@apple.com>
 
         Move soft-linking of Lookup.framework out of LookupSPI.h

Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (240496 => 240497)


--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2019-01-25 20:39:44 UTC (rev 240496)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2019-01-25 20:45:04 UTC (rev 240497)
@@ -1420,7 +1420,7 @@
         minimumScale:_focusedElementInformation.minimumScaleFactor
         maximumScale:_focusedElementInformation.maximumScaleFactorIgnoringAlwaysScalable
         allowScaling:_focusedElementInformation.allowsUserScalingIgnoringAlwaysScalable && !currentUserInterfaceIdiomIsPad()
-        forceScroll:(_focusedElementInformation.inputMode == WebCore::InputMode::None) ? !currentUserInterfaceIdiomIsPad() : [self requiresAccessoryView]];
+        forceScroll:[self requiresAccessoryView]];
 }
 
 - (UIView *)inputView
@@ -1428,9 +1428,6 @@
     if (!hasFocusedElement(_focusedElementInformation))
         return nil;
 
-    if (_focusedElementInformation.inputMode == WebCore::InputMode::None)
-        return [[UIView new] autorelease];
-
     if (!_inputPeripheral) {
         switch (_focusedElementInformation.elementType) {
         case WebKit::InputType::Select:
@@ -2208,9 +2205,6 @@
     if ([_formInputSession customInputAccessoryView])
         return YES;
 
-    if (_focusedElementInformation.inputMode == WebCore::InputMode::None)
-        return NO;
-
     switch (_focusedElementInformation.elementType) {
     case WebKit::InputType::None:
     case WebKit::InputType::Drawing:
@@ -3812,6 +3806,7 @@
     }
 
     switch (_focusedElementInformation.inputMode) {
+    case WebCore::InputMode::None:
     case WebCore::InputMode::Unspecified:
         switch (_focusedElementInformation.elementType) {
         case WebKit::InputType::Phone:
@@ -3849,8 +3844,6 @@
             [_traits setKeyboardType:UIKeyboardTypeDefault];
         }
         break;
-    case WebCore::InputMode::None:
-        break;
     case WebCore::InputMode::Text:
         [_traits setKeyboardType:UIKeyboardTypeDefault];
         break;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to