Title: [235245] trunk
Revision
235245
Author
[email protected]
Date
2018-08-23 14:24:42 -0700 (Thu, 23 Aug 2018)

Log Message

[iOS] Support the inputmode attribute on contenteditable elements
https://bugs.webkit.org/show_bug.cgi?id=188878

Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

* web-platform-tests/html/dom/reflection-misc-expected.txt: Rebaseline.

Source/WebCore:

The inputmode attribute should apply to contenteditable elements, in addition to
textfield inputs and textareas.

Moved the inputmode attribute from HTMLInputElement.idl and
HTMLTextAreaElement.idl to HTMLElement.idl to reflect the specification.

Also moved all logic to convert between the InputMode enum and string values
into InputMode.cpp to avoid exposing unnecessary details to WebKit. Furthermore,
InputMode::Auto was renamed to InputMode::Unspecified to avoid confusion with the
specification.

Spec: https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute

Tests: fast/forms/inputmode-attribute-contenteditable.html
       fast/forms/inputmode-attribute-input.html
       fast/forms/inputmode-attribute-textarea.html

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* html/HTMLElement.cpp:
(WebCore::HTMLElement::canonicalInputMode const):
(WebCore::HTMLElement::inputMode const):
(WebCore::HTMLElement::setInputMode):
* html/HTMLElement.h:
* html/HTMLElement.idl:
* html/HTMLInputElement.idl:
* html/HTMLTextAreaElement.idl:
* html/HTMLTextFormControlElement.cpp:
* html/HTMLTextFormControlElement.h:
* html/InputMode.cpp: Renamed from Source/WebCore/html/InputModeNames.cpp.
(WebCore::inputModeForAttributeValue):
(WebCore::stringForInputMode):
* html/InputMode.h: Renamed from Source/WebCore/html/InputModeNames.h.

Source/WebKit:

Ensured that the assistedNodeInformation for a contenteditable element reflects
the value of the element's inputmode attribute.

Moved logic to obtain the InputMode from the attribute value into WebCore.

* Shared/AssistedNodeInformation.h:
* UIProcess/ios/WKContentViewInteraction.mm:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::getAssistedNodeInformation):

LayoutTests:

Added additional tests to verify the inputmode attribute is accessible on
HTMLElements.

* fast/forms/inputmode-attribute-contenteditable-expected.txt: Added.
* fast/forms/inputmode-attribute-contenteditable.html: Added.
* fast/forms/inputmode-attribute-input-expected.txt: Renamed from LayoutTests/fast/forms/inputmode-attribute-expected.txt.
* fast/forms/inputmode-attribute-input.html: Renamed from LayoutTests/fast/forms/inputmode-attribute.html.
* fast/forms/inputmode-attribute-textarea-expected.txt: Added.
* fast/forms/inputmode-attribute-textarea.html: Added.
* js/dom/dom-static-property-for-in-iteration-expected.txt: Rebaseline.

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (235244 => 235245)


--- trunk/LayoutTests/ChangeLog	2018-08-23 21:14:17 UTC (rev 235244)
+++ trunk/LayoutTests/ChangeLog	2018-08-23 21:24:42 UTC (rev 235245)
@@ -1,3 +1,21 @@
+2018-08-23  Aditya Keerthi  <[email protected]>
+
+        [iOS] Support the inputmode attribute on contenteditable elements
+        https://bugs.webkit.org/show_bug.cgi?id=188878
+
+        Reviewed by Ryosuke Niwa.
+
+        Added additional tests to verify the inputmode attribute is accessible on
+        HTMLElements.
+
+        * fast/forms/inputmode-attribute-contenteditable-expected.txt: Added.
+        * fast/forms/inputmode-attribute-contenteditable.html: Added.
+        * fast/forms/inputmode-attribute-input-expected.txt: Renamed from LayoutTests/fast/forms/inputmode-attribute-expected.txt.
+        * fast/forms/inputmode-attribute-input.html: Renamed from LayoutTests/fast/forms/inputmode-attribute.html.
+        * fast/forms/inputmode-attribute-textarea-expected.txt: Added.
+        * fast/forms/inputmode-attribute-textarea.html: Added.
+        * js/dom/dom-static-property-for-in-iteration-expected.txt: Rebaseline.
+
 2018-08-22  Ryosuke Niwa  <[email protected]>
 
         Assert in NetworkBlobRegistry::unregisterBlobURL after network process had terminated

Added: trunk/LayoutTests/fast/forms/inputmode-attribute-contenteditable-expected.txt (0 => 235245)


--- trunk/LayoutTests/fast/forms/inputmode-attribute-contenteditable-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/forms/inputmode-attribute-contenteditable-expected.txt	2018-08-23 21:24:42 UTC (rev 235245)
@@ -0,0 +1,43 @@
+Test inputmode attribute on contenteditable element
+
+Missing value default:
+PASS editor.inputMode is ""
+PASS editor.getAttribute("inputmode") is null
+
+Invalid value default:
+PASS editor.inputMode = "foobar"; editor.inputMode is ""
+PASS editor.getAttribute("inputmode") is "foobar"
+PASS editor.setAttribute("inputmode", "baz"); editor.inputMode is ""
+
+Valid values:
+PASS editor.inputMode = "text"; editor.inputMode is "text"
+PASS editor.getAttribute("inputmode") is "text"
+PASS editor.setAttribute("inputmode", "text"); editor.inputMode is "text"
+PASS editor.inputMode = "tel"; editor.inputMode is "tel"
+PASS editor.getAttribute("inputmode") is "tel"
+PASS editor.setAttribute("inputmode", "tel"); editor.inputMode is "tel"
+PASS editor.inputMode = "url"; editor.inputMode is "url"
+PASS editor.getAttribute("inputmode") is "url"
+PASS editor.setAttribute("inputmode", "url"); editor.inputMode is "url"
+PASS editor.inputMode = "email"; editor.inputMode is "email"
+PASS editor.getAttribute("inputmode") is "email"
+PASS editor.setAttribute("inputmode", "email"); editor.inputMode is "email"
+PASS editor.inputMode = "numeric"; editor.inputMode is "numeric"
+PASS editor.getAttribute("inputmode") is "numeric"
+PASS editor.setAttribute("inputmode", "numeric"); editor.inputMode is "numeric"
+PASS editor.inputMode = "decimal"; editor.inputMode is "decimal"
+PASS editor.getAttribute("inputmode") is "decimal"
+PASS editor.setAttribute("inputmode", "decimal"); editor.inputMode is "decimal"
+PASS editor.inputMode = "search"; editor.inputMode is "search"
+PASS editor.getAttribute("inputmode") is "search"
+PASS editor.setAttribute("inputmode", "search"); editor.inputMode is "search"
+
+Valid case-insensitive values:
+PASS editor.inputMode = "tExt"; editor.inputMode is "text"
+PASS editor.getAttribute("inputmode") is "tExt"
+PASS editor.setAttribute("inputmode", "tExt"); editor.inputMode is "text"
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/fast/forms/inputmode-attribute-contenteditable.html (0 => 235245)


--- trunk/LayoutTests/fast/forms/inputmode-attribute-contenteditable.html	                        (rev 0)
+++ trunk/LayoutTests/fast/forms/inputmode-attribute-contenteditable.html	2018-08-23 21:24:42 UTC (rev 235245)
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<html>
+<body>
+<script src=""
+<p>Test inputmode attribute on contenteditable element</p>
+<div id=editor contenteditable></div>
+<div id=console></div>
+<script>
+debug('Missing value default:');
+shouldBe('editor.inputMode', '""');
+shouldBeNull('editor.getAttribute("inputmode")');
+
+debug('');
+debug('Invalid value default:');
+shouldBe('editor.inputMode = "foobar"; editor.inputMode', '""');
+shouldBe('editor.getAttribute("inputmode")', '"foobar"');
+shouldBe('editor.setAttribute("inputmode", "baz"); editor.inputMode', '""');
+
+debug('');
+debug('Valid values:');
+shouldBe('editor.inputMode = "text"; editor.inputMode', '"text"');
+shouldBe('editor.getAttribute("inputmode")', '"text"');
+shouldBe('editor.setAttribute("inputmode", "text"); editor.inputMode', '"text"');
+shouldBe('editor.inputMode = "tel"; editor.inputMode', '"tel"');
+shouldBe('editor.getAttribute("inputmode")', '"tel"');
+shouldBe('editor.setAttribute("inputmode", "tel"); editor.inputMode', '"tel"');
+shouldBe('editor.inputMode = "url"; editor.inputMode', '"url"');
+shouldBe('editor.getAttribute("inputmode")', '"url"');
+shouldBe('editor.setAttribute("inputmode", "url"); editor.inputMode', '"url"');
+shouldBe('editor.inputMode = "email"; editor.inputMode', '"email"');
+shouldBe('editor.getAttribute("inputmode")', '"email"');
+shouldBe('editor.setAttribute("inputmode", "email"); editor.inputMode', '"email"');
+shouldBe('editor.inputMode = "numeric"; editor.inputMode', '"numeric"');
+shouldBe('editor.getAttribute("inputmode")', '"numeric"');
+shouldBe('editor.setAttribute("inputmode", "numeric"); editor.inputMode', '"numeric"');
+shouldBe('editor.inputMode = "decimal"; editor.inputMode', '"decimal"');
+shouldBe('editor.getAttribute("inputmode")', '"decimal"');
+shouldBe('editor.setAttribute("inputmode", "decimal"); editor.inputMode', '"decimal"');
+shouldBe('editor.inputMode = "search"; editor.inputMode', '"search"');
+shouldBe('editor.getAttribute("inputmode")', '"search"');
+shouldBe('editor.setAttribute("inputmode", "search"); editor.inputMode', '"search"');
+
+debug('');
+debug('Valid case-insensitive values:');
+shouldBe('editor.inputMode = "tExt"; editor.inputMode', '"text"');
+shouldBe('editor.getAttribute("inputmode")', '"tExt"');
+shouldBe('editor.setAttribute("inputmode", "tExt"); editor.inputMode', '"text"');
+
+debug('');
+</script>
+<script src=""
+</body>
+</html>

