Title: [249051] trunk
Revision
249051
Author
[email protected]
Date
2019-08-23 10:15:42 -0700 (Fri, 23 Aug 2019)

Log Message

Unreviewed, rolling out r249031.

Causes multiple test failures on iOS simulator

Reverted changeset:

"[iOS] Should show input view when became first responder if
keyboard was showing when the view was resigned"
https://bugs.webkit.org/show_bug.cgi?id=200902
https://trac.webkit.org/changeset/249031

Modified Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (249050 => 249051)


--- trunk/LayoutTests/ChangeLog	2019-08-23 17:06:26 UTC (rev 249050)
+++ trunk/LayoutTests/ChangeLog	2019-08-23 17:15:42 UTC (rev 249051)
@@ -1,3 +1,16 @@
+2019-08-23  Russell Epstein  <[email protected]>
+
+        Unreviewed, rolling out r249031.
+
+        Causes multiple test failures on iOS simulator
+
+        Reverted changeset:
+
+        "[iOS] Should show input view when became first responder if
+        keyboard was showing when the view was resigned"
+        https://bugs.webkit.org/show_bug.cgi?id=200902
+        https://trac.webkit.org/changeset/249031
+
 2019-08-23  Megan Gardner  <[email protected]>
 
         Revert delete-in-input-in-iframe.html and typing-in-input-in-iframe.html to original behaviour after r248977 and make associated test autoscroll-input-when-very-zoomed.html more stable

Deleted: trunk/LayoutTests/fast/events/ios/resources/check-keyboard-on-screen.js (249050 => 249051)


--- trunk/LayoutTests/fast/events/ios/resources/check-keyboard-on-screen.js	2019-08-23 17:06:26 UTC (rev 249050)
+++ trunk/LayoutTests/fast/events/ios/resources/check-keyboard-on-screen.js	2019-08-23 17:15:42 UTC (rev 249051)
@@ -1,15 +0,0 @@
-async function checkKeyboardOnScreen()
-{
-    if (await UIHelper.isShowingKeyboard())
-        testPassed("Keyboard is on screen.");
-    else
-        testFailed("Keyboard should be on screen, but is not.");
-}
-
-async function checkKeyboardNotOnScreen()
-{
-    if (await UIHelper.isShowingKeyboard())
-        testFailed("Keyboard should not be on screen, but it is.");
-    else
-        testPassed("Keyboard is not on screen.");
-}

Deleted: trunk/LayoutTests/fast/events/ios/should-not-show-keyboard-for-autofocused-field-when-becoming-first-responder-after-navigation-expected.txt (249050 => 249051)


--- trunk/LayoutTests/fast/events/ios/should-not-show-keyboard-for-autofocused-field-when-becoming-first-responder-after-navigation-expected.txt	2019-08-23 17:06:26 UTC (rev 249050)
+++ trunk/LayoutTests/fast/events/ios/should-not-show-keyboard-for-autofocused-field-when-becoming-first-responder-after-navigation-expected.txt	2019-08-23 17:15:42 UTC (rev 249051)
@@ -1,11 +0,0 @@
-This tests that the software keyboard is not shown for an autofocused text field on becoming first responder after navigating from a page with a focused text field.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS document.activeElement became document.getElementById('input')
-PASS Keyboard is not on screen.
-PASS successfullyParsed is true
-
-TEST COMPLETE
-

Deleted: trunk/LayoutTests/fast/events/ios/should-not-show-keyboard-for-autofocused-field-when-becoming-first-responder-after-navigation.html (249050 => 249051)


