Bug 1618754 - Part 2. Unnecessary to use equalsIgnoreCase for inputmode. r=geckoview-reviewers,agi
authorMakoto Kato <m_kato@ga2.so-net.ne.jp>
Thu, 26 Mar 2020 18:16:38 +0000
changeset 521001 ef8f91e97c99d3013dbe78e24f8cb52765ca6262
parent 521000 35cc81a467e1a2aaa6c58bfef728584a839e7f8e
child 521002 80a18f4033d918a13234a7609c53f330838e4bec
push id37263
push useraciure@mozilla.com
push dateMon, 30 Mar 2020 09:47:47 +0000
treeherdermozilla-central@ef8f91e97c99 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgeckoview-reviewers, agi
bugs1618754
milestone76.0a1
first release with
nightly linux32
ef8f91e97c99 / 76.0a1 / 20200330094747 / files
nightly linux64
ef8f91e97c99 / 76.0a1 / 20200330094747 / files
nightly mac
ef8f91e97c99 / 76.0a1 / 20200330094747 / files
nightly win32
ef8f91e97c99 / 76.0a1 / 20200330094747 / files
nightly win64
ef8f91e97c99 / 76.0a1 / 20200330094747 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1618754 - Part 2. Unnecessary to use equalsIgnoreCase for inputmode. r=geckoview-reviewers,agi `inputmode` is lower case except to `mozAwesomebar`. So it is unnecessary to use `equalsIgnoreCase`. Also, `mozAwesomebar` is for `inputmode`, not `type`. So this changeset has this fix. Differential Revision: https://phabricator.services.mozilla.com/D68332
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoEditable.java
--- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoEditable.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoEditable.java
@@ -1550,38 +1550,38 @@ import android.view.inputmethod.EditorIn
         // We give priority to typeHint so that content authors can't annoy
         // users by doing dumb things like opening the numeric keyboard for
         // an email form field.
         outAttrs.inputType = InputType.TYPE_CLASS_TEXT;
         if (state == SessionTextInput.EditableListener.IME_STATE_PASSWORD ||
                 "password".equalsIgnoreCase(typeHint)) {
             outAttrs.inputType |= InputType.TYPE_TEXT_VARIATION_PASSWORD;
         } else if (typeHint.equalsIgnoreCase("url") ||
-                typeHint.equalsIgnoreCase("mozAwesomebar")) {
+                modeHint.equals("mozAwesomebar")) {
             outAttrs.inputType |= InputType.TYPE_TEXT_VARIATION_URI;
         } else if (typeHint.equalsIgnoreCase("email")) {
             outAttrs.inputType |= InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS;
         } else if (typeHint.equalsIgnoreCase("tel")) {
             outAttrs.inputType = InputType.TYPE_CLASS_PHONE;
         } else if (typeHint.equalsIgnoreCase("number") ||
                 typeHint.equalsIgnoreCase("range")) {
             outAttrs.inputType = InputType.TYPE_CLASS_NUMBER |
                                  InputType.TYPE_NUMBER_VARIATION_NORMAL;
         } else {
             // We look at modeHint
-            if (modeHint.equalsIgnoreCase("tel")) {
+            if (modeHint.equals("tel")) {
                 outAttrs.inputType = InputType.TYPE_CLASS_PHONE;
-            } else if (modeHint.equalsIgnoreCase("url")) {
+            } else if (modeHint.equals("url")) {
                 outAttrs.inputType = InputType.TYPE_TEXT_VARIATION_URI;
-            } else if (modeHint.equalsIgnoreCase("email")) {
+            } else if (modeHint.equals("email")) {
                 outAttrs.inputType |= InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS;
-            } else if (modeHint.equalsIgnoreCase("numeric")) {
+            } else if (modeHint.equals("numeric")) {
                 outAttrs.inputType = InputType.TYPE_CLASS_NUMBER |
                                      InputType.TYPE_NUMBER_VARIATION_NORMAL;
-            } else if (modeHint.equalsIgnoreCase("decimal")) {
+            } else if (modeHint.equals("decimal")) {
                 outAttrs.inputType = InputType.TYPE_CLASS_NUMBER |
                                      InputType.TYPE_NUMBER_FLAG_DECIMAL;
             } else {
                 // TYPE_TEXT_FLAG_IME_MULTI_LINE flag makes the fullscreen IME line wrap
                 outAttrs.inputType |= InputType.TYPE_TEXT_FLAG_AUTO_CORRECT |
                         InputType.TYPE_TEXT_FLAG_IME_MULTI_LINE;
                 if (typeHint.equalsIgnoreCase("textarea") ||
                         typeHint.length() == 0) {