Deleted: trunk/LayoutTests/fast/forms/inputmode-attribute-expected.txt (235244 => 235245)


--- trunk/LayoutTests/fast/forms/inputmode-attribute-expected.txt	2018-08-23 21:14:17 UTC (rev 235244)
+++ trunk/LayoutTests/fast/forms/inputmode-attribute-expected.txt	2018-08-23 21:24:42 UTC (rev 235245)
@@ -1,44 +0,0 @@
-Test inputmode attribute
-
-
-Missing value default:
-PASS input.inputMode is ""
-PASS input.getAttribute("inputmode") is null
-
-Invalid value default:
-PASS input.inputMode = "foobar"; input.inputMode is ""
-PASS input.getAttribute("inputmode") is "foobar"
-PASS input.setAttribute("inputmode", "baz"); input.inputMode is ""
-
-Valid values:
-PASS input.inputMode = "text"; input.inputMode is "text"
-PASS input.getAttribute("inputmode") is "text"
-PASS input.setAttribute("inputmode", "text"); input.inputMode is "text"
-PASS input.inputMode = "tel"; input.inputMode is "tel"
-PASS input.getAttribute("inputmode") is "tel"
-PASS input.setAttribute("inputmode", "tel"); input.inputMode is "tel"
-PASS input.inputMode = "url"; input.inputMode is "url"
-PASS input.getAttribute("inputmode") is "url"
-PASS input.setAttribute("inputmode", "url"); input.inputMode is "url"
-PASS input.inputMode = "email"; input.inputMode is "email"
-PASS input.getAttribute("inputmode") is "email"
-PASS input.setAttribute("inputmode", "email"); input.inputMode is "email"
-PASS input.inputMode = "numeric"; input.inputMode is "numeric"
-PASS input.getAttribute("inputmode") is "numeric"
-PASS input.setAttribute("inputmode", "numeric"); input.inputMode is "numeric"
-PASS input.inputMode = "decimal"; input.inputMode is "decimal"
-PASS input.getAttribute("inputmode") is "decimal"
-PASS input.setAttribute("inputmode", "decimal"); input.inputMode is "decimal"
-PASS input.inputMode = "search"; input.inputMode is "search"
-PASS input.getAttribute("inputmode") is "search"
-PASS input.setAttribute("inputmode", "search"); input.inputMode is "search"
-
-Valid case-insensitive values:
-PASS input.inputMode = "tExt"; input.inputMode is "text"
-PASS input.getAttribute("inputmode") is "tExt"
-PASS input.setAttribute("inputmode", "tExt"); input.inputMode is "text"
-
-PASS successfullyParsed is true
-
-TEST COMPLETE
-

Copied: trunk/LayoutTests/fast/forms/inputmode-attribute-input-expected.txt (from rev 235243, trunk/LayoutTests/fast/forms/inputmode-attribute-expected.txt) (0 => 235245)


--- trunk/LayoutTests/fast/forms/inputmode-attribute-input-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/forms/inputmode-attribute-input-expected.txt	2018-08-23 21:24:42 UTC (rev 235245)
@@ -0,0 +1,44 @@
+Test inputmode attribute on input
+
+
+Missing value default:
+PASS input.inputMode is ""
+PASS input.getAttribute("inputmode") is null
+
+Invalid value default:
+PASS input.inputMode = "foobar"; input.inputMode is ""
+PASS input.getAttribute("inputmode") is "foobar"
+PASS input.setAttribute("inputmode", "baz"); input.inputMode is ""
+
+Valid values:
+PASS input.inputMode = "text"; input.inputMode is "text"
+PASS input.getAttribute("inputmode") is "text"
+PASS input.setAttribute("inputmode", "text"); input.inputMode is "text"
+PASS input.inputMode = "tel"; input.inputMode is "tel"
+PASS input.getAttribute("inputmode") is "tel"
+PASS input.setAttribute("inputmode", "tel"); input.inputMode is "tel"
+PASS input.inputMode = "url"; input.inputMode is "url"
+PASS input.getAttribute("inputmode") is "url"
+PASS input.setAttribute("inputmode", "url"); input.inputMode is "url"
+PASS input.inputMode = "email"; input.inputMode is "email"
+PASS input.getAttribute("inputmode") is "email"
+PASS input.setAttribute("inputmode", "email"); input.inputMode is "email"
+PASS input.inputMode = "numeric"; input.inputMode is "numeric"
+PASS input.getAttribute("inputmode") is "numeric"
+PASS input.setAttribute("inputmode", "numeric"); input.inputMode is "numeric"
+PASS input.inputMode = "decimal"; input.inputMode is "decimal"
+PASS input.getAttribute("inputmode") is "decimal"
+PASS input.setAttribute("inputmode", "decimal"); input.inputMode is "decimal"
+PASS input.inputMode = "search"; input.inputMode is "search"
+PASS input.getAttribute("inputmode") is "search"
+PASS input.setAttribute("inputmode", "search"); input.inputMode is "search"
+
+Valid case-insensitive values:
+PASS input.inputMode = "tExt"; input.inputMode is "text"
+PASS input.getAttribute("inputmode") is "tExt"
+PASS input.setAttribute("inputmode", "tExt"); input.inputMode is "text"
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Copied: trunk/LayoutTests/fast/forms/inputmode-attribute-input.html (from rev 235243, trunk/LayoutTests/fast/forms/inputmode-attribute.html) (0 => 235245)


--- trunk/LayoutTests/fast/forms/inputmode-attribute-input.html	                        (rev 0)
+++ trunk/LayoutTests/fast/forms/inputmode-attribute-input.html	2018-08-23 21:24:42 UTC (rev 235245)
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<html>
+<body>
+<script src=""
+<p>Test inputmode attribute on input</p>
+<input id="input">
+<div id=console></div>
+<script>
+debug('Missing value default:');
+shouldBe('input.inputMode', '""');
+shouldBeNull('input.getAttribute("inputmode")');
+
+debug('');
+debug('Invalid value default:');
+shouldBe('input.inputMode = "foobar"; input.inputMode', '""');
+shouldBe('input.getAttribute("inputmode")', '"foobar"');
+shouldBe('input.setAttribute("inputmode", "baz"); input.inputMode', '""');
+
+debug('');
+debug('Valid values:');
+shouldBe('input.inputMode = "text"; input.inputMode', '"text"');
+shouldBe('input.getAttribute("inputmode")', '"text"');
+shouldBe('input.setAttribute("inputmode", "text"); input.inputMode', '"text"');
+shouldBe('input.inputMode = "tel"; input.inputMode', '"tel"');
+shouldBe('input.getAttribute("inputmode")', '"tel"');
+shouldBe('input.setAttribute("inputmode", "tel"); input.inputMode', '"tel"');
+shouldBe('input.inputMode = "url"; input.inputMode', '"url"');
+shouldBe('input.getAttribute("inputmode")', '"url"');
+shouldBe('input.setAttribute("inputmode", "url"); input.inputMode', '"url"');
+shouldBe('input.inputMode = "email"; input.inputMode', '"email"');
+shouldBe('input.getAttribute("inputmode")', '"email"');
+shouldBe('input.setAttribute("inputmode", "email"); input.inputMode', '"email"');
+shouldBe('input.inputMode = "numeric"; input.inputMode', '"numeric"');
+shouldBe('input.getAttribute("inputmode")', '"numeric"');
+shouldBe('input.setAttribute("inputmode", "numeric"); input.inputMode', '"numeric"');
+shouldBe('input.inputMode = "decimal"; input.inputMode', '"decimal"');
+shouldBe('input.getAttribute("inputmode")', '"decimal"');
+shouldBe('input.setAttribute("inputmode", "decimal"); input.inputMode', '"decimal"');
+shouldBe('input.inputMode = "search"; input.inputMode', '"search"');
+shouldBe('input.getAttribute("inputmode")', '"search"');
+shouldBe('input.setAttribute("inputmode", "search"); input.inputMode', '"search"');
+
+debug('');
+debug('Valid case-insensitive values:');
+shouldBe('input.inputMode = "tExt"; input.inputMode', '"text"');
+shouldBe('input.getAttribute("inputmode")', '"tExt"');
+shouldBe('input.setAttribute("inputmode", "tExt"); input.inputMode', '"text"');
+
+debug('');
+</script>
+<script src=""
+</body>
+</html>

Added: trunk/LayoutTests/fast/forms/inputmode-attribute-textarea-expected.txt (0 => 235245)


--- trunk/LayoutTests/fast/forms/inputmode-attribute-textarea-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/forms/inputmode-attribute-textarea-expected.txt	2018-08-23 21:24:42 UTC (rev 235245)
@@ -0,0 +1,44 @@
+Test inputmode attribute on textarea
+
+
+Missing value default:
+PASS textarea.inputMode is ""
+PASS textarea.getAttribute("inputmode") is null
+
+Invalid value default:
+PASS textarea.inputMode = "foobar"; textarea.inputMode is ""
+PASS textarea.getAttribute("inputmode") is "foobar"
+PASS textarea.setAttribute("inputmode", "baz"); textarea.inputMode is ""
+
+Valid values:
+PASS textarea.inputMode = "text"; textarea.inputMode is "text"
+PASS textarea.getAttribute("inputmode") is "text"
+PASS textarea.setAttribute("inputmode", "text"); textarea.inputMode is "text"
+PASS textarea.inputMode = "tel"; textarea.inputMode is "tel"
+PASS textarea.getAttribute("inputmode") is "tel"
+PASS textarea.setAttribute("inputmode", "tel"); textarea.inputMode is "tel"
+PASS textarea.inputMode = "url"; textarea.inputMode is "url"
+PASS textarea.getAttribute("inputmode") is "url"
+PASS textarea.setAttribute("inputmode", "url"); textarea.inputMode is "url"
+PASS textarea.inputMode = "email"; textarea.inputMode is "email"
+PASS textarea.getAttribute("inputmode") is "email"
+PASS textarea.setAttribute("inputmode", "email"); textarea.inputMode is "email"
+PASS textarea.inputMode = "numeric"; textarea.inputMode is "numeric"
+PASS textarea.getAttribute("inputmode") is "numeric"
+PASS textarea.setAttribute("inputmode", "numeric"); textarea.inputMode is "numeric"
+PASS textarea.inputMode = "decimal"; textarea.inputMode is "decimal"
+PASS textarea.getAttribute("inputmode") is "decimal"
+PASS textarea.setAttribute("inputmode", "decimal"); textarea.inputMode is "decimal"
+PASS textarea.inputMode = "search"; textarea.inputMode is "search"
+PASS textarea.getAttribute("inputmode") is "search"
+PASS textarea.setAttribute("inputmode", "search"); textarea.inputMode is "search"
+
+Valid case-insensitive values:
+PASS textarea.inputMode = "tExt"; textarea.inputMode is "text"
+PASS textarea.getAttribute("inputmode") is "tExt"
+PASS textarea.setAttribute("inputmode", "tExt"); textarea.inputMode is "text"
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/fast/forms/inputmode-attribute-textarea.html (0 => 235245)