--- trunk/LayoutTests/fast/events/ios/should-not-show-keyboard-for-autofocused-field-when-becoming-first-responder-after-navigation.html	2019-08-23 17:06:26 UTC (rev 249050)
+++ trunk/LayoutTests/fast/events/ios/should-not-show-keyboard-for-autofocused-field-when-becoming-first-responder-after-navigation.html	2019-08-23 17:15:42 UTC (rev 249051)
@@ -1,44 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<script src=""
-<script src=""
-<script src=""
-</head>
-<body>
-<input id="input" autofocus> <!-- Only respected on iOS when a hardware keyboard is attached. -->
-<script>
-window.jsTestIsAsync = true;
-
-let inputElement = document.getElementById("input");
-
-async function runTest()
-{
-    if (!window.testRunner) {
-        testFailed("Must be run in WebKitTestRunner.");
-        return;
-    }
-
-    await UIHelper.setHardwareKeyboardAttached(false);
-
-    if (document.location.search == "?checkResult") {
-        async function checkResultAndDone() {
-            await checkKeyboardNotOnScreen();
-            document.body.removeChild(inputElement);
-            finishJSTest();
-        }
-        await UIHelper.becomeFirstResponder();
-        shouldBecomeEqual("document.activeElement", "document.getElementById('input')", checkResultAndDone);
-    } else {
-        await UIHelper.activateElementAndWaitForInputSession(inputElement);
-        await UIHelper.resignFirstResponder();
-        await UIHelper.waitForKeyboardToHide();
-        document.location.href += "?checkResult";
-    }
-}
-
-description("This tests that the software keyboard is not shown for an autofocused text field on becoming first responder after navigating from a page with a focused text field.");
-runTest();
-</script>
-</body>
-</html>

Deleted: trunk/LayoutTests/fast/events/ios/show-keyboard-when-becoming-first-responder-despite-inputmode-none-expected.txt (249050 => 249051)


--- trunk/LayoutTests/fast/events/ios/show-keyboard-when-becoming-first-responder-despite-inputmode-none-expected.txt	2019-08-23 17:06:26 UTC (rev 249050)
+++ trunk/LayoutTests/fast/events/ios/show-keyboard-when-becoming-first-responder-despite-inputmode-none-expected.txt	2019-08-23 17:15:42 UTC (rev 249051)
@@ -1,18 +0,0 @@
-This tests that in a focused text field the software keyboard is hidden and shown when the web view resigns and becomes first responder, respectively, eventhough focusing the text field sets inputmode to "none".
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-
-After tapping <input>:
-PASS Keyboard is on screen.
-
-After resigning first responder:
-PASS Keyboard is not on screen.
-
-After becoming first responder:
-PASS Keyboard is on screen.
-PASS successfullyParsed is true
-
-TEST COMPLETE
-

Deleted: trunk/LayoutTests/fast/events/ios/show-keyboard-when-becoming-first-responder-despite-inputmode-none.html (249050 => 249051)


--- trunk/LayoutTests/fast/events/ios/show-keyboard-when-becoming-first-responder-despite-inputmode-none.html	2019-08-23 17:06:26 UTC (rev 249050)
+++ trunk/LayoutTests/fast/events/ios/show-keyboard-when-becoming-first-responder-despite-inputmode-none.html	2019-08-23 17:15:42 UTC (rev 249051)
@@ -1,48 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<script src=""
-<script src=""
-<script src=""
-</head>
-<body>
-<input id="input">
-<script>
-window.jsTestIsAsync = true;
-
-let inputElement = document.getElementById("input");
-
-async function runTest()
-{
-    if (!window.testRunner) {
-        testFailed("Must be run in WebKitTestRunner.");
-        return;
-    }
-
-    await UIHelper.setHardwareKeyboardAttached(false);
-
-    debug("<br>After tapping &lt;input&gt;:");
-    await UIHelper.activateElementAndWaitForInputSession(inputElement);
-    await checkKeyboardOnScreen();
-
-    debug("<br>After resigning first responder:");
-    await UIHelper.resignFirstResponder();
-    await UIHelper.waitForKeyboardToHide();
-    await checkKeyboardNotOnScreen();
-
-    debug("<br>After becoming first responder:");
-    await UIHelper.becomeFirstResponder();
-    await UIHelper.waitForKeyboardToShow();
-    await checkKeyboardOnScreen();
-
-    document.body.removeChild(inputElement);
-    finishJSTest();
-}
-
-inputElement.addEventListener("focus", () => inputElement.setAttribute("inputmode", "none"), true /* capture phase */);
-
-description("This tests that in a focused text field the software keyboard is hidden and shown when the web view resigns and becomes first responder, respectively, eventhough focusing the text field sets inputmode to &quot;none&quot;.");
-runTest();
-</script>
-</body>
-</html>

