Title: [130500] trunk/Source/WebKit/blackberry
Revision
130500
Author
mifen...@rim.com
Date
2012-10-05 07:19:58 -0700 (Fri, 05 Oct 2012)

Log Message

[BlackBerry] Update default input support style for single line inputs.
https://bugs.webkit.org/show_bug.cgi?id=98510

Reviewed by Antonio Gomes.

PR 219588.

Update style calculations to eliminate automatic changes
by default on single line input fields.

Reviewed Internally by Gen Mak.

* WebKitSupport/InputHandler.cpp:
(BlackBerry::WebKit::inputStyle):

Modified Paths

Diff

Modified: trunk/Source/WebKit/blackberry/ChangeLog (130499 => 130500)


--- trunk/Source/WebKit/blackberry/ChangeLog	2012-10-05 13:59:35 UTC (rev 130499)
+++ trunk/Source/WebKit/blackberry/ChangeLog	2012-10-05 14:19:58 UTC (rev 130500)
@@ -1,3 +1,20 @@
+2012-10-05  Mike Fenton  <mifen...@rim.com>
+
+        [BlackBerry] Update default input support style for single line inputs.
+        https://bugs.webkit.org/show_bug.cgi?id=98510
+
+        Reviewed by Antonio Gomes.
+
+        PR 219588.
+
+        Update style calculations to eliminate automatic changes
+        by default on single line input fields.
+
+        Reviewed Internally by Gen Mak.
+
+        * WebKitSupport/InputHandler.cpp:
+        (BlackBerry::WebKit::inputStyle):
+
 2012-10-04  Simon Fraser  <simon.fra...@apple.com>
 
         Final part of "sync" to "flush" renaming

Modified: trunk/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp (130499 => 130500)


--- trunk/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp	2012-10-05 13:59:35 UTC (rev 130499)
+++ trunk/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp	2012-10-05 14:19:58 UTC (rev 130500)
@@ -197,26 +197,37 @@
     case InputTypeText:
     case InputTypeTextArea:
         {
-            // Regular input mode, disable help if autocomplete is off.
-            int imfMask = 0;
             DOMSupport::AttributeState autoCompleteState = DOMSupport::elementSupportsAutocomplete(element);
-            if (autoCompleteState == DOMSupport::Off)
-                imfMask = NO_AUTO_TEXT | NO_PREDICTION;
-            else if (autoCompleteState != DOMSupport::On
-                     && DOMSupport::elementIdOrNameIndicatesNoAutocomplete(element))
-                imfMask = NO_AUTO_TEXT | NO_PREDICTION;
+            DOMSupport::AttributeState autoCorrectState = DOMSupport::elementSupportsAutocorrect(element);
 
-            // Disable autocorrection if it's specifically off, of if it is in default mode
-            // and we have disabled auto text and prediction.
-            if (DOMSupport::elementSupportsAutocorrect(element) == DOMSupport::Off
-                || (imfMask && DOMSupport::elementSupportsAutocorrect(element) == DOMSupport::Default))
-                imfMask |= NO_AUTO_CORRECTION;
+            // Autocomplete disabled explicitly.
+            if (autoCompleteState == DOMSupport::Off) {
+                if (autoCorrectState == DOMSupport::On)
+                    return NO_PREDICTION;
+                return NO_AUTO_TEXT | NO_PREDICTION | NO_AUTO_CORRECTION;
+            }
 
-            if (imfMask)
-                return imfMask;
-            if ((type == InputTypeEmail || type == InputTypeURL) && autoCompleteState != DOMSupport::On)
+            // Autocomplete enabled explicitly.
+            if (autoCompleteState == DOMSupport::On) {
+                if (autoCorrectState == DOMSupport::Off)
+                    return NO_AUTO_TEXT | NO_AUTO_CORRECTION;
+                return DEFAULT_STYLE;
+            }
+
+            // Check for reserved strings and known types.
+            if (type == InputTypeEmail || type == InputTypeURL || DOMSupport::elementIdOrNameIndicatesNoAutocomplete(element)) {
+                if (autoCorrectState == DOMSupport::On)
+                    return NO_PREDICTION;
                 return NO_AUTO_TEXT | NO_PREDICTION | NO_AUTO_CORRECTION;
-            break;
+            }
+
+            // Autocomplete state wasn't provided if it is a text area or autocorrect is on, apply support.
+            if (autoCorrectState == DOMSupport::On || (type == InputTypeTextArea && autoCorrectState != DOMSupport::Off))
+                return DEFAULT_STYLE;
+
+            // Single line text input, without special features explicitly turned on or a textarea
+            // with autocorrect disabled explicitly. Only enable predictions.
+            return NO_AUTO_TEXT | NO_AUTO_CORRECTION;
         }
     case InputTypeIsIndex:
     case InputTypePassword:
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to