- Revision
- 244220
- Author
- wenson_hs...@apple.com
- Date
- 2019-04-12 10:30:00 -0700 (Fri, 12 Apr 2019)
Log Message
[iOS] Software keyboard is shown too frequently on some websites
https://bugs.webkit.org/show_bug.cgi?id=195856
<rdar://problem/49191395>
Reviewed by Darin Adler.
Source/WebCore/PAL:
Declare new GraphicsServices SPI.
* pal/spi/ios/GraphicsServicesSPI.h:
Source/WebKit:
On some websites, hidden editable elements are very frequently focused upon user interaction. Currently, this
causes the software keyboard to pop in and out unexpectedly; luckily, these same sites also apply
inputmode="none" to the hidden editable element, which ought to ensure that the software keyboard doesn't appear
when the element is focused.
However, since we disabled support for inputmode="none" in r240497, the software keyboard is no longer
suppressed, and becomes a big nuissance. r240497 removed support for this feature because, when using a hardware
keyboard, pressing the globe key no longer showed UI for switching languages. However, support for inputmode
none makes a much larger impact when a software keyboard is used (since the entire software keyboard animates in
and out), whereas a hardware keyboard only displays an input accessory view. For this reason, we can mitigate
this bug without reintroducing <rdar://problem/47406553> by re-enabling inputmode="none", but only when a
hardware keyboard is not attached.
* UIProcess/API/Cocoa/WKWebView.mm:
(hardwareKeyboardAvailabilityChangedCallback):
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView shouldShowAutomaticKeyboardUI]):
Don't show the keyboard if inputmode is none and a hardware keyboard is not attached.
(-[WKContentView _hardwareKeyboardAvailabilityChanged]):
Reload input views if the inputmode is none to ensure that if a hardware keyboard is attached while editing an
element with inputmode="none", we'll show the input accessory view once again.
Tools:
Add support for attaching or detaching the hardware keyboard on iOS in layout tests.
* DumpRenderTree/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::setHardwareKeyboardAttached):
* TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
* TestRunnerShared/UIScriptContext/UIScriptController.cpp:
(WTR::UIScriptController::setHardwareKeyboardAttached):
* TestRunnerShared/UIScriptContext/UIScriptController.h:
* WebKitTestRunner/Configurations/WebKitTestRunnerApp.xcconfig:
Additionally link against GraphicsServices in WebKitTestRunner.
* WebKitTestRunner/ios/UIScriptControllerIOS.mm:
(WTR::TestController::platformResetStateToConsistentValues):
(WTR::UIScriptController::setHardwareKeyboardAttached):
WebKitLibraries:
Add a symbol for GSEventSetHardwareKeyboardAttached.
* WebKitPrivateFrameworkStubs/iOS/12/GraphicsServices.framework/GraphicsServices.tbd:
LayoutTests:
Fix a failing layout test, which (among other reasons) is currently failing because support for inputmode="none"
is disabled.
* fast/forms/ios/inputmode-none-expected.txt:
* fast/forms/ios/inputmode-none.html:
* resources/ui-helper.js:
Add a UIHelper method for attaching or detaching the hardware keyboard.
(window.UIHelper.setHardwareKeyboardAttached):
(window.UIHelper):
Modified Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (244219 => 244220)
--- trunk/LayoutTests/ChangeLog 2019-04-12 17:12:37 UTC (rev 244219)
+++ trunk/LayoutTests/ChangeLog 2019-04-12 17:30:00 UTC (rev 244220)
@@ -1,3 +1,23 @@
+2019-04-12 Wenson Hsieh <wenson_hs...@apple.com>
+
+ [iOS] Software keyboard is shown too frequently on some websites
+ https://bugs.webkit.org/show_bug.cgi?id=195856
+ <rdar://problem/49191395>
+
+ Reviewed by Darin Adler.
+
+ Fix a failing layout test, which (among other reasons) is currently failing because support for inputmode="none"
+ is disabled.
+
+ * fast/forms/ios/inputmode-none-expected.txt:
+ * fast/forms/ios/inputmode-none.html:
+ * resources/ui-helper.js:
+
+ Add a UIHelper method for attaching or detaching the hardware keyboard.
+
+ (window.UIHelper.setHardwareKeyboardAttached):
+ (window.UIHelper):
+
2019-04-12 Ryan Haddad <ryanhad...@apple.com>
[macOS WK1] ASSERTION FAILED: formData in WebCore::ResourceRequest::doUpdateResourceHTTPBody()
Modified: trunk/LayoutTests/fast/forms/ios/inputmode-none-expected.txt (244219 => 244220)
--- trunk/LayoutTests/fast/forms/ios/inputmode-none-expected.txt 2019-04-12 17:12:37 UTC (rev 244219)
+++ trunk/LayoutTests/fast/forms/ios/inputmode-none-expected.txt 2019-04-12 17:30:00 UTC (rev 244220)
@@ -1,27 +1,27 @@
+
+
This test verifies that the system keyboard is not visible when tapping on an input field with inputmode=none.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
ACTIVATE input with inputmode=text
-PASS textKeyboardHeight = systemKeyboardRect.height; systemKeyboardRect.height > 0 is true
-PASS inputWithSystemKeyboard.value is "Text"
+PASS systemKeyboardRect.height > 0 is true
+PASS inputWithSystemKeyboard.value is 'Text'
ACTIVATE input with inputmode=none
-PASS systemKeyboardRect.height is textKeyboardHeight
+PASS Successfully dismissed keyboard
TEST enter text in input with inputmode=none
-PASS inputWithoutSystemKeyboard.value is "None"
+PASS inputWithoutSystemKeyboard.value is 'None'
TEST selection in input with inputmode=none
PASS selectionRects.length is 1
-PASS selectionRects[0].left is 159
-PASS selectionRects[0].top is 261
-PASS selectionRects[0].width is 28
+PASS selectionRects[0].left is 16
+PASS selectionRects[0].top is 38
+PASS selectionRects[0].width is 27
PASS selectionRects[0].height is 15
-
PASS successfullyParsed is true
TEST COMPLETE
-
+
Modified: trunk/LayoutTests/fast/forms/ios/inputmode-none.html (244219 => 244220)
--- trunk/LayoutTests/fast/forms/ios/inputmode-none.html 2019-04-12 17:12:37 UTC (rev 244219)
+++ trunk/LayoutTests/fast/forms/ios/inputmode-none.html 2019-04-12 17:30:00 UTC (rev 244220)
@@ -1,48 +1,53 @@
-<!DOCTYPE html>
+<!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true ] -->
<html>
<head>
-<meta name="viewport" content="width=device-width, initial-scale=1">
+<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<script src=""
<script src=""
</head>
<body _onload_="runTest()">
-<input id="input-keyboard" inputmode="text">
-<input id="input-nokeyboard" inputmode="none">
+<div><input id="input-keyboard" inputmode="text"></div>
+<div><input id="input-nokeyboard" inputmode="none"></div>
+<pre id="description"></pre>
+<pre id="console"></pre>
<script>
jsTestIsAsync = true;
async function runTest() {
+ await UIHelper.setHardwareKeyboardAttached(false);
inputWithSystemKeyboard = document.getElementById("input-keyboard");
inputWithoutSystemKeyboard = document.getElementById("input-nokeyboard");
- description('This test verifies that the system keyboard is not visible when tapping on an input field with inputmode=none.');
+ description("This test verifies that the system keyboard is not visible when tapping on an input field with inputmode=none.");
- debug('\nACTIVATE input with inputmode=text');
- await UIHelper.activateFormControl(inputWithSystemKeyboard);
+ debug("\nACTIVATE input with inputmode=text");
+ await UIHelper.activateElementAndWaitForInputSession(inputWithSystemKeyboard);
systemKeyboardRect = await UIHelper.inputViewBounds();
- shouldBe('textKeyboardHeight = systemKeyboardRect.height; systemKeyboardRect.height > 0', 'true');
+ shouldBe("systemKeyboardRect.height > 0", "true");
await UIHelper.enterText("Text");
- shouldBe('inputWithSystemKeyboard.value', '"Text"');
+ shouldBe("inputWithSystemKeyboard.value", "'Text'");
- debug('\nACTIVATE input with inputmode=none');
- await UIHelper.activateFormControl(inputWithoutSystemKeyboard);
- systemKeyboardRect = await UIHelper.inputViewBounds();
- shouldBe('systemKeyboardRect.height', 'textKeyboardHeight');
+ debug("\nACTIVATE input with inputmode=none");
+ await UIHelper.activateElement(inputWithoutSystemKeyboard);
+ await UIHelper.waitForKeyboardToHide();
+ testPassed("Successfully dismissed keyboard");
- debug('\nTEST enter text in input with inputmode=none');
+ debug("\nTEST enter text in input with inputmode=none");
await UIHelper.enterText("None");
- shouldBe('inputWithoutSystemKeyboard.value', '"None"');
+ shouldBe("inputWithoutSystemKeyboard.value", "'None'");
- debug('\nTEST selection in input with inputmode=none');
- inputWithoutSystemKeyboard.setSelectionRange(0, inputWithSystemKeyboard.value.length);
- selectionRects = await UIHelper.getUISelectionRects();
- shouldBe('selectionRects.length', '1');
- shouldBe('selectionRects[0].left', '159');
- shouldBe('selectionRects[0].top', '261');
- shouldBe('selectionRects[0].width', '28');
- shouldBe('selectionRects[0].height', '15');
+ debug("\nTEST selection in input with inputmode=none");
+ inputWithoutSystemKeyboard.select();
- debug('');
+ selectionRects = [];
+ while (!selectionRects.length)
+ selectionRects = await UIHelper.getUISelectionViewRects();
+
+ shouldBe("selectionRects.length", "1");
+ shouldBe("selectionRects[0].left", "16");
+ shouldBe("selectionRects[0].top", "38");
+ shouldBe("selectionRects[0].width", "27");
+ shouldBe("selectionRects[0].height", "15");
finishJSTest();
}
</script>
Modified: trunk/LayoutTests/resources/ui-helper.js (244219 => 244220)
--- trunk/LayoutTests/resources/ui-helper.js 2019-04-12 17:12:37 UTC (rev 244219)
+++ trunk/LayoutTests/resources/ui-helper.js 2019-04-12 17:30:00 UTC (rev 244220)
@@ -833,4 +833,9 @@
testRunner.runUIScript("JSON.stringify(uiController.menuRect)", result => resolve(JSON.parse(result)));
});
}
+
+ static setHardwareKeyboardAttached(attached)
+ {
+ return new Promise(resolve => testRunner.runUIScript(`uiController.setHardwareKeyboardAttached(${attached ? "true" : "false"})`, resolve));
+ }
}
Modified: trunk/Source/WebCore/PAL/ChangeLog (244219 => 244220)
--- trunk/Source/WebCore/PAL/ChangeLog 2019-04-12 17:12:37 UTC (rev 244219)
+++ trunk/Source/WebCore/PAL/ChangeLog 2019-04-12 17:30:00 UTC (rev 244220)
@@ -1,3 +1,15 @@
+2019-04-12 Wenson Hsieh <wenson_hs...@apple.com>
+
+ [iOS] Software keyboard is shown too frequently on some websites
+ https://bugs.webkit.org/show_bug.cgi?id=195856
+ <rdar://problem/49191395>
+
+ Reviewed by Darin Adler.
+
+ Declare new GraphicsServices SPI.
+
+ * pal/spi/ios/GraphicsServicesSPI.h:
+
2019-04-10 Antoine Quint <grao...@apple.com>
Enable Pointer Events on watchOS
Modified: trunk/Source/WebCore/PAL/pal/spi/ios/GraphicsServicesSPI.h (244219 => 244220)
--- trunk/Source/WebCore/PAL/pal/spi/ios/GraphicsServicesSPI.h 2019-04-12 17:12:37 UTC (rev 244219)
+++ trunk/Source/WebCore/PAL/pal/spi/ios/GraphicsServicesSPI.h 2019-04-12 17:30:00 UTC (rev 244220)
@@ -46,6 +46,7 @@
typedef struct __GSKeyboard* GSKeyboardRef;
uint32_t GSKeyboardGetModifierState(GSKeyboardRef);
Boolean GSEventIsHardwareKeyboardAttached();
+void GSEventSetHardwareKeyboardAttached(Boolean attached, uint8_t country);
extern const char *kGSEventHardwareKeyboardAvailabilityChangedNotification;
Modified: trunk/Source/WebKit/ChangeLog (244219 => 244220)
--- trunk/Source/WebKit/ChangeLog 2019-04-12 17:12:37 UTC (rev 244219)
+++ trunk/Source/WebKit/ChangeLog 2019-04-12 17:30:00 UTC (rev 244220)
@@ -1,3 +1,37 @@
+2019-04-12 Wenson Hsieh <wenson_hs...@apple.com>
+
+ [iOS] Software keyboard is shown too frequently on some websites
+ https://bugs.webkit.org/show_bug.cgi?id=195856
+ <rdar://problem/49191395>
+
+ Reviewed by Darin Adler.
+
+ On some websites, hidden editable elements are very frequently focused upon user interaction. Currently, this
+ causes the software keyboard to pop in and out unexpectedly; luckily, these same sites also apply
+ inputmode="none" to the hidden editable element, which ought to ensure that the software keyboard doesn't appear
+ when the element is focused.
+
+ However, since we disabled support for inputmode="none" in r240497, the software keyboard is no longer
+ suppressed, and becomes a big nuissance. r240497 removed support for this feature because, when using a hardware
+ keyboard, pressing the globe key no longer showed UI for switching languages. However, support for inputmode
+ none makes a much larger impact when a software keyboard is used (since the entire software keyboard animates in
+ and out), whereas a hardware keyboard only displays an input accessory view. For this reason, we can mitigate
+ this bug without reintroducing <rdar://problem/47406553> by re-enabling inputmode="none", but only when a
+ hardware keyboard is not attached.
+
+ * UIProcess/API/Cocoa/WKWebView.mm:
+ (hardwareKeyboardAvailabilityChangedCallback):
+ * UIProcess/ios/WKContentViewInteraction.h:
+ * UIProcess/ios/WKContentViewInteraction.mm:
+ (-[WKContentView shouldShowAutomaticKeyboardUI]):
+
+ Don't show the keyboard if inputmode is none and a hardware keyboard is not attached.
+
+ (-[WKContentView _hardwareKeyboardAvailabilityChanged]):
+
+ Reload input views if the inputmode is none to ensure that if a hardware keyboard is attached while editing an
+ element with inputmode="none", we'll show the input accessory view once again.
+
2019-04-12 Antoine Quint <grao...@apple.com>
Opt some websites into the simulated mouse events dispatch quirk when in modern compatibility mode
Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm (244219 => 244220)
--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm 2019-04-12 17:12:37 UTC (rev 244219)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm 2019-04-12 17:30:00 UTC (rev 244220)
@@ -3335,6 +3335,7 @@
{
ASSERT(observer);
WKWebView *webView = (__bridge WKWebView *)observer;
+ [webView->_contentView _hardwareKeyboardAvailabilityChanged];
webView._page->hardwareKeyboardAvailabilityChanged(GSEventIsHardwareKeyboardAttached());
}
Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h (244219 => 244220)
--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h 2019-04-12 17:12:37 UTC (rev 244219)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h 2019-04-12 17:30:00 UTC (rev 244220)
@@ -415,6 +415,7 @@
- (void)_elementDidBlur;
- (void)_didUpdateInputMode:(WebCore::InputMode)mode;
- (void)_didReceiveEditorStateUpdateAfterFocus;
+- (void)_hardwareKeyboardAvailabilityChanged;
- (void)_selectionChanged;
- (void)_updateChangedSelection;
- (BOOL)_interpretKeyEvent:(::WebEvent *)theEvent isCharEvent:(BOOL)isCharEvent;
Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (244219 => 244220)
--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm 2019-04-12 17:12:37 UTC (rev 244219)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm 2019-04-12 17:30:00 UTC (rev 244220)
@@ -100,6 +100,7 @@
#import <pal/spi/cg/CoreGraphicsSPI.h>
#import <pal/spi/cocoa/DataDetectorsCoreSPI.h>
#import <pal/spi/ios/DataDetectorsUISPI.h>
+#import <pal/spi/ios/GraphicsServicesSPI.h>
#import <wtf/Optional.h>
#import <wtf/RetainPtr.h>
#import <wtf/SetForScope.h>
@@ -118,7 +119,6 @@
#import "NativeWebMouseEvent.h"
#import <UIKit/UIHoverGestureRecognizer.h>
#import <UIKit/_UILookupGestureRecognizer.h>
-#import <pal/spi/ios/GraphicsServicesSPI.h>
#endif
#if ENABLE(INPUT_TYPE_COLOR)
@@ -1595,7 +1595,12 @@
- (BOOL)shouldShowAutomaticKeyboardUI
{
- // FIXME: Make this function knowledgeable about the HTML attribute inputmode.
+ // 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())
+ return NO;
+
switch (_focusedElementInformation.elementType) {
case WebKit::InputType::None:
case WebKit::InputType::Drawing:
@@ -5133,6 +5138,12 @@
_didAccessoryTabInitiateFocus = NO;
}
+- (void)_hardwareKeyboardAvailabilityChanged
+{
+ if (hasFocusedElement(_focusedElementInformation) && _focusedElementInformation.inputMode == WebCore::InputMode::None)
+ [self reloadInputViews];
+}
+
- (void)_didUpdateInputMode:(WebCore::InputMode)mode
{
if (!self.inputDelegate || _focusedElementInformation.elementType == WebKit::InputType::None)
Modified: trunk/Tools/ChangeLog (244219 => 244220)
--- trunk/Tools/ChangeLog 2019-04-12 17:12:37 UTC (rev 244219)
+++ trunk/Tools/ChangeLog 2019-04-12 17:30:00 UTC (rev 244220)
@@ -1,3 +1,27 @@
+2019-04-12 Wenson Hsieh <wenson_hs...@apple.com>
+
+ [iOS] Software keyboard is shown too frequently on some websites
+ https://bugs.webkit.org/show_bug.cgi?id=195856
+ <rdar://problem/49191395>
+
+ Reviewed by Darin Adler.
+
+ Add support for attaching or detaching the hardware keyboard on iOS in layout tests.
+
+ * DumpRenderTree/ios/UIScriptControllerIOS.mm:
+ (WTR::UIScriptController::setHardwareKeyboardAttached):
+ * TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
+ * TestRunnerShared/UIScriptContext/UIScriptController.cpp:
+ (WTR::UIScriptController::setHardwareKeyboardAttached):
+ * TestRunnerShared/UIScriptContext/UIScriptController.h:
+ * WebKitTestRunner/Configurations/WebKitTestRunnerApp.xcconfig:
+
+ Additionally link against GraphicsServices in WebKitTestRunner.
+
+ * WebKitTestRunner/ios/UIScriptControllerIOS.mm:
+ (WTR::TestController::platformResetStateToConsistentValues):
+ (WTR::UIScriptController::setHardwareKeyboardAttached):
+
2019-04-12 Ludovico de Nittis <ludovico.denit...@collabora.com>
[GTK][WPE] Fix pacman install-dependencies packages
Modified: trunk/Tools/DumpRenderTree/ios/UIScriptControllerIOS.mm (244219 => 244220)
--- trunk/Tools/DumpRenderTree/ios/UIScriptControllerIOS.mm 2019-04-12 17:12:37 UTC (rev 244219)
+++ trunk/Tools/DumpRenderTree/ios/UIScriptControllerIOS.mm 2019-04-12 17:30:00 UTC (rev 244220)
@@ -535,6 +535,10 @@
return nil;
}
+void UIScriptController::setHardwareKeyboardAttached(bool)
+{
}
+}
+
#endif // PLATFORM(IOS_FAMILY)
Modified: trunk/Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl (244219 => 244220)
--- trunk/Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl 2019-04-12 17:12:37 UTC (rev 244219)
+++ trunk/Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl 2019-04-12 17:30:00 UTC (rev 244220)
@@ -311,6 +311,8 @@
void makeWindowContentViewFirstResponder();
readonly attribute boolean isWindowContentViewFirstResponder;
+ void setHardwareKeyboardAttached(boolean attached);
+
object attachmentInfo(DOMString attachmentIdentifier);
// Editing
Modified: trunk/Tools/TestRunnerShared/UIScriptContext/UIScriptController.cpp (244219 => 244220)
--- trunk/Tools/TestRunnerShared/UIScriptContext/UIScriptController.cpp 2019-04-12 17:12:37 UTC (rev 244219)
+++ trunk/Tools/TestRunnerShared/UIScriptContext/UIScriptController.cpp 2019-04-12 17:30:00 UTC (rev 244220)
@@ -638,6 +638,10 @@
{
}
+void UIScriptController::setHardwareKeyboardAttached(bool)
+{
+}
+
#endif
#if !PLATFORM(COCOA)
Modified: trunk/Tools/TestRunnerShared/UIScriptContext/UIScriptController.h (244219 => 244220)
--- trunk/Tools/TestRunnerShared/UIScriptContext/UIScriptController.h 2019-04-12 17:12:37 UTC (rev 244219)
+++ trunk/Tools/TestRunnerShared/UIScriptContext/UIScriptController.h 2019-04-12 17:30:00 UTC (rev 244220)
@@ -240,6 +240,8 @@
JSObjectRef attachmentInfo(JSStringRef attachmentIdentifier);
+ void setHardwareKeyboardAttached(bool);
+
private:
UIScriptController(UIScriptContext&);
Modified: trunk/Tools/WebKitTestRunner/Configurations/WebKitTestRunnerApp.xcconfig (244219 => 244220)
--- trunk/Tools/WebKitTestRunner/Configurations/WebKitTestRunnerApp.xcconfig 2019-04-12 17:12:37 UTC (rev 244219)
+++ trunk/Tools/WebKitTestRunner/Configurations/WebKitTestRunnerApp.xcconfig 2019-04-12 17:30:00 UTC (rev 244220)
@@ -30,7 +30,7 @@
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
-OTHER_LDFLAGS = $(inherited) -lWebKitTestRunner -lWebCoreTestSupport -framework _javascript_Core -framework CoreGraphics -framework QuartzCore -framework ImageIO -framework IOKit -framework UIKit -framework WebKit -framework Foundation;
+OTHER_LDFLAGS = $(inherited) -lWebKitTestRunner -lWebCoreTestSupport -framework _javascript_Core -framework CoreGraphics -framework QuartzCore -framework ImageIO -framework IOKit -framework UIKit -framework WebKit -framework Foundation -framework GraphicsServices;
SKIP_INSTALL[sdk=macosx*] = YES;
Modified: trunk/Tools/WebKitTestRunner/ios/TestControllerIOS.mm (244219 => 244220)
--- trunk/Tools/WebKitTestRunner/ios/TestControllerIOS.mm 2019-04-12 17:12:37 UTC (rev 244219)
+++ trunk/Tools/WebKitTestRunner/ios/TestControllerIOS.mm 2019-04-12 17:30:00 UTC (rev 244220)
@@ -43,6 +43,7 @@
#import <WebKit/WKWebViewConfigurationPrivate.h>
#import <WebKit/WKWebViewPrivate.h>
#import <objc/runtime.h>
+#import <pal/spi/ios/GraphicsServicesSPI.h>
#import <wtf/MainThread.h>
static BOOL overrideIsInHardwareKeyboardMode()
@@ -141,6 +142,7 @@
[[UIApplication sharedApplication] _cancelAllTouches];
[[UIDevice currentDevice] setOrientation:UIDeviceOrientationPortrait animated:NO];
+ GSEventSetHardwareKeyboardAttached(true, 0);
m_inputModeSwizzlers.clear();
m_overriddenKeyboardInputMode = nil;
Modified: trunk/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm (244219 => 244220)
--- trunk/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm 2019-04-12 17:12:37 UTC (rev 244219)
+++ trunk/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm 2019-04-12 17:30:00 UTC (rev 244220)
@@ -42,6 +42,7 @@
#import <WebCore/FloatRect.h>
#import <WebKit/WKWebViewPrivate.h>
#import <WebKit/WebKit.h>
+#import <pal/spi/ios/GraphicsServicesSPI.h>
#import <wtf/SoftLinking.h>
#import <wtf/Vector.h>
@@ -1140,6 +1141,11 @@
return JSValueToObject(jsContext, [JSValue valueWithObject:calendarTypeString inContext:[JSContext contextWithJSGlobalContextRef:jsContext]].JSValueRef, nullptr);
}
+void UIScriptController::setHardwareKeyboardAttached(bool attached)
+{
+ GSEventSetHardwareKeyboardAttached(attached, 0);
}
+}
+
#endif // PLATFORM(IOS_FAMILY)
Modified: trunk/WebKitLibraries/ChangeLog (244219 => 244220)
--- trunk/WebKitLibraries/ChangeLog 2019-04-12 17:12:37 UTC (rev 244219)
+++ trunk/WebKitLibraries/ChangeLog 2019-04-12 17:30:00 UTC (rev 244220)
@@ -1,3 +1,15 @@
+2019-04-12 Wenson Hsieh <wenson_hs...@apple.com>
+
+ [iOS] Software keyboard is shown too frequently on some websites
+ https://bugs.webkit.org/show_bug.cgi?id=195856
+ <rdar://problem/49191395>
+
+ Reviewed by Darin Adler.
+
+ Add a symbol for GSEventSetHardwareKeyboardAttached.
+
+ * WebKitPrivateFrameworkStubs/iOS/12/GraphicsServices.framework/GraphicsServices.tbd:
+
2019-01-01 Jeff Miller <je...@apple.com>
Update user-visible copyright strings to include 2019
Modified: trunk/WebKitLibraries/WebKitPrivateFrameworkStubs/iOS/12/GraphicsServices.framework/GraphicsServices.tbd (244219 => 244220)
--- trunk/WebKitLibraries/WebKitPrivateFrameworkStubs/iOS/12/GraphicsServices.framework/GraphicsServices.tbd 2019-04-12 17:12:37 UTC (rev 244219)
+++ trunk/WebKitLibraries/WebKitPrivateFrameworkStubs/iOS/12/GraphicsServices.framework/GraphicsServices.tbd 2019-04-12 17:30:00 UTC (rev 244220)
@@ -16,6 +16,7 @@
symbols:
- _GSCurrentEventTimestamp
- _GSEventIsHardwareKeyboardAttached
+ - _GSEventSetHardwareKeyboardAttached
- _GSFontInitialize
- _GSFontPurgeFontCache
- _GSInitialize