Deleted: trunk/LayoutTests/fast/events/ios/show-keyboard-when-becoming-first-responder-expected.txt (249050 => 249051)


--- trunk/LayoutTests/fast/events/ios/show-keyboard-when-becoming-first-responder-expected.txt	2019-08-23 17:06:26 UTC (rev 249050)
+++ trunk/LayoutTests/fast/events/ios/show-keyboard-when-becoming-first-responder-expected.txt	2019-08-23 17:15:42 UTC (rev 249051)
@@ -1,18 +0,0 @@
-This tests that in a focused text field the software keyboard is hidden and shown when the web view resigns and becomes first responder, respectively.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-
-After tapping <input>:
-PASS Keyboard is on screen.
-
-After resigning first responder:
-PASS Keyboard is not on screen.
-
-After becoming first responder:
-PASS Keyboard is on screen.
-PASS successfullyParsed is true
-
-TEST COMPLETE
-

Deleted: trunk/LayoutTests/fast/events/ios/show-keyboard-when-becoming-first-responder.html (249050 => 249051)


--- trunk/LayoutTests/fast/events/ios/show-keyboard-when-becoming-first-responder.html	2019-08-23 17:06:26 UTC (rev 249050)
+++ trunk/LayoutTests/fast/events/ios/show-keyboard-when-becoming-first-responder.html	2019-08-23 17:15:42 UTC (rev 249051)
@@ -1,46 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<script src=""
-<script src=""
-<script src=""
-</head>
-<body>
-<input id="input">
-<script>
-window.jsTestIsAsync = true;
-
-let inputElement = document.getElementById("input");
-
-async function runTest()
-{
-    if (!window.testRunner) {
-        testFailed("Must be run in WebKitTestRunner.");
-        return;
-    }
-
-    await UIHelper.setHardwareKeyboardAttached(false);
-
-    debug("<br>After tapping &lt;input&gt;:");
-    await UIHelper.activateElementAndWaitForInputSession(inputElement);
-    await checkKeyboardOnScreen();
-
-    debug("<br>After resigning first responder:");
-    await UIHelper.resignFirstResponder();
-    await UIHelper.waitForKeyboardToHide();
-    await checkKeyboardNotOnScreen();
-
-    debug("<br>After becoming first responder:");
-    await UIHelper.becomeFirstResponder();
-    await UIHelper.waitForKeyboardToShow();
-    await checkKeyboardOnScreen();
-
-    document.body.removeChild(inputElement);
-    finishJSTest();
-}
-
-description("This tests that in a focused text field the software keyboard is hidden and shown when the web view resigns and becomes first responder, respectively.");
-runTest();
-</script>
-</body>
-</html>

Modified: trunk/LayoutTests/resources/ui-helper.js (249050 => 249051)


--- trunk/LayoutTests/resources/ui-helper.js	2019-08-23 17:06:26 UTC (rev 249050)
+++ trunk/LayoutTests/resources/ui-helper.js	2019-08-23 17:15:42 UTC (rev 249051)
@@ -506,22 +506,6 @@
         });
     }
 
