WebKit Bugzilla
Attachment 370449 Details for
Bug 198141
: REGRESSION(r245148): Removing inputmode="none" does not bring up software keyboard
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Fixes the bug
bug-198141-20190522150921.patch (text/plain), 6.58 KB, created by
Ryosuke Niwa
on 2019-05-22 15:09:22 PDT
(
hide
)
Description:
Fixes the bug
Filename:
MIME Type:
Creator:
Ryosuke Niwa
Created:
2019-05-22 15:09:22 PDT
Size:
6.58 KB
patch
obsolete
>Subversion Revision: 245597 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 91911cd871a3f8482cfe62e9553417551bed1a64..fe23dd0c8e71550d39370dae59832b05f739c4d2 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,20 @@ >+2019-05-22 Ryosuke Niwa <rniwa@webkit.org> >+ >+ REGRESSION(r245148): Removing inputmode="none" does not bring up software keyboard >+ https://bugs.webkit.org/show_bug.cgi?id=198141 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ r245148 changed _requiresKeyboardWhenFirstResponder to return NO when shouldShowAutomaticKeyboardUI >+ returns NO with regards to software keyboard. This introduced a regression that removing inputmode="none" >+ no longer brings up the software keyboard. Fixed the bug by making it return YES when inputmode="none" >+ is present on an editable element in shouldShowAutomaticKeyboardUI, partially restoring the old behavior. >+ >+ * UIProcess/ios/WKContentViewInteraction.mm: >+ (-[WKContentView shouldShowAutomaticKeyboardUI]): >+ (-[WKContentView _shouldShowAutomaticKeyboardUIIgnoringInputMode]): >+ (-[WKContentView _requiresKeyboardWhenFirstResponder]): >+ > 2019-05-21 Alex Christensen <achristensen@webkit.org> > > Mark WKUIDelegate webView:shouldPreviewElement: and webView:previewingViewControllerForElement:defaultActions: as deprecated >diff --git a/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm b/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >index cce9adbfe4adbc8569da6daded35fca9a22a5b39..c40dd927542145d2e8708b5f67820aec08cf3f75 100644 >--- a/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >+++ b/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >@@ -1634,6 +1634,11 @@ - (BOOL)shouldShowAutomaticKeyboardUI > if (_focusedElementInformation.inputMode == WebCore::InputMode::None && !GSEventIsHardwareKeyboardAttached()) > return NO; > >+ return [self _shouldShowAutomaticKeyboardUIIgnoringInputMode]; >+} >+ >+- (BOOL)_shouldShowAutomaticKeyboardUIIgnoringInputMode >+{ > switch (_focusedElementInformation.elementType) { > case WebKit::InputType::None: > case WebKit::InputType::Drawing: >@@ -1665,7 +1670,7 @@ - (BOOL)_disableAutomaticKeyboardUI > - (BOOL)_requiresKeyboardWhenFirstResponder > { > // FIXME: We should add the logic to handle keyboard visibility during focus redirects. >- return [self shouldShowAutomaticKeyboardUI] >+ return [self _shouldShowAutomaticKeyboardUIIgnoringInputMode] > #if USE(UIKIT_KEYBOARD_ADDITIONS) > || _seenHardwareKeyDownInNonEditableElement > #endif >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 3920a3d34d0c89310aed986ddefb68e830a966db..bd068178df69203e3c5459ab8136b229ca488477 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,15 @@ >+2019-05-22 Ryosuke Niwa <rniwa@webkit.org> >+ >+ REGRESSION(r245148): Removing inputmode="none" does not bring up software keyboard >+ https://bugs.webkit.org/show_bug.cgi?id=198141 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Added a regression test. >+ >+ * fast/forms/ios/inputmode-removing-none-expected.txt: Added. >+ * fast/forms/ios/inputmode-removing-none.html: Added. >+ > 2019-05-21 Antti Koivisto <antti@apple.com> > > RTL/overflow scroll tests fail with async overflow enabled >diff --git a/LayoutTests/fast/forms/ios/inputmode-removing-none-expected.txt b/LayoutTests/fast/forms/ios/inputmode-removing-none-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..b45ac03cf3c7f3d525a0ee8f360dca6ded5d919c >--- /dev/null >+++ b/LayoutTests/fast/forms/ios/inputmode-removing-none-expected.txt >@@ -0,0 +1,18 @@ >+This tests removing inputmode="none" from an input element after the element was focused. >+To manually test, detach a hardware keyboard and tap on the text field below. The software keyboard should come up. >+ >+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". >+ >+ >+ >+ACTIVATE input with inputmode=none >+PASS systemKeyboardRect.height is 0 >+PASS input.value is "hello," >+ >+Removing inputmode=none >+PASS systemKeyboardRect.height > 0 is true >+PASS input.value is "hello, world" >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+ >diff --git a/LayoutTests/fast/forms/ios/inputmode-removing-none.html b/LayoutTests/fast/forms/ios/inputmode-removing-none.html >new file mode 100644 >index 0000000000000000000000000000000000000000..ee6fb4a411762a63819320004e57ea8ef093ce9b >--- /dev/null >+++ b/LayoutTests/fast/forms/ios/inputmode-removing-none.html >@@ -0,0 +1,63 @@ >+<!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true ] --> >+<html> >+<head> >+<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"> >+<script src="../../../resources/js-test.js"></script> >+<script src="../../../resources/ui-helper.js"></script> >+</head> >+<body> >+<input inputmode="none"> >+<script> >+ >+description(`This tests removing inputmode="none" from an input element after the element was focused.<br> >+To manually test, detach a hardware keyboard and tap on the text field below. The software keyboard should come up.`); >+ >+jsTestIsAsync = true; >+ >+const input = document.querySelector('input'); >+if (window.testRunner) >+ window.onload = runTest; >+else >+ input.addEventListener('click', () => this.removeAttribute('inputmode')); >+ >+let systemKeyboardRect; >+async function runTest() { >+ await UIHelper.setHardwareKeyboardAttached(false); >+ >+ // We insert a dummy input element to detect when the keyboard hides for an input element with inputmode="none". >+ const dummyInput = document.createElement('input'); >+ document.body.appendChild(dummyInput); >+ await UIHelper.activateElementAndWaitForInputSession(dummyInput); >+ >+ debug("\nACTIVATE input with inputmode=none"); >+ input.focus(); >+ await UIHelper.activateElement(input); >+ await UIHelper.waitForKeyboardToHide(); >+ systemKeyboardRect = await UIHelper.inputViewBounds(); >+ shouldBe("systemKeyboardRect.height", "0"); >+ >+ await UIHelper.enterText("hello,"); >+ shouldBeEqualToString("input.value", "hello,"); >+ >+ debug("\nRemoving inputmode=none"); >+ input.removeAttribute('inputmode'); >+ >+ await new Promise((resolve) => { >+ window.visualViewport.addEventListener('resize', resolve); >+ setTimeout(resolve, 3000); // Failed. >+ }); >+ >+ systemKeyboardRect = await UIHelper.inputViewBounds(); >+ shouldBeTrue("systemKeyboardRect.height > 0"); >+ >+ await UIHelper.enterText(" world"); >+ shouldBeEqualToString("input.value", "hello, world"); >+ >+ finishJSTest(); >+} >+ >+//setTimeout(finishJSTest, 7000); >+ >+</script> >+</body> >+</html>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
ggaren
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 198141
: 370449