--- trunk/LayoutTests/fast/forms/inputmode-attribute-textarea.html	                        (rev 0)
+++ trunk/LayoutTests/fast/forms/inputmode-attribute-textarea.html	2018-08-23 21:24:42 UTC (rev 235245)
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<html>
+<body>
+<script src=""
+<p>Test inputmode attribute on textarea</p>
+<textarea id="textarea"></textarea>
+<div id=console></div>
+<script>
+debug('Missing value default:');
+shouldBe('textarea.inputMode', '""');
+shouldBeNull('textarea.getAttribute("inputmode")');
+
+debug('');
+debug('Invalid value default:');
+shouldBe('textarea.inputMode = "foobar"; textarea.inputMode', '""');
+shouldBe('textarea.getAttribute("inputmode")', '"foobar"');
+shouldBe('textarea.setAttribute("inputmode", "baz"); textarea.inputMode', '""');
+
+debug('');
+debug('Valid values:');
+shouldBe('textarea.inputMode = "text"; textarea.inputMode', '"text"');
+shouldBe('textarea.getAttribute("inputmode")', '"text"');
+shouldBe('textarea.setAttribute("inputmode", "text"); textarea.inputMode', '"text"');
+shouldBe('textarea.inputMode = "tel"; textarea.inputMode', '"tel"');
+shouldBe('textarea.getAttribute("inputmode")', '"tel"');
+shouldBe('textarea.setAttribute("inputmode", "tel"); textarea.inputMode', '"tel"');
+shouldBe('textarea.inputMode = "url"; textarea.inputMode', '"url"');
+shouldBe('textarea.getAttribute("inputmode")', '"url"');
+shouldBe('textarea.setAttribute("inputmode", "url"); textarea.inputMode', '"url"');
+shouldBe('textarea.inputMode = "email"; textarea.inputMode', '"email"');
+shouldBe('textarea.getAttribute("inputmode")', '"email"');
+shouldBe('textarea.setAttribute("inputmode", "email"); textarea.inputMode', '"email"');
+shouldBe('textarea.inputMode = "numeric"; textarea.inputMode', '"numeric"');
+shouldBe('textarea.getAttribute("inputmode")', '"numeric"');
+shouldBe('textarea.setAttribute("inputmode", "numeric"); textarea.inputMode', '"numeric"');
+shouldBe('textarea.inputMode = "decimal"; textarea.inputMode', '"decimal"');
+shouldBe('textarea.getAttribute("inputmode")', '"decimal"');
+shouldBe('textarea.setAttribute("inputmode", "decimal"); textarea.inputMode', '"decimal"');
+shouldBe('textarea.inputMode = "search"; textarea.inputMode', '"search"');
+shouldBe('textarea.getAttribute("inputmode")', '"search"');
+shouldBe('textarea.setAttribute("inputmode", "search"); textarea.inputMode', '"search"');
+
+debug('');
+debug('Valid case-insensitive values:');
+shouldBe('textarea.inputMode = "tExt"; textarea.inputMode', '"text"');
+shouldBe('textarea.getAttribute("inputmode")', '"tExt"');
+shouldBe('textarea.setAttribute("inputmode", "tExt"); textarea.inputMode', '"text"');
+
+debug('');
+</script>
+<script src=""
+</body>
+</html>

Deleted: trunk/LayoutTests/fast/forms/inputmode-attribute.html (235244 => 235245)


--- trunk/LayoutTests/fast/forms/inputmode-attribute.html	2018-08-23 21:14:17 UTC (rev 235244)
+++ trunk/LayoutTests/fast/forms/inputmode-attribute.html	2018-08-23 21:24:42 UTC (rev 235245)
@@ -1,53 +0,0 @@
-<!DOCTYPE html>
-<html>
-<body>
-<script src=""
-<p>Test inputmode attribute</p>
-<input id="input">
-<div id=console></div>
-<script>
-debug('Missing value default:');
-shouldBe('input.inputMode', '""');
-shouldBeNull('input.getAttribute("inputmode")');
-
-debug('');
-debug('Invalid value default:');
-shouldBe('input.inputMode = "foobar"; input.inputMode', '""');
-shouldBe('input.getAttribute("inputmode")', '"foobar"');
-shouldBe('input.setAttribute("inputmode", "baz"); input.inputMode', '""');
-
-debug('');
-debug('Valid values:');
-shouldBe('input.inputMode = "text"; input.inputMode', '"text"');
-shouldBe('input.getAttribute("inputmode")', '"text"');
-shouldBe('input.setAttribute("inputmode", "text"); input.inputMode', '"text"');
-shouldBe('input.inputMode = "tel"; input.inputMode', '"tel"');
-shouldBe('input.getAttribute("inputmode")', '"tel"');
-shouldBe('input.setAttribute("inputmode", "tel"); input.inputMode', '"tel"');
-shouldBe('input.inputMode = "url"; input.inputMode', '"url"');
-shouldBe('input.getAttribute("inputmode")', '"url"');
-shouldBe('input.setAttribute("inputmode", "url"); input.inputMode', '"url"');
-shouldBe('input.inputMode = "email"; input.inputMode', '"email"');
-shouldBe('input.getAttribute("inputmode")', '"email"');
-shouldBe('input.setAttribute("inputmode", "email"); input.inputMode', '"email"');
-shouldBe('input.inputMode = "numeric"; input.inputMode', '"numeric"');
-shouldBe('input.getAttribute("inputmode")', '"numeric"');
-shouldBe('input.setAttribute("inputmode", "numeric"); input.inputMode', '"numeric"');
-shouldBe('input.inputMode = "decimal"; input.inputMode', '"decimal"');
-shouldBe('input.getAttribute("inputmode")', '"decimal"');
-shouldBe('input.setAttribute("inputmode", "decimal"); input.inputMode', '"decimal"');
-shouldBe('input.inputMode = "search"; input.inputMode', '"search"');
-shouldBe('input.getAttribute("inputmode")', '"search"');
-shouldBe('input.setAttribute("inputmode", "search"); input.inputMode', '"search"');
-
-debug('');
-debug('Valid case-insensitive values:');
-shouldBe('input.inputMode = "tExt"; input.inputMode', '"text"');
-shouldBe('input.getAttribute("inputmode")', '"tExt"');
-shouldBe('input.setAttribute("inputmode", "tExt"); input.inputMode', '"text"');
-
-debug('');
-</script>
-<script src=""
-</body>
-</html>

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (235244 => 235245)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2018-08-23 21:14:17 UTC (rev 235244)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2018-08-23 21:24:42 UTC (rev 235245)
@@ -1,3 +1,12 @@
+2018-08-23  Aditya Keerthi  <[email protected]>
+
+        [iOS] Support the inputmode attribute on contenteditable elements
+        https://bugs.webkit.org/show_bug.cgi?id=188878
+
+        Reviewed by Ryosuke Niwa.
+
+        * web-platform-tests/html/dom/reflection-misc-expected.txt: Rebaseline.
+
 2018-08-23  Youenn Fablet  <[email protected]>
 
         self.isSecureContext undefined in Service Worker

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/reflection-misc-expected.txt (235244 => 235245)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/reflection-misc-expected.txt	2018-08-23 21:14:17 UTC (rev 235244)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/reflection-misc-expected.txt	2018-08-23 21:24:42 UTC (rev 235245)
@@ -3616,116 +3616,116 @@
 PASS undefinedelement.tabIndex: IDL set to 1 
 PASS undefinedelement.tabIndex: IDL set to 2147483647 
 PASS undefinedelement.tabIndex: IDL set to -2147483648 