-    static waitForKeyboardToShow()
-    {
-        if (!this.isWebKit2() || !this.isIOSFamily())
-            return Promise.resolve();
-
-        return new Promise(resolve => {
-            testRunner.runUIScript(`
-                (function() {
-                    if (uiController.isShowingKeyboard)
-                        uiController.uiScriptComplete();
-                    else
-                        uiController.didShowKeyboardCallback = () => uiController.uiScriptComplete();
-                })()`, resolve);
-        });
-    }
-
     static getUICaretRect()
     {
         if (!this.isWebKit2() || !this.isIOSFamily())
@@ -807,14 +791,6 @@
         return new Promise(resolve => testRunner.runUIScript(`uiController.resignFirstResponder()`, resolve));
     }
 
-    static becomeFirstResponder()
-    {
-        if (!this.isWebKit2())
-            return Promise.resolve();
-
-        return new Promise(resolve => testRunner.runUIScript(`uiController.becomeFirstResponder()`, resolve));
-    }
-
     static minimumZoomScale()
     {
         if (!this.isWebKit2())

Modified: trunk/Source/WebKit/ChangeLog (249050 => 249051)


--- trunk/Source/WebKit/ChangeLog	2019-08-23 17:06:26 UTC (rev 249050)
+++ trunk/Source/WebKit/ChangeLog	2019-08-23 17:15:42 UTC (rev 249051)
@@ -1,3 +1,16 @@
+2019-08-23  Russell Epstein  <[email protected]>
+
+        Unreviewed, rolling out r249031.
+
+        Causes multiple test failures on iOS simulator
+
+        Reverted changeset:
+
+        "[iOS] Should show input view when became first responder if
+        keyboard was showing when the view was resigned"
+        https://bugs.webkit.org/show_bug.cgi?id=200902
+        https://trac.webkit.org/changeset/249031
+
 2019-08-22  Andy Estes  <[email protected]>
 
         [watchOS] Disable Content Filtering in the simulator build

Modified: trunk/Source/WebKit/UIProcess/PageClient.h (249050 => 249051)


--- trunk/Source/WebKit/UIProcess/PageClient.h	2019-08-23 17:06:26 UTC (rev 249050)
+++ trunk/Source/WebKit/UIProcess/PageClient.h	2019-08-23 17:15:42 UTC (rev 249051)
@@ -388,7 +388,7 @@
     virtual void elementDidFocus(const FocusedElementInformation&, bool userIsInteracting, bool blurPreviousNode, OptionSet<WebCore::ActivityState::Flag> activityStateChanges, API::Object* userData) = 0;
     virtual void updateInputContextAfterBlurringAndRefocusingElement() = 0;
     virtual void elementDidBlur() = 0;
-    virtual void focusedElementDidChangeInputMode(WebCore::InputMode, OptionSet<WebCore::ActivityState::Flag>) = 0;
+    virtual void focusedElementDidChangeInputMode(WebCore::InputMode) = 0;
     virtual void didReceiveEditorStateUpdateAfterFocus() = 0;
     virtual bool isFocusingElement() = 0;
     virtual bool interpretKeyEvent(const NativeWebKeyboardEvent&, bool isCharEvent) = 0;

Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.h (249050 => 249051)


--- trunk/Source/WebKit/UIProcess/WebPageProxy.h	2019-08-23 17:06:26 UTC (rev 249050)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.h	2019-08-23 17:15:42 UTC (rev 249051)
@@ -1945,7 +1945,7 @@
     void elementDidFocus(const FocusedElementInformation&, bool userIsInteracting, bool blurPreviousNode, OptionSet<WebCore::ActivityState::Flag> activityStateChanges, const UserData&);
     void elementDidBlur();
     void updateInputContextAfterBlurringAndRefocusingElement();
-    void focusedElementDidChangeInputMode(WebCore::InputMode, OptionSet<WebCore::ActivityState::Flag>);
+    void focusedElementDidChangeInputMode(WebCore::InputMode);
     void didReleaseAllTouchPoints();
     void didReceiveEditorStateUpdateAfterFocus();
 

Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in (249050 => 249051)


--- trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in	2019-08-23 17:06:26 UTC (rev 249050)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in	2019-08-23 17:15:42 UTC (rev 249051)
@@ -409,7 +409,7 @@
     ElementDidFocus(struct WebKit::FocusedElementInformation information, bool userIsInteracting, bool blurPreviousNode, OptionSet<WebCore::ActivityState::Flag> activityStateChanges, WebKit::UserData userData)
     ElementDidBlur()
     UpdateInputContextAfterBlurringAndRefocusingElement()
-    FocusedElementDidChangeInputMode(enum:uint8_t WebCore::InputMode mode, OptionSet<WebCore::ActivityState::Flag> activityStateChanges)
+    FocusedElementDidChangeInputMode(enum:uint8_t WebCore::InputMode mode)
     ScrollingNodeScrollWillStartScroll()
     ScrollingNodeScrollDidEndScroll()
     ShowInspectorHighlight(struct WebCore::Highlight highlight)

Modified: trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.h (249050 => 249051)


--- trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.h	2019-08-23 17:06:26 UTC (rev 249050)
+++ trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.h	2019-08-23 17:15:42 UTC (rev 249051)
@@ -151,7 +151,7 @@
     void elementDidFocus(const FocusedElementInformation&, bool userIsInteracting, bool blurPreviousNode, OptionSet<WebCore::ActivityState::Flag> activityStateChanges, API::Object* userData) override;
     void updateInputContextAfterBlurringAndRefocusingElement() final;
     void elementDidBlur() override;
-    void focusedElementDidChangeInputMode(WebCore::InputMode, OptionSet<WebCore::ActivityState::Flag>) override;
+    void focusedElementDidChangeInputMode(WebCore::InputMode) override;
     void didReceiveEditorStateUpdateAfterFocus() override;
     bool isFocusingElement() override;
     void selectionDidChange() override;

Modified: trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm (249050 => 249051)


--- trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm	2019-08-23 17:06:26 UTC (rev 249050)
+++ trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm	2019-08-23 17:15:42 UTC (rev 249051)
@@ -573,9 +573,9 @@
     [m_contentView _elementDidBlur];
 }
 
