Title: [144261] trunk/Source/WebKit/chromium
Revision
144261
Author
[email protected]
Date
2013-02-27 21:53:00 -0800 (Wed, 27 Feb 2013)

Log Message

[Chromium] Should not return WebTextInputTypeNone for date input element.
https://bugs.webkit.org/show_bug.cgi?id=110740

Patch by Seigo Nonaka <[email protected]> on 2013-02-27
Reviewed by Kent Tamura.

In the case of Windows 8, text input state including on-screen keyboard is controlled by the
value of WebTextInputType returned from WebViewImpl::textInputType().
In past, it returned WebTextInputTypeDate for date text input but now it returns
WebTextInputTypeNone.
WebTextInputTypeNone is used for non editable node, so on-screen keyboard will be hidden if
the date text input is focused.  So there is no way to input on Windows 8 tablet without
physical keyboard except tapping small up/down arrow.

* public/WebTextInputType.h: Introduces WebTextInputTypeDateTimeField.
* src/WebViewImpl.cpp:
(WebKit::WebViewImpl::textInputInfo): Fills type filed regardless of editable or not. It is
safe because textInputType returns editable type only for known editable element.
(WebKit::WebViewImpl::textInputType): Returns WebTextInputTypeDateTimeField for the date
time field element.

Modified Paths

Diff

Modified: trunk/Source/WebKit/chromium/ChangeLog (144260 => 144261)


--- trunk/Source/WebKit/chromium/ChangeLog	2013-02-28 05:04:24 UTC (rev 144260)
+++ trunk/Source/WebKit/chromium/ChangeLog	2013-02-28 05:53:00 UTC (rev 144261)
@@ -1,3 +1,25 @@
+2013-02-27  Seigo Nonaka  <[email protected]>
+
+        [Chromium] Should not return WebTextInputTypeNone for date input element.
+        https://bugs.webkit.org/show_bug.cgi?id=110740
+
+        Reviewed by Kent Tamura.
+
+        In the case of Windows 8, text input state including on-screen keyboard is controlled by the
+        value of WebTextInputType returned from WebViewImpl::textInputType().
+        In past, it returned WebTextInputTypeDate for date text input but now it returns
+        WebTextInputTypeNone.
+        WebTextInputTypeNone is used for non editable node, so on-screen keyboard will be hidden if
+        the date text input is focused.  So there is no way to input on Windows 8 tablet without
+        physical keyboard except tapping small up/down arrow.
+
+        * public/WebTextInputType.h: Introduces WebTextInputTypeDateTimeField.
+        * src/WebViewImpl.cpp:
+        (WebKit::WebViewImpl::textInputInfo): Fills type filed regardless of editable or not. It is
+        safe because textInputType returns editable type only for known editable element.
+        (WebKit::WebViewImpl::textInputType): Returns WebTextInputTypeDateTimeField for the date
+        time field element.
+
 2013-02-27  James Simonsen  <[email protected]>
 
         [chromium] Lower priority of preloaded images

Modified: trunk/Source/WebKit/chromium/public/WebTextInputType.h (144260 => 144261)


--- trunk/Source/WebKit/chromium/public/WebTextInputType.h	2013-02-28 05:04:24 UTC (rev 144260)
+++ trunk/Source/WebKit/chromium/public/WebTextInputType.h	2013-02-28 05:53:00 UTC (rev 144261)
@@ -61,6 +61,11 @@
 
     // Input caret is in a contenteditable node (not an INPUT field).
     WebTextInputTypeContentEditable,
+
+    // The focused node is date time field. The date time field does not have
+    // input caret but it is necessary to distinguish from WebTextInputTypeNone
+    // for on-screen keyboard.
+    WebTextInputTypeDateTimeField,
 };
 
 } // namespace WebKit

Modified: trunk/Source/WebKit/chromium/src/WebViewImpl.cpp (144260 => 144261)


--- trunk/Source/WebKit/chromium/src/WebViewImpl.cpp	2013-02-28 05:04:24 UTC (rev 144260)
+++ trunk/Source/WebKit/chromium/src/WebViewImpl.cpp	2013-02-28 05:53:00 UTC (rev 144261)
@@ -2282,6 +2282,10 @@
     if (!focused)
         return info;
 
+    info.type = textInputType();
+    if (info.type == WebTextInputTypeNone)
+        return info;
+
     Editor* editor = focused->editor();
     if (!editor || !editor->canEdit())
         return info;
@@ -2294,10 +2298,6 @@
     if (!node)
         return info;
 
-    info.type = textInputType();
-    if (info.type == WebTextInputTypeNone)
-        return info;
-
     info.value = plainText(rangeOfContents(node).get());
 
     if (info.value.isEmpty())
@@ -2367,6 +2367,14 @@
         return WebTextInputTypeTextArea;
     }
 
+#if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
+    if (node->isHTMLElement()) {
+        HTMLElement* element = toHTMLElement(node);
+        if (element->isDateTimeFieldElement())
+            return WebTextInputTypeDateTimeField;
+    }
+#endif
+
     if (node->shouldUseInputMethod())
         return WebTextInputTypeContentEditable;
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to