-FAIL undefinedelement.inputMode: typeof IDL attribute assert_equals: expected "string" but got "undefined"
-FAIL undefinedelement.inputMode: IDL get with DOM attribute unset assert_equals: expected (string) "" but got (undefined) undefined
-FAIL undefinedelement.inputMode: setAttribute() to "" assert_equals: IDL get expected (string) "" but got (undefined) undefined
-FAIL undefinedelement.inputMode: setAttribute() to " \0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f  foo " assert_equals: IDL get expected (string) "" but got (undefined) undefined
-FAIL undefinedelement.inputMode: setAttribute() to undefined assert_equals: IDL get expected (string) "" but got (undefined) undefined
-FAIL undefinedelement.inputMode: setAttribute() to 7 assert_equals: IDL get expected (string) "" but got (undefined) undefined
-FAIL undefinedelement.inputMode: setAttribute() to 1.5 assert_equals: IDL get expected (string) "" but got (undefined) undefined
-FAIL undefinedelement.inputMode: setAttribute() to true assert_equals: IDL get expected (string) "" but got (undefined) undefined
-FAIL undefinedelement.inputMode: setAttribute() to false assert_equals: IDL get expected (string) "" but got (undefined) undefined
-FAIL undefinedelement.inputMode: setAttribute() to object "[object Object]" assert_equals: IDL get expected (string) "" but got (undefined) undefined
-FAIL undefinedelement.inputMode: setAttribute() to NaN assert_equals: IDL get expected (string) "" but got (undefined) undefined
-FAIL undefinedelement.inputMode: setAttribute() to Infinity assert_equals: IDL get expected (string) "" but got (undefined) undefined
-FAIL undefinedelement.inputMode: setAttribute() to -Infinity assert_equals: IDL get expected (string) "" but got (undefined) undefined
-FAIL undefinedelement.inputMode: setAttribute() to "\0" assert_equals: IDL get expected (string) "" but got (undefined) undefined
-FAIL undefinedelement.inputMode: setAttribute() to null assert_equals: IDL get expected (string) "" but got (undefined) undefined
-FAIL undefinedelement.inputMode: setAttribute() to object "test-toString" assert_equals: IDL get expected (string) "" but got (undefined) undefined
-FAIL undefinedelement.inputMode: setAttribute() to object "test-valueOf" assert_equals: IDL get expected (string) "" but got (undefined) undefined
-FAIL undefinedelement.inputMode: setAttribute() to "none" assert_equals: IDL get expected (string) "none" but got (undefined) undefined
-FAIL undefinedelement.inputMode: setAttribute() to "xnone" assert_equals: IDL get expected (string) "" but got (undefined) undefined
-FAIL undefinedelement.inputMode: setAttribute() to "none\0" assert_equals: IDL get expected (string) "" but got (undefined) undefined
-FAIL undefinedelement.inputMode: setAttribute() to "one" assert_equals: IDL get expected (string) "" but got (undefined) undefined
-FAIL undefinedelement.inputMode: setAttribute() to "NONE" assert_equals: IDL get expected (string) "none" but got (undefined) undefined
-FAIL undefinedelement.inputMode: setAttribute() to "text" assert_equals: IDL get expected (string) "text" but got (undefined) undefined
-FAIL undefinedelement.inputMode: setAttribute() to "xtext" assert_equals: IDL get expected (string) "" but got (undefined) undefined
-FAIL undefinedelement.inputMode: setAttribute() to "text\0" assert_equals: IDL get expected (string) "" but got (undefined) undefined
-FAIL undefinedelement.inputMode: setAttribute() to "ext" assert_equals: IDL get expected (string) "" but got (undefined) undefined
-FAIL undefinedelement.inputMode: setAttribute() to "TEXT" assert_equals: IDL get expected (string) "text" but got (undefined) undefined
-FAIL undefinedelement.inputMode: setAttribute() to "tel" assert_equals: IDL get expected (string) "tel" but got (undefined) undefined
-FAIL undefinedelement.inputMode: setAttribute() to "xtel" assert_equals: IDL get expected (string) "" but got (undefined) undefined
-FAIL undefinedelement.inputMode: setAttribute() to "tel\0" assert_equals: IDL get expected (string) "" but got (undefined) undefined
-FAIL undefinedelement.inputMode: setAttribute() to "el" assert_equals: IDL get expected (string) "" but got (undefined) undefined
-FAIL undefinedelement.inputMode: setAttribute() to "TEL" assert_equals: IDL get expected (string) "tel" but got (undefined) undefined
-FAIL undefinedelement.inputMode: setAttribute() to "url" assert_equals: IDL get expected (string) "url" but got (undefined) undefined
-FAIL undefinedelement.inputMode: setAttribute() to "xurl" assert_equals: IDL get expected (string) "" but got (undefined) undefined
-FAIL undefinedelement.inputMode: setAttribute() to "url\0" assert_equals: IDL get expected (string) "" but got (undefined) undefined
-FAIL undefinedelement.inputMode: setAttribute() to "rl" assert_equals: IDL get expected (string) "" but got (undefined) undefined
-FAIL undefinedelement.inputMode: setAttribute() to "URL" assert_equals: IDL get expected (string) "url" but got (undefined) undefined
-FAIL undefinedelement.inputMode: setAttribute() to "email" assert_equals: IDL get expected (string) "email" but got (undefined) undefined
-FAIL undefinedelement.inputMode: setAttribute() to "xemail" assert_equals: IDL get expected (string) "" but got (undefined) undefined
-FAIL undefinedelement.inputMode: setAttribute() to "email\0" assert_equals: IDL get expected (string) "" but got (undefined) undefined
-FAIL undefinedelement.inputMode: setAttribute() to "mail" assert_equals: IDL get expected (string) "" but got (undefined) undefined
-FAIL undefinedelement.inputMode: setAttribute() to "EMAIL" assert_equals: IDL get expected (string) "email" but got (undefined) undefined
-FAIL undefinedelement.inputMode: setAttribute() to "numeric" assert_equals: IDL get expected (string) "numeric" but got (undefined) undefined
-FAIL undefinedelement.inputMode: setAttribute() to "xnumeric" assert_equals: IDL get expected (string) "" but got (undefined) undefined
-FAIL undefinedelement.inputMode: setAttribute() to "numeric\0" assert_equals: IDL get expected (string) "" but got (undefined) undefined
-FAIL undefinedelement.inputMode: setAttribute() to "umeric" assert_equals: IDL get expected (string) "" but got (undefined) undefined
-FAIL undefinedelement.inputMode: setAttribute() to "NUMERIC" assert_equals: IDL get expected (string) "numeric" but got (undefined) undefined
-FAIL undefinedelement.inputMode: setAttribute() to "decimal" assert_equals: IDL get expected (string) "decimal" but got (undefined) undefined
-FAIL undefinedelement.inputMode: setAttribute() to "xdecimal" assert_equals: IDL get expected (string) "" but got (undefined) undefined
-FAIL undefinedelement.inputMode: setAttribute() to "decimal\0" assert_equals: IDL get expected (string) "" but got (undefined) undefined
-FAIL undefinedelement.inputMode: setAttribute() to "ecimal" assert_equals: IDL get expected (string) "" but got (undefined) undefined
-FAIL undefinedelement.inputMode: setAttribute() to "DECIMAL" assert_equals: IDL get expected (string) "decimal" but got (undefined) undefined
-FAIL undefinedelement.inputMode: setAttribute() to "search" assert_equals: IDL get expected (string) "search" but got (undefined) undefined
-FAIL undefinedelement.inputMode: setAttribute() to "xsearch" assert_equals: IDL get expected (string) "" but got (undefined) undefined
-FAIL undefinedelement.inputMode: setAttribute() to "search\0" assert_equals: IDL get expected (string) "" but got (undefined) undefined
-FAIL undefinedelement.inputMode: setAttribute() to "earch" assert_equals: IDL get expected (string) "" but got (undefined) undefined
-FAIL undefinedelement.inputMode: setAttribute() to "SEARCH" assert_equals: IDL get expected (string) "search" but got (undefined) undefined
-FAIL undefinedelement.inputMode: IDL set to "" assert_equals: getAttribute() expected "" but got "SEARCH"
-FAIL undefinedelement.inputMode: IDL set to " \0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f  foo " assert_equals: getAttribute() expected " \0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f  foo " but got "SEARCH"
-FAIL undefinedelement.inputMode: IDL set to undefined assert_equals: getAttribute() expected "undefined" but got "SEARCH"
-FAIL undefinedelement.inputMode: IDL set to 7 assert_equals: getAttribute() expected "7" but got "SEARCH"
-FAIL undefinedelement.inputMode: IDL set to 1.5 assert_equals: getAttribute() expected "1.5" but got "SEARCH"
-FAIL undefinedelement.inputMode: IDL set to true assert_equals: getAttribute() expected "true" but got "SEARCH"
-FAIL undefinedelement.inputMode: IDL set to false assert_equals: getAttribute() expected "false" but got "SEARCH"
-FAIL undefinedelement.inputMode: IDL set to object "[object Object]" assert_equals: getAttribute() expected "[object Object]" but got "SEARCH"
-FAIL undefinedelement.inputMode: IDL set to NaN assert_equals: getAttribute() expected "NaN" but got "SEARCH"
-FAIL undefinedelement.inputMode: IDL set to Infinity assert_equals: getAttribute() expected "Infinity" but got "SEARCH"
-FAIL undefinedelement.inputMode: IDL set to -Infinity assert_equals: getAttribute() expected "-Infinity" but got "SEARCH"
-FAIL undefinedelement.inputMode: IDL set to "\0" assert_equals: getAttribute() expected "\0" but got "SEARCH"
-FAIL undefinedelement.inputMode: IDL set to null assert_equals: IDL get expected (string) "" but got (object) null
-FAIL undefinedelement.inputMode: IDL set to object "test-toString" assert_equals: getAttribute() expected "test-toString" but got "SEARCH"
-FAIL undefinedelement.inputMode: IDL set to object "test-valueOf" assert_equals: getAttribute() expected "test-valueOf" but got "SEARCH"
-FAIL undefinedelement.inputMode: IDL set to "none" assert_equals: getAttribute() expected "none" but got "SEARCH"
-FAIL undefinedelement.inputMode: IDL set to "xnone" assert_equals: getAttribute() expected "xnone" but got "SEARCH"
-FAIL undefinedelement.inputMode: IDL set to "none\0" assert_equals: getAttribute() expected "none\0" but got "SEARCH"
-FAIL undefinedelement.inputMode: IDL set to "one" assert_equals: getAttribute() expected "one" but got "SEARCH"
-FAIL undefinedelement.inputMode: IDL set to "NONE" assert_equals: getAttribute() expected "NONE" but got "SEARCH"
-FAIL undefinedelement.inputMode: IDL set to "text" assert_equals: getAttribute() expected "text" but got "SEARCH"
-FAIL undefinedelement.inputMode: IDL set to "xtext" assert_equals: getAttribute() expected "xtext" but got "SEARCH"
-FAIL undefinedelement.inputMode: IDL set to "text\0" assert_equals: getAttribute() expected "text\0" but got "SEARCH"
-FAIL undefinedelement.inputMode: IDL set to "ext" assert_equals: getAttribute() expected "ext" but got "SEARCH"
-FAIL undefinedelement.inputMode: IDL set to "TEXT" assert_equals: getAttribute() expected "TEXT" but got "SEARCH"
-FAIL undefinedelement.inputMode: IDL set to "tel" assert_equals: getAttribute() expected "tel" but got "SEARCH"
-FAIL undefinedelement.inputMode: IDL set to "xtel" assert_equals: getAttribute() expected "xtel" but got "SEARCH"
-FAIL undefinedelement.inputMode: IDL set to "tel\0" assert_equals: getAttribute() expected "tel\0" but got "SEARCH"
-FAIL undefinedelement.inputMode: IDL set to "el" assert_equals: getAttribute() expected "el" but got "SEARCH"
-FAIL undefinedelement.inputMode: IDL set to "TEL" assert_equals: getAttribute() expected "TEL" but got "SEARCH"
-FAIL undefinedelement.inputMode: IDL set to "url" assert_equals: getAttribute() expected "url" but got "SEARCH"
-FAIL undefinedelement.inputMode: IDL set to "xurl" assert_equals: getAttribute() expected "xurl" but got "SEARCH"
-FAIL undefinedelement.inputMode: IDL set to "url\0" assert_equals: getAttribute() expected "url\0" but got "SEARCH"
-FAIL undefinedelement.inputMode: IDL set to "rl" assert_equals: getAttribute() expected "rl" but got "SEARCH"
-FAIL undefinedelement.inputMode: IDL set to "URL" assert_equals: getAttribute() expected "URL" but got "SEARCH"
-FAIL undefinedelement.inputMode: IDL set to "email" assert_equals: getAttribute() expected "email" but got "SEARCH"
-FAIL undefinedelement.inputMode: IDL set to "xemail" assert_equals: getAttribute() expected "xemail" but got "SEARCH"
-FAIL undefinedelement.inputMode: IDL set to "email\0" assert_equals: getAttribute() expected "email\0" but got "SEARCH"
-FAIL undefinedelement.inputMode: IDL set to "mail" assert_equals: getAttribute() expected "mail" but got "SEARCH"
-FAIL undefinedelement.inputMode: IDL set to "EMAIL" assert_equals: getAttribute() expected "EMAIL" but got "SEARCH"
-FAIL undefinedelement.inputMode: IDL set to "numeric" assert_equals: getAttribute() expected "numeric" but got "SEARCH"
-FAIL undefinedelement.inputMode: IDL set to "xnumeric" assert_equals: getAttribute() expected "xnumeric" but got "SEARCH"
-FAIL undefinedelement.inputMode: IDL set to "numeric\0" assert_equals: getAttribute() expected "numeric\0" but got "SEARCH"
-FAIL undefinedelement.inputMode: IDL set to "umeric" assert_equals: getAttribute() expected "umeric" but got "SEARCH"
-FAIL undefinedelement.inputMode: IDL set to "NUMERIC" assert_equals: getAttribute() expected "NUMERIC" but got "SEARCH"
-FAIL undefinedelement.inputMode: IDL set to "decimal" assert_equals: getAttribute() expected "decimal" but got "SEARCH"
-FAIL undefinedelement.inputMode: IDL set to "xdecimal" assert_equals: getAttribute() expected "xdecimal" but got "SEARCH"
-FAIL undefinedelement.inputMode: IDL set to "decimal\0" assert_equals: getAttribute() expected "decimal\0" but got "SEARCH"
-FAIL undefinedelement.inputMode: IDL set to "ecimal" assert_equals: getAttribute() expected "ecimal" but got "SEARCH"
-FAIL undefinedelement.inputMode: IDL set to "DECIMAL" assert_equals: getAttribute() expected "DECIMAL" but got "SEARCH"
-FAIL undefinedelement.inputMode: IDL set to "search" assert_equals: getAttribute() expected "search" but got "SEARCH"
-FAIL undefinedelement.inputMode: IDL set to "xsearch" assert_equals: getAttribute() expected "xsearch" but got "SEARCH"
-FAIL undefinedelement.inputMode: IDL set to "search\0" assert_equals: getAttribute() expected "search\0" but got "SEARCH"
-FAIL undefinedelement.inputMode: IDL set to "earch" assert_equals: getAttribute() expected "earch" but got "SEARCH"
-FAIL undefinedelement.inputMode: IDL set to "SEARCH" assert_equals: IDL get expected "search" but got "SEARCH"
+PASS undefinedelement.inputMode: typeof IDL attribute 
+PASS undefinedelement.inputMode: IDL get with DOM attribute unset 
+PASS undefinedelement.inputMode: setAttribute() to "" 
+PASS undefinedelement.inputMode: setAttribute() to " \0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f  foo " 
+PASS undefinedelement.inputMode: setAttribute() to undefined 
+PASS undefinedelement.inputMode: setAttribute() to 7 
+PASS undefinedelement.inputMode: setAttribute() to 1.5 
+PASS undefinedelement.inputMode: setAttribute() to true 
+PASS undefinedelement.inputMode: setAttribute() to false 
+PASS undefinedelement.inputMode: setAttribute() to object "[object Object]" 
+PASS undefinedelement.inputMode: setAttribute() to NaN 
+PASS undefinedelement.inputMode: setAttribute() to Infinity 
+PASS undefinedelement.inputMode: setAttribute() to -Infinity 
+PASS undefinedelement.inputMode: setAttribute() to "\0" 
+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 "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 "text" 
+PASS undefinedelement.inputMode: setAttribute() to "xtext" 
+PASS undefinedelement.inputMode: setAttribute() to "text\0" 
+PASS undefinedelement.inputMode: setAttribute() to "ext" 
+PASS undefinedelement.inputMode: setAttribute() to "TEXT" 
+PASS undefinedelement.inputMode: setAttribute() to "tel" 
+PASS undefinedelement.inputMode: setAttribute() to "xtel" 
+PASS undefinedelement.inputMode: setAttribute() to "tel\0" 
+PASS undefinedelement.inputMode: setAttribute() to "el" 
+PASS undefinedelement.inputMode: setAttribute() to "TEL" 
+PASS undefinedelement.inputMode: setAttribute() to "url" 
+PASS undefinedelement.inputMode: setAttribute() to "xurl" 
+PASS undefinedelement.inputMode: setAttribute() to "url\0" 
+PASS undefinedelement.inputMode: setAttribute() to "rl" 
+PASS undefinedelement.inputMode: setAttribute() to "URL" 
+PASS undefinedelement.inputMode: setAttribute() to "email" 
+PASS undefinedelement.inputMode: setAttribute() to "xemail" 
+PASS undefinedelement.inputMode: setAttribute() to "email\0" 
+PASS undefinedelement.inputMode: setAttribute() to "mail" 
+PASS undefinedelement.inputMode: setAttribute() to "EMAIL" 
+PASS undefinedelement.inputMode: setAttribute() to "numeric" 
+PASS undefinedelement.inputMode: setAttribute() to "xnumeric" 
+PASS undefinedelement.inputMode: setAttribute() to "numeric\0" 
+PASS undefinedelement.inputMode: setAttribute() to "umeric" 
+PASS undefinedelement.inputMode: setAttribute() to "NUMERIC" 
+PASS undefinedelement.inputMode: setAttribute() to "decimal" 
+PASS undefinedelement.inputMode: setAttribute() to "xdecimal" 
+PASS undefinedelement.inputMode: setAttribute() to "decimal\0" 
+PASS undefinedelement.inputMode: setAttribute() to "ecimal" 
+PASS undefinedelement.inputMode: setAttribute() to "DECIMAL" 
+PASS undefinedelement.inputMode: setAttribute() to "search" 
+PASS undefinedelement.inputMode: setAttribute() to "xsearch" 
+PASS undefinedelement.inputMode: setAttribute() to "search\0" 
+PASS undefinedelement.inputMode: setAttribute() to "earch" 
+PASS undefinedelement.inputMode: setAttribute() to "SEARCH" 
+PASS undefinedelement.inputMode: IDL set to "" 
+PASS undefinedelement.inputMode: IDL set to " \0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f  foo " 
+PASS undefinedelement.inputMode: IDL set to undefined 
+PASS undefinedelement.inputMode: IDL set to 7 
+PASS undefinedelement.inputMode: IDL set to 1.5 
+PASS undefinedelement.inputMode: IDL set to true 
+PASS undefinedelement.inputMode: IDL set to false 
+PASS undefinedelement.inputMode: IDL set to object "[object Object]" 
+PASS undefinedelement.inputMode: IDL set to NaN 
+PASS undefinedelement.inputMode: IDL set to Infinity 
+PASS undefinedelement.inputMode: IDL set to -Infinity 
+PASS undefinedelement.inputMode: IDL set to "\0" 
+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 "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 "text" 
+PASS undefinedelement.inputMode: IDL set to "xtext" 
+PASS undefinedelement.inputMode: IDL set to "text\0" 
+PASS undefinedelement.inputMode: IDL set to "ext" 
+PASS undefinedelement.inputMode: IDL set to "TEXT" 
+PASS undefinedelement.inputMode: IDL set to "tel" 
+PASS undefinedelement.inputMode: IDL set to "xtel" 
+PASS undefinedelement.inputMode: IDL set to "tel\0" 
+PASS undefinedelement.inputMode: IDL set to "el" 
+PASS undefinedelement.inputMode: IDL set to "TEL" 
+PASS undefinedelement.inputMode: IDL set to "url" 
+PASS undefinedelement.inputMode: IDL set to "xurl" 
+PASS undefinedelement.inputMode: IDL set to "url\0" 
+PASS undefinedelement.inputMode: IDL set to "rl" 
+PASS undefinedelement.inputMode: IDL set to "URL" 
+PASS undefinedelement.inputMode: IDL set to "email" 
+PASS undefinedelement.inputMode: IDL set to "xemail" 
+PASS undefinedelement.inputMode: IDL set to "email\0" 
+PASS undefinedelement.inputMode: IDL set to "mail" 
+PASS undefinedelement.inputMode: IDL set to "EMAIL" 
+PASS undefinedelement.inputMode: IDL set to "numeric" 
+PASS undefinedelement.inputMode: IDL set to "xnumeric" 
+PASS undefinedelement.inputMode: IDL set to "numeric\0" 
+PASS undefinedelement.inputMode: IDL set to "umeric" 
+PASS undefinedelement.inputMode: IDL set to "NUMERIC" 
+PASS undefinedelement.inputMode: IDL set to "decimal" 
+PASS undefinedelement.inputMode: IDL set to "xdecimal" 
+PASS undefinedelement.inputMode: IDL set to "decimal\0" 
+PASS undefinedelement.inputMode: IDL set to "ecimal" 
+PASS undefinedelement.inputMode: IDL set to "DECIMAL" 
+PASS undefinedelement.inputMode: IDL set to "search" 
+PASS undefinedelement.inputMode: IDL set to "xsearch" 
+PASS undefinedelement.inputMode: IDL set to "search\0" 
+PASS undefinedelement.inputMode: IDL set to "earch" 
+PASS undefinedelement.inputMode: IDL set to "SEARCH" 
 (Note: missing tests for types tokenlist.)