-void PageClientImpl::focusedElementDidChangeInputMode(WebCore::InputMode mode, OptionSet<WebCore::ActivityState::Flag> activityStateChanges)
+void PageClientImpl::focusedElementDidChangeInputMode(WebCore::InputMode mode)
 {
-    [m_contentView _didUpdateInputMode:mode activityStateChanges:activityStateChanges];
+    [m_contentView _didUpdateInputMode:mode];
 }
 
 void PageClientImpl::didReceiveEditorStateUpdateAfterFocus()

Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h (249050 => 249051)


--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h	2019-08-23 17:06:26 UTC (rev 249050)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h	2019-08-23 17:15:42 UTC (rev 249051)
@@ -337,8 +337,6 @@
 #endif
 
     BOOL _keyboardDidRequestDismissal;
-    BOOL _wasResignedWhileShowingInputView;
-    BOOL _shouldShowAutomaticKeyboardUIWhenInputModeNone;
 
 #if USE(UIKIT_KEYBOARD_ADDITIONS)
     BOOL _candidateViewNeedsUpdate;
@@ -464,7 +462,7 @@
 - (void)_updateInputContextAfterBlurringAndRefocusingElement;
 - (void)_elementDidBlur;
 - (void)_hideContextMenuHintContainer;
-- (void)_didUpdateInputMode:(WebCore::InputMode)mode activityStateChanges:(OptionSet<WebCore::ActivityState::Flag>)activityStateChanges;
+- (void)_didUpdateInputMode:(WebCore::InputMode)mode;
 - (void)_didReceiveEditorStateUpdateAfterFocus;
 - (void)_hardwareKeyboardAvailabilityChanged;
 - (void)_selectionChanged;

Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (249050 => 249051)


