[iOS] Automatic focus of input field is flaky
authorpvollan@apple.com <pvollan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 28 Mar 2019 23:30:52 +0000 (23:30 +0000)
committerpvollan@apple.com <pvollan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 28 Mar 2019 23:30:52 +0000 (23:30 +0000)
commitc3031e47386c6262c586fbe9bd0dac6ee8c0352f
tree537f98a43dd14c2a751bec13b0d9b980cc9bee64
parent1b3c78541a9273b74a204e2b50821e9524353081
[iOS] Automatic focus of input field is flaky
https://bugs.webkit.org/show_bug.cgi?id=196302

Reviewed by Brent Fulgham.

Sometimes the status of whether a keyboard is connected can be incorrect, both in the UI process, and in
the WebContent process. Fix this by sending the keyboard status to the WebContent process as part of the
Web page creation parameters. Stop caching the keyboard status in the Web process proxy, and call
[UIKeyboard isInHardwareKeyboardMode] instead, since this method is swizzled in the test harness.

* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode const):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(hardwareKeyboardAvailabilityChangedCallback):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::creationParameters):
* UIProcess/WebPageProxy.h:
* UIProcess/WebProcessProxy.cpp:
* UIProcess/WebProcessProxy.h:
(WebKit::WebProcessProxy::setKeyboardIsAttached): Deleted.
(WebKit::WebProcessProxy::keyboardIsAttached const): Deleted.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::isInHardwareKeyboardMode):
(WebKit::WebPageProxy::applicationWillEnterForeground):
* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebPage/WebPage.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@243630 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit/ChangeLog
Source/WebKit/Shared/WebPageCreationParameters.cpp
Source/WebKit/Shared/WebPageCreationParameters.h
Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
Source/WebKit/UIProcess/WebPageProxy.cpp
Source/WebKit/UIProcess/WebPageProxy.h
Source/WebKit/UIProcess/WebProcessProxy.h
Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm
Source/WebKit/WebProcess/WebPage/WebPage.cpp
Source/WebKit/WebProcess/WebPage/WebPage.h