Bug 857355 - Hide HTMLInputElement's inputMode behind a pref and only turn it on for Nightly/Aurora. r=smaug
authorMounir Lamouri <mounir.lamouri@gmail.com>
Wed, 01 May 2013 16:58:30 +0100
changeset 130476 68869162af7c3b977c4ea461e70a702c333c0a18
parent 130475 77969f0c3ffd2c0386aa12f61515ece12e77a01b
child 130477 241e3e556766b06c3fa588de5f1d872d5751105d
push id24621
push userphilringnalda@gmail.com
push dateThu, 02 May 2013 03:27:34 +0000
treeherdermozilla-central@0274ab3783b1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs857355
milestone23.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 857355 - Hide HTMLInputElement's inputMode behind a pref and only turn it on for Nightly/Aurora. r=smaug
content/events/src/nsIMEStateManager.cpp
content/html/content/test/forms/test_input_attributes_reflection.html
dom/webidl/HTMLInputElement.webidl
modules/libpref/src/init/all.js
--- a/content/events/src/nsIMEStateManager.cpp
+++ b/content/events/src/nsIMEStateManager.cpp
@@ -485,18 +485,22 @@ nsIMEStateManager::SetIMEState(const IME
       (aContent->Tag() == nsGkAtoms::input ||
        aContent->Tag() == nsGkAtoms::textarea)) {
     if (aContent->Tag() != nsGkAtoms::textarea) {
       aContent->GetAttr(kNameSpaceID_None, nsGkAtoms::type,
                         context.mHTMLInputType);
     } else {
       context.mHTMLInputType.Assign(nsGkAtoms::textarea->GetUTF16String());
     }
-    aContent->GetAttr(kNameSpaceID_None, nsGkAtoms::inputmode,
-                      context.mHTMLInputInputmode);
+
+    if (Preferences::GetBool("dom.forms.inputmode", false)) {
+      aContent->GetAttr(kNameSpaceID_None, nsGkAtoms::inputmode,
+                        context.mHTMLInputInputmode);
+    }
+
     aContent->GetAttr(kNameSpaceID_None, nsGkAtoms::moz_action_hint,
                       context.mActionHint);
 
     // if we don't have an action hint and  return won't submit the form use "next"
     if (context.mActionHint.IsEmpty() && aContent->Tag() == nsGkAtoms::input) {
       bool willSubmit = false;
       nsCOMPtr<nsIFormControl> control(do_QueryInterface(aContent));
       mozilla::dom::Element* formElement = control->GetFormElement();
--- a/content/html/content/test/forms/test_input_attributes_reflection.html
+++ b/content/html/content/test/forms/test_input_attributes_reflection.html
@@ -105,23 +105,25 @@ reflectUnsignedInt({
   element: document.createElement("input"),
   attribute: "height",
   nonZero: false
 });
 
 // .indeterminate doesn't reflect a content attribute.
 
 // .inputmode
+if (SpecialPowers.getBoolPref("dom.forms.inputmode")) {
 reflectLimitedEnumerated({
   element: document.createElement("input"),
   attribute: "inputMode",
   validValues: [ "numeric", "digit", "uppercase", "lowercase", "titlecase", "autocapitalized", "auto" ],
   invalidValues: [ "", "foo", "tulip" ],
   defaultValue: "auto"
 });
+}
 
 // TODO: list (HTMLElement)
 
 // .max
 reflectString({
   element: document.createElement('input'),
   attribute: 'max',
 });
--- a/dom/webidl/HTMLInputElement.webidl
+++ b/dom/webidl/HTMLInputElement.webidl
@@ -42,17 +42,17 @@ interface HTMLInputElement : HTMLElement
   [Pure, SetterThrows]
            attribute boolean formNoValidate;
   [Pure, SetterThrows]
            attribute DOMString formTarget;
   [Pure, SetterThrows]
            attribute unsigned long height;
   [Pure]
            attribute boolean indeterminate;
-  [Pure, SetterThrows]
+  [Pure, SetterThrows, Pref="dom.forms.inputmode"]
            attribute DOMString inputMode;
   [Pure]
   readonly attribute HTMLElement? list;
   [Pure, SetterThrows]
            attribute DOMString max;
   [Pure, SetterThrows]
            attribute long maxLength;
   [Pure, SetterThrows]
--- a/modules/libpref/src/init/all.js
+++ b/modules/libpref/src/init/all.js
@@ -4200,8 +4200,14 @@ pref("ui.touch_activation.delay_ms", 100
 // actions when the fifo is written to.  Disable this in general.
 pref("memory_info_dumper.watch_fifo", false);
 
 #ifdef MOZ_CAPTIVEDETECT
 pref("captivedetect.maxWaitingTime", 5000);
 pref("captivedetect.pollingTime", 3000);
 pref("captivedetect.maxRetryCount", 5);
 #endif
+
+#ifdef RELEASE_BUILD
+pref("dom.forms.inputmode", false);
+#else
+pref("dom.forms.inputmode", true);
+#endif