Modified: trunk/LayoutTests/js/dom/dom-static-property-for-in-iteration-expected.txt (235244 => 235245)


--- trunk/LayoutTests/js/dom/dom-static-property-for-in-iteration-expected.txt	2018-08-23 21:14:17 UTC (rev 235244)
+++ trunk/LayoutTests/js/dom/dom-static-property-for-in-iteration-expected.txt	2018-08-23 21:24:42 UTC (rev 235245)
@@ -51,6 +51,7 @@
 PASS a["offsetHeight"] is 18
 PASS a["outerText"] is nerget
 PASS a["webkitdropzone"] is 
+PASS a["inputMode"] is 
 PASS a["style"] is [object CSSStyleDeclaration]
 PASS a["onabort"] is null
 PASS a["onblur"] is null

Modified: trunk/Source/WebCore/ChangeLog (235244 => 235245)


--- trunk/Source/WebCore/ChangeLog	2018-08-23 21:14:17 UTC (rev 235244)
+++ trunk/Source/WebCore/ChangeLog	2018-08-23 21:24:42 UTC (rev 235245)
@@ -1,3 +1,44 @@
+2018-08-23  Aditya Keerthi  <[email protected]>
+
+        [iOS] Support the inputmode attribute on contenteditable elements
+        https://bugs.webkit.org/show_bug.cgi?id=188878
+
+        Reviewed by Ryosuke Niwa.
+
+        The inputmode attribute should apply to contenteditable elements, in addition to
+        textfield inputs and textareas.
+
+        Moved the inputmode attribute from HTMLInputElement.idl and
+        HTMLTextAreaElement.idl to HTMLElement.idl to reflect the specification.
+
+        Also moved all logic to convert between the InputMode enum and string values
+        into InputMode.cpp to avoid exposing unnecessary details to WebKit. Furthermore,
+        InputMode::Auto was renamed to InputMode::Unspecified to avoid confusion with the
+        specification.
+
+        Spec: https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute
+
+        Tests: fast/forms/inputmode-attribute-contenteditable.html
+               fast/forms/inputmode-attribute-input.html
+               fast/forms/inputmode-attribute-textarea.html
+
+        * Sources.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        * html/HTMLElement.cpp:
+        (WebCore::HTMLElement::canonicalInputMode const):
+        (WebCore::HTMLElement::inputMode const):
+        (WebCore::HTMLElement::setInputMode):
+        * html/HTMLElement.h:
+        * html/HTMLElement.idl:
+        * html/HTMLInputElement.idl:
+        * html/HTMLTextAreaElement.idl:
+        * html/HTMLTextFormControlElement.cpp:
+        * html/HTMLTextFormControlElement.h:
+        * html/InputMode.cpp: Renamed from Source/WebCore/html/InputModeNames.cpp.
+        (WebCore::inputModeForAttributeValue):
+        (WebCore::stringForInputMode):
+        * html/InputMode.h: Renamed from Source/WebCore/html/InputModeNames.h.
+
 2018-08-23  Eric Carlson  <[email protected]>
 
         [MediaStream] Store video preset sizes in a map