--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2019-08-23 17:06:26 UTC (rev 249050)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2019-08-23 17:15:42 UTC (rev 249051)
@@ -943,7 +943,6 @@
 
     [self _resetInputViewDeferral];
     _focusedElementInformation = { };
-    _wasResignedWhileShowingInputView = NO;
     
     [_keyboardScrollingAnimator invalidate];
     _keyboardScrollingAnimator = nil;
@@ -1262,8 +1261,7 @@
 
     SetForScope<BOOL> resigningFirstResponderScope { _resigningFirstResponder, YES };
 
-    BOOL wasKeyboardOnScreen = UIPeripheralHost.activeInstance.isOnScreen;
-    [self endEditingAndUpdateFocusAppearanceWithReason:EndEditingReasonResigningFirstResponder]; // May dismiss the keyboard.
+    [self endEditingAndUpdateFocusAppearanceWithReason:EndEditingReasonResigningFirstResponder];
 
     // If the user explicitly dismissed the keyboard then we will lose first responder
     // status only to gain it back again. Just don't resign in that case.
@@ -1275,7 +1273,6 @@
     bool superDidResign = [super resignFirstResponder];
 
     if (superDidResign) {
-        _wasResignedWhileShowingInputView = wasKeyboardOnScreen;
         [self _handleDOMPasteRequestWithResult:WebCore::DOMPasteAccessResponse::DeniedForGesture];
         _page->activityStateDidChange(WebCore::ActivityState::IsFocused);
     }
@@ -1707,7 +1704,7 @@
     // FIXME: We should support inputmode="none" when the hardware keyboard is attached.
     // We currently refrain from doing so because that would prevent UIKit from showing
     // the language picker when pressing the globe key to change the input language.
-    if (_focusedElementInformation.inputMode == WebCore::InputMode::None && !GSEventIsHardwareKeyboardAttached() && !_shouldShowAutomaticKeyboardUIWhenInputModeNone)
+    if (_focusedElementInformation.inputMode == WebCore::InputMode::None && !GSEventIsHardwareKeyboardAttached())
         return NO;
 
     return [self _shouldShowAutomaticKeyboardUIIgnoringInputMode];
@@ -3978,7 +3975,6 @@
 #if USE(UIKIT_KEYBOARD_ADDITIONS)
     _seenHardwareKeyDownInNonEditableElement = NO;
 #endif
-    _wasResignedWhileShowingInputView = NO;
     [self _elementDidBlur];
     [self _cancelLongPressGestureRecognizer];
     [self _hideContextMenuHintContainer];
@@ -5276,16 +5272,6 @@
     }
 }
 
