Diff
Modified: trunk/LayoutTests/ChangeLog (235425 => 235426)
--- trunk/LayoutTests/ChangeLog 2018-08-28 15:51:55 UTC (rev 235425)
+++ trunk/LayoutTests/ChangeLog 2018-08-28 16:34:25 UTC (rev 235426)
@@ -1,3 +1,26 @@
+2018-08-28 Aditya Keerthi <akeer...@apple.com>
+
+ [iOS] Support inputmode=none
+ https://bugs.webkit.org/show_bug.cgi?id=188896
+
+ Reviewed by Tim Horton.
+
+ Added new test to verify that the system keyboard does not show for inputs with
+ inputmode=none. Updated existing inputmode tests to reflect the addition of the
+ "none" value.
+
+ * fast/forms/inputmode-attribute-contenteditable-expected.txt:
+ * fast/forms/inputmode-attribute-contenteditable.html:
+ * fast/forms/inputmode-attribute-input-expected.txt:
+ * fast/forms/inputmode-attribute-input.html:
+ * fast/forms/inputmode-attribute-textarea-expected.txt:
+ * fast/forms/inputmode-attribute-textarea.html:
+ * fast/forms/ios/inputmode-none-expected.txt: Added.
+ * fast/forms/ios/inputmode-none.html: Added.
+ * resources/ui-helper.js:
+ (window.UIHelper.activateFormControl):
+ (window.UIHelper.inputViewBounds):
+
2018-08-28 Simon Fraser <simon.fra...@apple.com>
More results.html cleanup
Modified: trunk/LayoutTests/fast/forms/inputmode-attribute-contenteditable-expected.txt (235425 => 235426)
--- trunk/LayoutTests/fast/forms/inputmode-attribute-contenteditable-expected.txt 2018-08-28 15:51:55 UTC (rev 235425)
+++ trunk/LayoutTests/fast/forms/inputmode-attribute-contenteditable-expected.txt 2018-08-28 16:34:25 UTC (rev 235426)
@@ -10,6 +10,9 @@
PASS editor.setAttribute("inputmode", "baz"); editor.inputMode is ""
Valid values:
+PASS editor.inputMode = "none"; editor.inputMode is "none"
+PASS editor.getAttribute("inputmode") is "none"
+PASS editor.setAttribute("inputmode", "none"); editor.inputMode is "none"
PASS editor.inputMode = "text"; editor.inputMode is "text"
PASS editor.getAttribute("inputmode") is "text"
PASS editor.setAttribute("inputmode", "text"); editor.inputMode is "text"
Modified: trunk/LayoutTests/fast/forms/inputmode-attribute-contenteditable.html (235425 => 235426)
--- trunk/LayoutTests/fast/forms/inputmode-attribute-contenteditable.html 2018-08-28 15:51:55 UTC (rev 235425)
+++ trunk/LayoutTests/fast/forms/inputmode-attribute-contenteditable.html 2018-08-28 16:34:25 UTC (rev 235426)
@@ -18,6 +18,9 @@
debug('');
debug('Valid values:');
+shouldBe('editor.inputMode = "none"; editor.inputMode', '"none"');
+shouldBe('editor.getAttribute("inputmode")', '"none"');
+shouldBe('editor.setAttribute("inputmode", "none"); editor.inputMode', '"none"');
shouldBe('editor.inputMode = "text"; editor.inputMode', '"text"');
shouldBe('editor.getAttribute("inputmode")', '"text"');
shouldBe('editor.setAttribute("inputmode", "text"); editor.inputMode', '"text"');
Modified: trunk/LayoutTests/fast/forms/inputmode-attribute-input-expected.txt (235425 => 235426)
--- trunk/LayoutTests/fast/forms/inputmode-attribute-input-expected.txt 2018-08-28 15:51:55 UTC (rev 235425)
+++ trunk/LayoutTests/fast/forms/inputmode-attribute-input-expected.txt 2018-08-28 16:34:25 UTC (rev 235426)
@@ -11,6 +11,9 @@
PASS input.setAttribute("inputmode", "baz"); input.inputMode is ""
Valid values:
+PASS input.inputMode = "none"; input.inputMode is "none"
+PASS input.getAttribute("inputmode") is "none"
+PASS input.setAttribute("inputmode", "none"); input.inputMode is "none"
PASS input.inputMode = "text"; input.inputMode is "text"
PASS input.getAttribute("inputmode") is "text"
PASS input.setAttribute("inputmode", "text"); input.inputMode is "text"
Modified: trunk/LayoutTests/fast/forms/inputmode-attribute-input.html (235425 => 235426)
--- trunk/LayoutTests/fast/forms/inputmode-attribute-input.html 2018-08-28 15:51:55 UTC (rev 235425)
+++ trunk/LayoutTests/fast/forms/inputmode-attribute-input.html 2018-08-28 16:34:25 UTC (rev 235426)
@@ -18,6 +18,9 @@
debug('');
debug('Valid values:');
+shouldBe('input.inputMode = "none"; input.inputMode', '"none"');
+shouldBe('input.getAttribute("inputmode")', '"none"');
+shouldBe('input.setAttribute("inputmode", "none"); input.inputMode', '"none"');
shouldBe('input.inputMode = "text"; input.inputMode', '"text"');
shouldBe('input.getAttribute("inputmode")', '"text"');
shouldBe('input.setAttribute("inputmode", "text"); input.inputMode', '"text"');
Modified: trunk/LayoutTests/fast/forms/inputmode-attribute-textarea-expected.txt (235425 => 235426)
--- trunk/LayoutTests/fast/forms/inputmode-attribute-textarea-expected.txt 2018-08-28 15:51:55 UTC (rev 235425)
+++ trunk/LayoutTests/fast/forms/inputmode-attribute-textarea-expected.txt 2018-08-28 16:34:25 UTC (rev 235426)
@@ -11,6 +11,9 @@
PASS textarea.setAttribute("inputmode", "baz"); textarea.inputMode is ""
Valid values:
+PASS textarea.inputMode = "none"; textarea.inputMode is "none"
+PASS textarea.getAttribute("inputmode") is "none"
+PASS textarea.setAttribute("inputmode", "none"); textarea.inputMode is "none"
PASS textarea.inputMode = "text"; textarea.inputMode is "text"
PASS textarea.getAttribute("inputmode") is "text"
PASS textarea.setAttribute("inputmode", "text"); textarea.inputMode is "text"
Modified: trunk/LayoutTests/fast/forms/inputmode-attribute-textarea.html (235425 => 235426)
--- trunk/LayoutTests/fast/forms/inputmode-attribute-textarea.html 2018-08-28 15:51:55 UTC (rev 235425)
+++ trunk/LayoutTests/fast/forms/inputmode-attribute-textarea.html 2018-08-28 16:34:25 UTC (rev 235426)
@@ -18,6 +18,9 @@
debug('');
debug('Valid values:');
+shouldBe('textarea.inputMode = "none"; textarea.inputMode', '"none"');
+shouldBe('textarea.getAttribute("inputmode")', '"none"');
+shouldBe('textarea.setAttribute("inputmode", "none"); textarea.inputMode', '"none"');
shouldBe('textarea.inputMode = "text"; textarea.inputMode', '"text"');
shouldBe('textarea.getAttribute("inputmode")', '"text"');
shouldBe('textarea.setAttribute("inputmode", "text"); textarea.inputMode', '"text"');
Added: trunk/LayoutTests/fast/forms/ios/inputmode-none-expected.txt (0 => 235426)
--- trunk/LayoutTests/fast/forms/ios/inputmode-none-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/forms/ios/inputmode-none-expected.txt 2018-08-28 16:34:25 UTC (rev 235426)
@@ -0,0 +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 systemKeyboardRect.height > 0 is true
+PASS inputWithSystemKeyboard.value is "Text"
+
+ACTIVATE input with inputmode=none
+PASS systemKeyboardRect.height === 0 is true
+
+TEST enter text in input with inputmode=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].height is 15
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/fast/forms/ios/inputmode-none.html (0 => 235426)
--- trunk/LayoutTests/fast/forms/ios/inputmode-none.html (rev 0)
+++ trunk/LayoutTests/fast/forms/ios/inputmode-none.html 2018-08-28 16:34:25 UTC (rev 235426)
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta name="viewport" content="width=device-width, initial-scale=1">
+<script src=""
+<script src=""
+</head>
+<body _onload_="runTest()">
+<input id="input-keyboard" inputmode="text">
+<input id="input-nokeyboard" inputmode="none">
+<script>
+jsTestIsAsync = true;
+
+async function runTest() {
+ 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.');
+
+ debug('\nACTIVATE input with inputmode=text');
+ await UIHelper.activateFormControl(inputWithSystemKeyboard);
+ systemKeyboardRect = await UIHelper.inputViewBounds();
+ shouldBe('systemKeyboardRect.height > 0', 'true');
+ await UIHelper.enterText("Text");
+ shouldBe('inputWithSystemKeyboard.value', '"Text"');
+
+ debug('\nACTIVATE input with inputmode=none');
+ await UIHelper.activateFormControl(inputWithoutSystemKeyboard);
+ systemKeyboardRect = await UIHelper.inputViewBounds();
+ shouldBe('systemKeyboardRect.height === 0', 'true');
+
+ debug('\nTEST enter text in input with inputmode=none');
+ await UIHelper.enterText("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('');
+ finishJSTest();
+}
+</script>
+</body>
+</html>
Modified: trunk/LayoutTests/imported/w3c/ChangeLog (235425 => 235426)
--- trunk/LayoutTests/imported/w3c/ChangeLog 2018-08-28 15:51:55 UTC (rev 235425)
+++ trunk/LayoutTests/imported/w3c/ChangeLog 2018-08-28 16:34:25 UTC (rev 235426)
@@ -1,3 +1,12 @@
+2018-08-28 Aditya Keerthi <akeer...@apple.com>
+
+ [iOS] Support inputmode=none
+ https://bugs.webkit.org/show_bug.cgi?id=188896
+
+ Reviewed by Tim Horton.
+
+ * web-platform-tests/html/dom/reflection-misc-expected.txt: Rebaseline.
+
2018-08-28 Ali Juma <aj...@chromium.org>
[IntersectionObserver] Schedule intersection observation updates
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/reflection-misc-expected.txt (235425 => 235426)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/reflection-misc-expected.txt 2018-08-28 15:51:55 UTC (rev 235425)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/reflection-misc-expected.txt 2018-08-28 16:34:25 UTC (rev 235426)
@@ -3633,11 +3633,11 @@
PASS undefinedelement.inputMode: setAttribute() to null
PASS undefinedelement.inputMode: setAttribute() to object "test-toString"
PASS undefinedelement.inputMode: setAttribute() to object "test-valueOf"
-FAIL undefinedelement.inputMode: setAttribute() to "none" assert_equals: IDL get expected "none" but got ""
+PASS undefinedelement.inputMode: setAttribute() to "none"
PASS undefinedelement.inputMode: setAttribute() to "xnone"
PASS undefinedelement.inputMode: setAttribute() to "none\0"
PASS undefinedelement.inputMode: setAttribute() to "one"
-FAIL undefinedelement.inputMode: setAttribute() to "NONE" assert_equals: IDL get expected "none" but got ""
+PASS undefinedelement.inputMode: setAttribute() to "NONE"
PASS undefinedelement.inputMode: setAttribute() to "text"
PASS undefinedelement.inputMode: setAttribute() to "xtext"
PASS undefinedelement.inputMode: setAttribute() to "text\0"
@@ -3688,11 +3688,11 @@
PASS undefinedelement.inputMode: IDL set to null
PASS undefinedelement.inputMode: IDL set to object "test-toString"
PASS undefinedelement.inputMode: IDL set to object "test-valueOf"
-FAIL undefinedelement.inputMode: IDL set to "none" assert_equals: IDL get expected "none" but got ""
+PASS undefinedelement.inputMode: IDL set to "none"
PASS undefinedelement.inputMode: IDL set to "xnone"
PASS undefinedelement.inputMode: IDL set to "none\0"
PASS undefinedelement.inputMode: IDL set to "one"
-FAIL undefinedelement.inputMode: IDL set to "NONE" assert_equals: IDL get expected "none" but got ""
+PASS undefinedelement.inputMode: IDL set to "NONE"
PASS undefinedelement.inputMode: IDL set to "text"
PASS undefinedelement.inputMode: IDL set to "xtext"
PASS undefinedelement.inputMode: IDL set to "text\0"
Modified: trunk/LayoutTests/resources/ui-helper.js (235425 => 235426)
--- trunk/LayoutTests/resources/ui-helper.js 2018-08-28 15:51:55 UTC (rev 235425)
+++ trunk/LayoutTests/resources/ui-helper.js 2018-08-28 16:34:25 UTC (rev 235426)
@@ -111,6 +111,25 @@
});
}
+ static activateFormControl(element)
+ {
+ if (!this.isWebKit2() || !this.isIOS())
+ return this.activateElement(element);
+
+ const x = element.offsetLeft + element.offsetWidth / 2;
+ const y = element.offsetTop + element.offsetHeight / 2;
+
+ return new Promise(resolve => {
+ testRunner.runUIScript(`
+ (function() {
+ uiController.didStartFormControlInteractionCallback = function() {
+ uiController.uiScriptComplete("Done");
+ };
+ uiController.singleTapAtPoint(${x}, ${y}, function() { });
+ })()`, resolve);
+ });
+ }
+
static waitForKeyboardToHide()
{
return new Promise(resolve => {
@@ -300,4 +319,18 @@
const uiScript = `uiController.applyAutocorrection(\`${escapedNewText}\`, \`${escapedOldText}\`, () => uiController.uiScriptComplete())`;
return new Promise(resolve => testRunner.runUIScript(uiScript, resolve));
}
+
+ static inputViewBounds()
+ {
+ if (!this.isWebKit2() || !this.isIOS())
+ return Promise.resolve();
+
+ return new Promise(resolve => {
+ testRunner.runUIScript(`(() => {
+ uiController.uiScriptComplete(JSON.stringify(uiController.inputViewBounds));
+ })()`, jsonString => {
+ resolve(JSON.parse(jsonString));
+ });
+ });
+ }
}
Modified: trunk/Source/WebCore/ChangeLog (235425 => 235426)
--- trunk/Source/WebCore/ChangeLog 2018-08-28 15:51:55 UTC (rev 235425)
+++ trunk/Source/WebCore/ChangeLog 2018-08-28 16:34:25 UTC (rev 235426)
@@ -1,3 +1,24 @@
+2018-08-28 Aditya Keerthi <akeer...@apple.com>
+
+ [iOS] Support inputmode=none
+ https://bugs.webkit.org/show_bug.cgi?id=188896
+
+ Reviewed by Tim Horton.
+
+ Updated InputMode.cpp to ensure that "none" is recognized as a valid value for the
+ inputmode attribute. This keyword is useful for content that renders its own
+ keyboard control.
+
+ Spec: https://html.spec.whatwg.org/multipage/interaction.html#input-modalities%3A-the-inputmode-attribute
+
+ Test: fast/forms/ios/inputmode-none.html
+
+ * html/InputMode.cpp:
+ (WebCore::inputModeForAttributeValue):
+ (WebCore::stringForInputMode):
+ (WebCore::InputModeNames::none):
+ * html/InputMode.h:
+
2018-08-28 Ali Juma <aj...@chromium.org>
[IntersectionObserver] Schedule intersection observation updates
Modified: trunk/Source/WebCore/html/InputMode.cpp (235425 => 235426)
--- trunk/Source/WebCore/html/InputMode.cpp 2018-08-28 15:51:55 UTC (rev 235425)
+++ trunk/Source/WebCore/html/InputMode.cpp 2018-08-28 16:34:25 UTC (rev 235426)
@@ -32,6 +32,8 @@
InputMode inputModeForAttributeValue(const AtomicString& value)
{
+ if (equalIgnoringASCIICase(value, InputModeNames::none()))
+ return InputMode::None;
if (equalIgnoringASCIICase(value, InputModeNames::text()))
return InputMode::Text;
if (equalIgnoringASCIICase(value, InputModeNames::tel()))
@@ -55,6 +57,8 @@
switch (mode) {
case InputMode::Unspecified:
return emptyAtom();
+ case InputMode::None:
+ return InputModeNames::none();
case InputMode::Text:
return InputModeNames::text();
case InputMode::Telephone:
@@ -76,6 +80,12 @@
namespace InputModeNames {
+const AtomicString& none()
+{
+ static NeverDestroyed<AtomicString> mode("none", AtomicString::ConstructFromLiteral);
+ return mode;
+}
+
const AtomicString& text()
{
static NeverDestroyed<AtomicString> mode("text", AtomicString::ConstructFromLiteral);
Modified: trunk/Source/WebCore/html/InputMode.h (235425 => 235426)
--- trunk/Source/WebCore/html/InputMode.h 2018-08-28 15:51:55 UTC (rev 235425)
+++ trunk/Source/WebCore/html/InputMode.h 2018-08-28 16:34:25 UTC (rev 235426)
@@ -31,6 +31,7 @@
enum class InputMode : uint8_t {
Unspecified,
+ None,
Text,
Telephone,
Url,
@@ -45,6 +46,7 @@
namespace InputModeNames {
+const AtomicString& none();
const AtomicString& text();
const AtomicString& tel();
const AtomicString& url();
Modified: trunk/Source/WebKit/ChangeLog (235425 => 235426)
--- trunk/Source/WebKit/ChangeLog 2018-08-28 15:51:55 UTC (rev 235425)
+++ trunk/Source/WebKit/ChangeLog 2018-08-28 16:34:25 UTC (rev 235426)
@@ -1,3 +1,27 @@
+2018-08-28 Aditya Keerthi <akeer...@apple.com>
+
+ [iOS] Support inputmode=none
+ https://bugs.webkit.org/show_bug.cgi?id=188896
+
+ Reviewed by Tim Horton.
+
+ inputmode=none is used by content that renders its own keyboard control.
+ Consequently, we should not display the virtual keyboard when a user interacts
+ with an element that has the inputmode attribute set to the "none" value.
+
+ In order to achieve this behavior, we return a UIView with a bounds of CGRectZero
+ as the inputView of the WKContentView when inputmode=none is present. Furthermore,
+ we do not provide an accessory view in this case.
+
+ Updated the logic that zooms and scrolls to a control when it gains focus, as that
+ behavior currently relies on an accessory view being present.
+
+ * UIProcess/ios/WKContentViewInteraction.mm:
+ (-[WKContentView _displayFormNodeInputView]):
+ (-[WKContentView inputView]):
+ (-[WKContentView requiresAccessoryView]):
+ (-[WKContentView textInputTraits]):
+
2018-08-27 Basuke Suzuki <basuke.suz...@sony.com>
[Curl] Enable Proxy Authentication on WebKit.
Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (235425 => 235426)
--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm 2018-08-28 15:51:55 UTC (rev 235425)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm 2018-08-28 16:34:25 UTC (rev 235426)
@@ -1305,7 +1305,7 @@
minimumScale:_assistedNodeInformation.minimumScaleFactor
maximumScale:_assistedNodeInformation.maximumScaleFactorIgnoringAlwaysScalable
allowScaling:_assistedNodeInformation.allowsUserScalingIgnoringAlwaysScalable && !currentUserInterfaceIdiomIsPad()
- forceScroll:[self requiresAccessoryView]];
+ forceScroll:(_assistedNodeInformation.inputMode == InputMode::None) ? !currentUserInterfaceIdiomIsPad() : [self requiresAccessoryView]];
_didAccessoryTabInitiateFocus = NO;
[self _ensureFormAccessoryView];
@@ -1317,6 +1317,9 @@
if (!hasAssistedNode(_assistedNodeInformation))
return nil;
+ if (_assistedNodeInformation.inputMode == InputMode::None)
+ return [[UIView new] autorelease];
+
if (!_inputPeripheral) {
switch (_assistedNodeInformation.elementType) {
case InputType::Select:
@@ -2056,6 +2059,9 @@
if ([_formInputSession accessoryViewShouldNotShow])
return NO;
+ if (_assistedNodeInformation.inputMode == InputMode::None)
+ return NO;
+
switch (_assistedNodeInformation.elementType) {
case InputType::None:
return NO;
@@ -3585,6 +3591,8 @@
[_traits setKeyboardType:UIKeyboardTypeDefault];
}
break;
+ case InputMode::None:
+ break;
case InputMode::Text:
[_traits setKeyboardType:UIKeyboardTypeDefault];
break;