Modified: trunk/Source/WebCore/Sources.txt (235244 => 235245)


--- trunk/Source/WebCore/Sources.txt	2018-08-23 21:14:17 UTC (rev 235244)
+++ trunk/Source/WebCore/Sources.txt	2018-08-23 21:24:42 UTC (rev 235245)
@@ -1056,7 +1056,7 @@
 html/ImageData.cpp
 html/ImageDocument.cpp
 html/ImageInputType.cpp
-html/InputModeNames.cpp
+html/InputMode.cpp
 html/InputType.cpp
 html/InputTypeNames.cpp
 html/LabelableElement.cpp

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (235244 => 235245)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2018-08-23 21:14:17 UTC (rev 235244)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2018-08-23 21:24:42 UTC (rev 235245)
@@ -4792,7 +4792,7 @@
 		E517670320B88C1400D41167 /* DataListSuggestionInformation.h in Headers */ = {isa = PBXBuildFile; fileRef = E517670220B88C1400D41167 /* DataListSuggestionInformation.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		E52CF54D20A268AC00DADA27 /* DataListSuggestionsClient.h in Headers */ = {isa = PBXBuildFile; fileRef = E52CF54C20A268AC00DADA27 /* DataListSuggestionsClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		E52CF54F20A35A2800DADA27 /* DataListSuggestionPicker.h in Headers */ = {isa = PBXBuildFile; fileRef = E52CF54E20A35A2800DADA27 /* DataListSuggestionPicker.h */; settings = {ATTRIBUTES = (Private, ); }; };
-		E52EFDF42112875A00AD282A /* InputModeNames.h in Headers */ = {isa = PBXBuildFile; fileRef = E52EFDF22112875A00AD282A /* InputModeNames.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		E52EFDF42112875A00AD282A /* InputMode.h in Headers */ = {isa = PBXBuildFile; fileRef = E52EFDF22112875A00AD282A /* InputMode.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		E58B45BA20AD07DD00991025 /* DataListButtonElement.h in Headers */ = {isa = PBXBuildFile; fileRef = E58B45B820AD07DD00991025 /* DataListButtonElement.h */; };
 		E58B45BB20AD07DD00991025 /* DataListButtonElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E58B45B920AD07DD00991025 /* DataListButtonElement.cpp */; };
 		E59DD4B821098287003C8B47 /* ListButtonArrow.png in Resources */ = {isa = PBXBuildFile; fileRef = E59DD4B721098285003C8B47 /* ListButtonArrow.png */; };
@@ -14440,8 +14440,8 @@
 		E526AF3E1727F8F200E41781 /* Performance.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Performance.cpp; sourceTree = "<group>"; };
 		E52CF54C20A268AC00DADA27 /* DataListSuggestionsClient.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DataListSuggestionsClient.h; sourceTree = "<group>"; };
 		E52CF54E20A35A2800DADA27 /* DataListSuggestionPicker.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DataListSuggestionPicker.h; sourceTree = "<group>"; };
-		E52EFDF22112875A00AD282A /* InputModeNames.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = InputModeNames.h; sourceTree = "<group>"; };
-		E52EFDF32112875A00AD282A /* InputModeNames.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = InputModeNames.cpp; sourceTree = "<group>"; };
+		E52EFDF22112875A00AD282A /* InputMode.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = InputMode.h; sourceTree = "<group>"; };
+		E52EFDF32112875A00AD282A /* InputMode.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = InputMode.cpp; sourceTree = "<group>"; };
 		E55F4979151B888000BB67DB /* LengthFunctions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LengthFunctions.cpp; sourceTree = "<group>"; };
 		E58B45B820AD07DD00991025 /* DataListButtonElement.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DataListButtonElement.h; sourceTree = "<group>"; };
 		E58B45B920AD07DD00991025 /* DataListButtonElement.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = DataListButtonElement.cpp; sourceTree = "<group>"; };
@@ -20644,8 +20644,8 @@
 				97205AB21239291000B17380 /* ImageDocument.h */,
 				F55B3D8D1251F12D003EF269 /* ImageInputType.cpp */,
 				F55B3D8E1251F12D003EF269 /* ImageInputType.h */,
-				E52EFDF32112875A00AD282A /* InputModeNames.cpp */,
-				E52EFDF22112875A00AD282A /* InputModeNames.h */,
+				E52EFDF32112875A00AD282A /* InputMode.cpp */,
+				E52EFDF22112875A00AD282A /* InputMode.h */,
 				37E3524A12450C5200BAF5D9 /* InputType.cpp */,
 				37E3524C12450C6600BAF5D9 /* InputType.h */,
 				C348612115FDE21E007A1CC9 /* InputTypeNames.cpp */,
@@ -28278,7 +28278,7 @@
 				1C010701192594DF008A4201 /* InlineTextBoxStyle.h in Headers */,
 				510A58E51BAA40B100C19282 /* InProcessIDBServer.h in Headers */,
 				2EB767571DA19BDF003E23B5 /* InputEvent.h in Headers */,
-				E52EFDF42112875A00AD282A /* InputModeNames.h in Headers */,
+				E52EFDF42112875A00AD282A /* InputMode.h in Headers */,
 				37E3524D12450C6600BAF5D9 /* InputType.h in Headers */,
 				C348612415FDE21E007A1CC9 /* InputTypeNames.h in Headers */,
 				93309DEA099E64920056E581 /* InsertIntoTextNodeCommand.h in Headers */,

Modified: trunk/Source/WebCore/html/HTMLElement.cpp (235244 => 235245)


--- trunk/Source/WebCore/html/HTMLElement.cpp	2018-08-23 21:14:17 UTC (rev 235244)
+++ trunk/Source/WebCore/html/HTMLElement.cpp	2018-08-23 21:24:42 UTC (rev 235245)
@@ -1086,6 +1086,21 @@
 
 #endif
 
+InputMode HTMLElement::canonicalInputMode() const
+{
+    return inputModeForAttributeValue(attributeWithoutSynchronization(inputmodeAttr));
+}
+
+const AtomicString& HTMLElement::inputMode() const
+{
+    return stringForInputMode(canonicalInputMode());
+}
+
+void HTMLElement::setInputMode(const AtomicString& value)
+{
+    setAttributeWithoutSynchronization(inputmodeAttr, value);
+}
+
 } // namespace WebCore
 
 #ifndef NDEBUG

Modified: trunk/Source/WebCore/html/HTMLElement.h (235244 => 235245)


--- trunk/Source/WebCore/html/HTMLElement.h	2018-08-23 21:14:17 UTC (rev 235244)
+++ trunk/Source/WebCore/html/HTMLElement.h	2018-08-23 21:24:42 UTC (rev 235245)
@@ -26,6 +26,7 @@
 #include "Autocapitalize.h"
 #endif
 
+#include "InputMode.h"
 #include "StyledElement.h"
 
 namespace WebCore {
@@ -107,6 +108,10 @@
     WEBCORE_EXPORT void setAutocorrect(bool);
 #endif
 
+    WEBCORE_EXPORT InputMode canonicalInputMode() const;
+    const AtomicString& inputMode() const;
+    void setInputMode(const AtomicString& value);
+
 protected:
     HTMLElement(const QualifiedName& tagName, Document&, ConstructionType);
 

Modified: trunk/Source/WebCore/html/HTMLElement.idl (235244 => 235245)


--- trunk/Source/WebCore/html/HTMLElement.idl	2018-08-23 21:14:17 UTC (rev 235244)
+++ trunk/Source/WebCore/html/HTMLElement.idl	2018-08-23 21:24:42 UTC (rev 235245)
@@ -67,6 +67,8 @@
 
     // FIXME: We are the only browser to support this now that Blink dropped it (http://crbug.com/688943).
     [CEReactions, Reflect] attribute DOMString webkitdropzone;
+
+    attribute DOMString inputMode;
 };
 
 HTMLElement implements ElementCSSInlineStyle;

Modified: trunk/Source/WebCore/html/HTMLInputElement.idl (235244 => 235245)


--- trunk/Source/WebCore/html/HTMLInputElement.idl	2018-08-23 21:14:17 UTC (rev 235244)
+++ trunk/Source/WebCore/html/HTMLInputElement.idl	2018-08-23 21:24:42 UTC (rev 235245)
@@ -42,7 +42,6 @@
     [Reflect] attribute DOMString formTarget;
     attribute unsigned long height;
     attribute boolean indeterminate;
-    attribute DOMString inputMode;
     [Conditional=DATALIST_ELEMENT] readonly attribute HTMLElement list;
     [Reflect] attribute DOMString max;
     attribute long minLength;

Modified: trunk/Source/WebCore/html/HTMLTextAreaElement.idl (235244 => 235245)


--- trunk/Source/WebCore/html/HTMLTextAreaElement.idl	2018-08-23 21:14:17 UTC (rev 235244)
+++ trunk/Source/WebCore/html/HTMLTextAreaElement.idl	2018-08-23 21:24:42 UTC (rev 235245)
@@ -59,5 +59,4 @@
     void setSelectionRange(optional long start = 0, optional long end = 0, optional DOMString direction);
 
     attribute DOMString autocomplete;
-    attribute DOMString inputMode;
 };

Modified: trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp (235244 => 235245)


--- trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp	2018-08-23 21:14:17 UTC (rev 235244)
+++ trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp	2018-08-23 21:24:42 UTC (rev 235245)
@@ -39,7 +39,6 @@
 #include "HTMLInputElement.h"
 #include "HTMLNames.h"
 #include "HTMLParserIdioms.h"
-#include "InputModeNames.h"
 #include "LayoutDisallowedScope.h"
 #include "Logging.h"
 #include "NodeTraversal.h"
@@ -675,32 +674,6 @@
 }
 #endif
 