-- (BOOL)isFirstResponderOrBecomingFirstResponder
-{
-    return self.isFirstResponder || _becomingFirstResponder;
-}
-
-- (BOOL)shouldShowInputViewOnPageActivation:(const OptionSet<WebCore::ActivityState::Flag> &)activityStateChanges
-{
-    return [self isFirstResponderOrBecomingFirstResponder] && activityStateChanges.contains(WebCore::ActivityState::IsFocused) && _wasResignedWhileShowingInputView;
-}
-
 - (void)_elementDidFocus:(const WebKit::FocusedElementInformation&)information userIsInteracting:(BOOL)userIsInteracting blurPreviousNode:(BOOL)blurPreviousNode activityStateChanges:(OptionSet<WebCore::ActivityState::Flag>)activityStateChanges userObject:(NSObject <NSSecureCoding> *)userObject
 {
     SetForScope<BOOL> isChangingFocusForScope { _isChangingFocus, hasFocusedElement(_focusedElementInformation) };
@@ -5310,8 +5296,6 @@
     if ([inputDelegate respondsToSelector:@selector(_webView:decidePolicyForFocusedElement:)])
         startInputSessionPolicy = [inputDelegate _webView:_webView decidePolicyForFocusedElement:focusedElementInfo.get()];
 
-    SetForScope<BOOL> shouldShowAutomaticKeyboardUIWhenInputModeNoneScope { _shouldShowAutomaticKeyboardUIWhenInputModeNone, startInputSessionPolicy == _WKFocusStartsInputSessionPolicyAuto && [self shouldShowInputViewOnPageActivation:activityStateChanges] };
-
     BOOL shouldShowInputView = [&] {
         switch (startInputSessionPolicy) {
         case _WKFocusStartsInputSessionPolicyAuto:
@@ -5320,8 +5304,11 @@
             if (userIsInteracting)
                 return YES;
 
-            if ([self isFirstResponderOrBecomingFirstResponder]) {
-                if (_shouldShowAutomaticKeyboardUIWhenInputModeNone)
+            if (self.isFirstResponder || _becomingFirstResponder) {
+                // When the software keyboard is being used to enter an url, only the focus activity state is changing.
+                // In this case, auto focus on the page being navigated to should be disabled, unless a hardware
+                // keyboard is attached.
+                if (activityStateChanges && activityStateChanges != WebCore::ActivityState::IsFocused)
                     return YES;
 
 #if PLATFORM(WATCHOS)
@@ -5535,13 +5522,12 @@
     [self reloadInputViews];
 }
 
-- (void)_didUpdateInputMode:(WebCore::InputMode)mode activityStateChanges:(OptionSet<WebCore::ActivityState::Flag>)activityStateChanges
+- (void)_didUpdateInputMode:(WebCore::InputMode)mode
 {
-    if (!self.inputDelegate || !hasFocusedElement(_focusedElementInformation))
+    if (!self.inputDelegate || _focusedElementInformation.elementType == WebKit::InputType::None)
         return;
 
 #if !PLATFORM(WATCHOS)
-    SetForScope<BOOL> shouldShowAutomaticKeyboardUIWhenInputModeNoneScope { _shouldShowAutomaticKeyboardUIWhenInputModeNone, [self shouldShowInputViewOnPageActivation:activityStateChanges] };
     _focusedElementInformation.inputMode = mode;
     [self reloadInputViews];
 #endif

Modified: trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm (249050 => 249051)


--- trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm	2019-08-23 17:06:26 UTC (rev 249050)
+++ trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm	2019-08-23 17:15:42 UTC (rev 249051)
@@ -932,7 +932,7 @@
     pageClient().elementDidBlur();
 }
 
-void WebPageProxy::focusedElementDidChangeInputMode(WebCore::InputMode mode, OptionSet<WebCore::ActivityState::Flag> activityStateChanges)
+void WebPageProxy::focusedElementDidChangeInputMode(WebCore::InputMode mode)
 {
 #if ENABLE(TOUCH_EVENTS)
     if (m_touchAndPointerEventTracking.isTrackingAnything()) {
@@ -941,7 +941,7 @@
     }
 #endif
 
-    pageClient().focusedElementDidChangeInputMode(mode, activityStateChanges);
+    pageClient().focusedElementDidChangeInputMode(mode);
 }
 
 void WebPageProxy::didReleaseAllTouchPoints()
@@ -949,7 +949,7 @@
     if (!m_pendingInputModeChange)
         return;
 
-    pageClient().focusedElementDidChangeInputMode(*m_pendingInputModeChange, { });
+    pageClient().focusedElementDidChangeInputMode(*m_pendingInputModeChange);
     m_pendingInputModeChange = WTF::nullopt;
 }
 

Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp (249050 => 249051)


--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp	2019-08-23 17:06:26 UTC (rev 249050)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp	2019-08-23 17:15:42 UTC (rev 249051)
@@ -5535,7 +5535,7 @@
     if (!isTextFormControlOrEditableContent(element))
         return;
 
-    send(Messages::WebPageProxy::FocusedElementDidChangeInputMode(mode, m_lastActivityStateChanges));
+    send(Messages::WebPageProxy::FocusedElementDidChangeInputMode(mode));
 #else
     UNUSED_PARAM(mode);
 #endif
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to