-String HTMLTextFormControlElement::inputMode() const
-{
-    const AtomicString& inputMode = attributeWithoutSynchronization(inputmodeAttr);
-    if (equalIgnoringASCIICase(inputMode, InputModeNames::text()))
-        return InputModeNames::text();
-    if (equalIgnoringASCIICase(inputMode, InputModeNames::tel()))
-        return InputModeNames::tel();
-    if (equalIgnoringASCIICase(inputMode, InputModeNames::url()))
-        return InputModeNames::url();
-    if (equalIgnoringASCIICase(inputMode, InputModeNames::email()))
-        return InputModeNames::email();
-    if (equalIgnoringASCIICase(inputMode, InputModeNames::numeric()))
-        return InputModeNames::numeric();
-    if (equalIgnoringASCIICase(inputMode, InputModeNames::decimal()))
-        return InputModeNames::decimal();
-    if (equalIgnoringASCIICase(inputMode, InputModeNames::search()))
-        return InputModeNames::search();
-
-    return emptyString();
-}
-
-void HTMLTextFormControlElement::setInputMode(const String& value)
-{
-    setAttributeWithoutSynchronization(inputmodeAttr, value);
-}
-
 static void getNextSoftBreak(RootInlineBox*& line, Node*& breakNode, unsigned& breakOffset)
 {
     RootInlineBox* next;

Modified: trunk/Source/WebCore/html/HTMLTextFormControlElement.h (235244 => 235245)


--- trunk/Source/WebCore/html/HTMLTextFormControlElement.h	2018-08-23 21:14:17 UTC (rev 235244)
+++ trunk/Source/WebCore/html/HTMLTextFormControlElement.h	2018-08-23 21:24:42 UTC (rev 235245)
@@ -98,9 +98,6 @@
     WEBCORE_EXPORT void showPlaceholderIfNecessary();
 #endif
 
-    WEBCORE_EXPORT String inputMode() const;
-    void setInputMode(const String&);
-
 protected:
     HTMLTextFormControlElement(const QualifiedName&, Document&, HTMLFormElement*);
     bool isPlaceholderEmpty() const;

Copied: trunk/Source/WebCore/html/InputMode.cpp (from rev 235243, trunk/Source/WebCore/html/InputModeNames.cpp) (0 => 235245)


--- trunk/Source/WebCore/html/InputMode.cpp	                        (rev 0)
+++ trunk/Source/WebCore/html/InputMode.cpp	2018-08-23 21:24:42 UTC (rev 235245)
@@ -0,0 +1,121 @@
+/*
+ * Copyright (C) 2018 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "InputMode.h"
+
+#include <wtf/NeverDestroyed.h>
+
+namespace WebCore {
+
+InputMode inputModeForAttributeValue(const AtomicString& value)
+{
+    if (equalIgnoringASCIICase(value, InputModeNames::text()))
+        return InputMode::Text;
+    if (equalIgnoringASCIICase(value, InputModeNames::tel()))
+        return InputMode::Telephone;
+    if (equalIgnoringASCIICase(value, InputModeNames::url()))
+        return InputMode::Url;
+    if (equalIgnoringASCIICase(value, InputModeNames::email()))
+        return InputMode::Email;
+    if (equalIgnoringASCIICase(value, InputModeNames::numeric()))
+        return InputMode::Numeric;
+    if (equalIgnoringASCIICase(value, InputModeNames::decimal()))
+        return InputMode::Decimal;
+    if (equalIgnoringASCIICase(value, InputModeNames::search()))
+        return InputMode::Search;
+
+    return InputMode::Unspecified;
+}
+
+const AtomicString& stringForInputMode(InputMode mode)
+{
+    switch (mode) {
+    case InputMode::Unspecified:
+        return emptyAtom();
+    case InputMode::Text:
+        return InputModeNames::text();
+    case InputMode::Telephone:
+        return InputModeNames::tel();
+    case InputMode::Url:
+        return InputModeNames::url();
+    case InputMode::Email:
+        return InputModeNames::email();
+    case InputMode::Numeric:
+        return InputModeNames::numeric();
+    case InputMode::Decimal:
+        return InputModeNames::decimal();
+    case InputMode::Search:
+        return InputModeNames::search();
+    }
+}
+
+namespace InputModeNames {
+
+const AtomicString& text()
+{
+    static NeverDestroyed<AtomicString> mode("text", AtomicString::ConstructFromLiteral);
+    return mode;
+}
+
+const AtomicString& tel()
+{
+    static NeverDestroyed<AtomicString> mode("tel", AtomicString::ConstructFromLiteral);
+    return mode;
+}
+
+const AtomicString& url()
+{
+    static NeverDestroyed<AtomicString> mode("url", AtomicString::ConstructFromLiteral);
+    return mode;
+}
+
+const AtomicString& email()
+{
+    static NeverDestroyed<AtomicString> mode("email", AtomicString::ConstructFromLiteral);
+    return mode;
+}
+
+const AtomicString& numeric()
+{
+    static NeverDestroyed<AtomicString> mode("numeric", AtomicString::ConstructFromLiteral);
+    return mode;
+}
+
+const AtomicString& decimal()
+{
+    static NeverDestroyed<AtomicString> mode("decimal", AtomicString::ConstructFromLiteral);
+    return mode;
+}
+
+const AtomicString& search()
+{
+    static NeverDestroyed<AtomicString> mode("search", AtomicString::ConstructFromLiteral);
+    return mode;
+}
+
+} // namespace InputModeNames
+
+} // namespace WebCore

Copied: trunk/Source/WebCore/html/InputMode.h (from rev 235243, trunk/Source/WebCore/html/InputModeNames.h) (0 => 235245)


--- trunk/Source/WebCore/html/InputMode.h	                        (rev 0)
+++ trunk/Source/WebCore/html/InputMode.h	2018-08-23 21:24:42 UTC (rev 235245)
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2018 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include <wtf/text/AtomicString.h>
+
+namespace WebCore {
+
+enum class InputMode : uint8_t {
+    Unspecified,
+    Text,
+    Telephone,
+    Url,
+    Email,
+    Numeric,
+    Decimal,
+    Search
+};
+
+InputMode inputModeForAttributeValue(const AtomicString&);
+const AtomicString& stringForInputMode(InputMode);
+
+namespace InputModeNames {
+
+const AtomicString& text();
+const AtomicString& tel();
+const AtomicString& url();
+const AtomicString& email();
+const AtomicString& numeric();
+const AtomicString& decimal();
+const AtomicString& search();
+
+} // namespace InputModeNames
+
+} // namespace WebCore

Deleted: trunk/Source/WebCore/html/InputModeNames.cpp (235244 => 235245)


--- trunk/Source/WebCore/html/InputModeNames.cpp	2018-08-23 21:14:17 UTC (rev 235244)
+++ trunk/Source/WebCore/html/InputModeNames.cpp	2018-08-23 21:24:42 UTC (rev 235245)
@@ -1,79 +0,0 @@
-/*
- * Copyright (C) 2018 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "InputModeNames.h"
-
-#include <wtf/NeverDestroyed.h>
-
-namespace WebCore {
-
-namespace InputModeNames {
-
-const AtomicString& text()
-{
-    static NeverDestroyed<AtomicString> mode("text", AtomicString::ConstructFromLiteral);
-    return mode;
-}
-
-const AtomicString& tel()
-{
-    static NeverDestroyed<AtomicString> mode("tel", AtomicString::ConstructFromLiteral);
-    return mode;
-}
-
-const AtomicString& url()
-{
-    static NeverDestroyed<AtomicString> mode("url", AtomicString::ConstructFromLiteral);
-    return mode;
-}
-
-const AtomicString& email()
-{
-    static NeverDestroyed<AtomicString> mode("email", AtomicString::ConstructFromLiteral);
-    return mode;
-}
-
-const AtomicString& numeric()
-{
-    static NeverDestroyed<AtomicString> mode("numeric", AtomicString::ConstructFromLiteral);
-    return mode;
-}
-
-const AtomicString& decimal()
-{
-    static NeverDestroyed<AtomicString> mode("decimal", AtomicString::ConstructFromLiteral);
-    return mode;
-}
-
-const AtomicString& search()
-{
-    static NeverDestroyed<AtomicString> mode("search", AtomicString::ConstructFromLiteral);
-    return mode;
-}
-
-} // namespace InputModeNames
-
-} // namespace WebCore

Deleted: trunk/Source/WebCore/html/InputModeNames.h (235244 => 235245)


--- trunk/Source/WebCore/html/InputModeNames.h	2018-08-23 21:14:17 UTC (rev 235244)
+++ trunk/Source/WebCore/html/InputModeNames.h	2018-08-23 21:24:42 UTC (rev 235245)
@@ -1,44 +0,0 @@
-/*
- * Copyright (C) 2018 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#include <wtf/text/AtomicString.h>
-
-namespace WebCore {
-
-namespace InputModeNames {
-
-WEBCORE_EXPORT const AtomicString& text();
-WEBCORE_EXPORT const AtomicString& tel();
-WEBCORE_EXPORT const AtomicString& url();
-WEBCORE_EXPORT const AtomicString& email();
-WEBCORE_EXPORT const AtomicString& numeric();
-WEBCORE_EXPORT const AtomicString& decimal();
-WEBCORE_EXPORT const AtomicString& search();
-
-} // namespace InputModeNames
-
-} // namespace WebCore

Modified: trunk/Source/WebKit/ChangeLog (235244 => 235245)


--- trunk/Source/WebKit/ChangeLog	2018-08-23 21:14:17 UTC (rev 235244)
+++ trunk/Source/WebKit/ChangeLog	2018-08-23 21:24:42 UTC (rev 235245)
@@ -1,3 +1,20 @@
+2018-08-23  Aditya Keerthi  <[email protected]>
+
+        [iOS] Support the inputmode attribute on contenteditable elements
+        https://bugs.webkit.org/show_bug.cgi?id=188878
+
+        Reviewed by Ryosuke Niwa.
+
+        Ensured that the assistedNodeInformation for a contenteditable element reflects
+        the value of the element's inputmode attribute.
+
+        Moved logic to obtain the InputMode from the attribute value into WebCore.
+
+        * Shared/AssistedNodeInformation.h:
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        * WebProcess/WebPage/ios/WebPageIOS.mm:
+        (WebKit::WebPage::getAssistedNodeInformation):
+
 2018-08-22  Ryosuke Niwa  <[email protected]>
 
         Assert in NetworkBlobRegistry::unregisterBlobURL after network process had terminated

Modified: trunk/Source/WebKit/Shared/AssistedNodeInformation.h (235244 => 235245)


--- trunk/Source/WebKit/Shared/AssistedNodeInformation.h	2018-08-23 21:14:17 UTC (rev 235244)
+++ trunk/Source/WebKit/Shared/AssistedNodeInformation.h	2018-08-23 21:24:42 UTC (rev 235245)
@@ -29,6 +29,7 @@
 #include <WebCore/AutocapitalizeTypes.h>
 #include <WebCore/Autofill.h>
 #include <WebCore/Color.h>
+#include <WebCore/InputMode.h>
 #include <WebCore/IntRect.h>
 #include <WebCore/URL.h>
 #include <wtf/text/WTFString.h>
@@ -59,17 +60,6 @@
 #endif
 };
 
-enum class InputMode : uint8_t {
-    Auto,
-    Text,
-    Telephone,
-    Url,
-    Email,
-    Numeric,
-    Decimal,
-    Search
-};
-
 #if PLATFORM(IOS)
 struct OptionItem {
     OptionItem() { }
@@ -121,7 +111,7 @@
     bool insideFixedPosition { false };
     AutocapitalizeType autocapitalizeType { AutocapitalizeTypeDefault };
     InputType elementType { InputType::None };
-    InputMode inputMode { InputMode::Auto };
+    WebCore::InputMode inputMode { WebCore::InputMode::Unspecified };
     String formAction;
     Vector<OptionItem> selectOptions;
     int selectedIndex { -1 };

Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (235244 => 235245)


--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2018-08-23 21:14:17 UTC (rev 235244)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2018-08-23 21:24:42 UTC (rev 235245)
@@ -75,6 +75,7 @@
 #import <WebCore/Color.h>
 #import <WebCore/DataDetection.h>
 #import <WebCore/FloatQuad.h>
+#import <WebCore/InputMode.h>
 #import <WebCore/LocalizedStrings.h>
 #import <WebCore/NotImplemented.h>
 #import <WebCore/Pasteboard.h>
@@ -3548,7 +3549,7 @@
     }
 
     switch (_assistedNodeInformation.inputMode) {
-    case InputMode::Auto:
+    case InputMode::Unspecified:
         switch (_assistedNodeInformation.elementType) {
         case InputType::Phone:
             [_traits setKeyboardType:UIKeyboardTypePhonePad];

Modified: trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm (235244 => 235245)


--- trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm	2018-08-23 21:14:17 UTC (rev 235244)
+++ trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm	2018-08-23 21:24:42 UTC (rev 235245)
@@ -87,7 +87,7 @@
 #import <WebCore/HTMLTextFormControlElement.h>
 #import <WebCore/HistoryItem.h>
 #import <WebCore/HitTestResult.h>
-#import <WebCore/InputModeNames.h>
+#import <WebCore/InputMode.h>
 #import <WebCore/KeyboardEvent.h>
 #import <WebCore/LibWebRTCProvider.h>
 #import <WebCore/MediaSessionManagerIOS.h>
@@ -2314,27 +2314,6 @@
     return view->contentsToRootView(renderer->absoluteBoundingBoxRect());
 }
 
-static InputMode inputModeForAssistedNode(const Node& node)
-{
-    const AtomicString& inputMode = downcast<HTMLTextFormControlElement>(node).inputMode();
-    if (inputMode == InputModeNames::text())
-        return InputMode::Text;
-    if (inputMode == InputModeNames::tel())
-        return InputMode::Telephone;
-    if (inputMode == InputModeNames::url())
-        return InputMode::Url;
-    if (inputMode == InputModeNames::email())
-        return InputMode::Email;
-    if (inputMode == InputModeNames::numeric())
-        return InputMode::Numeric;
-    if (inputMode == InputModeNames::decimal())
-        return InputMode::Decimal;
-    if (inputMode == InputModeNames::search())
-        return InputMode::Search;
-
-    return InputMode::Auto;
-}
-
 void WebPage::getAssistedNodeInformation(AssistedNodeInformation& information)
 {
     layoutIfNeeded();
@@ -2440,7 +2419,7 @@
         information.value = element.value();
         information.autofillFieldName = WebCore::toAutofillFieldName(element.autofillData().fieldName);
         information.placeholder = element.attributeWithoutSynchronization(HTMLNames::placeholderAttr);
-        information.inputMode = inputModeForAssistedNode(element);
+        information.inputMode = element.canonicalInputMode();
     } else if (is<HTMLInputElement>(*m_assistedNode)) {
         HTMLInputElement& element = downcast<HTMLInputElement>(*m_assistedNode);
         HTMLFormElement* form = element.form();
@@ -2498,7 +2477,7 @@
         }
 #endif
 
-        information.inputMode = inputModeForAssistedNode(element);
+        information.inputMode = element.canonicalInputMode();
         information.isReadOnly = element.isReadOnly();
         information.value = element.value();
         information.valueAsNumber = element.valueAsNumber();
@@ -2509,6 +2488,7 @@
             auto& assistedElement = downcast<HTMLElement>(*m_assistedNode);
             information.isAutocorrect = assistedElement.shouldAutocorrect();
             information.autocapitalizeType = assistedElement.autocapitalizeType();
+            information.inputMode = assistedElement.canonicalInputMode();
         } else {
             information.isAutocorrect = true;
             information.autocapitalizeType = AutocapitalizeTypeDefault;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to