Bug 915758 - Split out <input type=number> to be behind its own pref. r=mounir
authorJonathan Watt <jwatt@jwatt.org>
Thu, 12 Sep 2013 19:11:00 +0100
changeset 155209 60ba9b28408c104e8270a711378a5243ac58f108
parent 155208 ae560f8f4c78aceb679f3496e733730a9b6e42e2
child 155210 59e20a5404363009dfe829ed4341ce4526dd2950
push id4254
push userakeybl@mozilla.com
push dateTue, 17 Sep 2013 14:18:33 +0000
treeherdermozilla-aurora@9edd56e694b0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmounir
bugs915758
milestone26.0a1
Bug 915758 - Split out <input type=number> to be behind its own pref. r=mounir
b2g/app/b2g.js
content/html/content/src/HTMLInputElement.cpp
content/html/content/test/forms/test_experimental_forms_pref.html
mobile/android/app/mobile.js
modules/libpref/src/init/all.js
testing/profiles/prefs_general.js
--- a/b2g/app/b2g.js
+++ b/b2g/app/b2g.js
@@ -548,16 +548,17 @@ pref("media.omx.enabled", true);
 // Disable printing (particularly, window.print())
 pref("dom.disable_window_print", true);
 
 // Disable window.showModalDialog
 pref("dom.disable_window_showModalDialog", true);
 
 // Enable new experimental html forms
 pref("dom.experimental_forms", true);
+pref("dom.forms.number", true);
 
 // Turns on gralloc-based direct texturing for Gonk
 pref("gfx.gralloc.enabled", false);
 
 // XXXX REMOVE FOR PRODUCTION. Turns on GC and CC logging
 pref("javascript.options.mem.log", false);
 
 // Increase mark slice time from 10ms to 30ms
--- a/content/html/content/src/HTMLInputElement.cpp
+++ b/content/html/content/src/HTMLInputElement.cpp
@@ -4269,16 +4269,18 @@ HTMLInputElement::ParseAttribute(int32_t
       int32_t newType;
       bool success = aResult.ParseEnumValue(aValue, kInputTypeTable, false);
       if (success) {
         newType = aResult.GetEnumValue();
         if ((IsExperimentalMobileType(newType) &&
              !Preferences::GetBool("dom.experimental_forms", false)) ||
             (newType == NS_FORM_INPUT_RANGE &&
              !Preferences::GetBool("dom.experimental_forms_range", false)) ||
+            (newType == NS_FORM_INPUT_NUMBER &&
+             !Preferences::GetBool("dom.forms.number", false)) ||
             (newType == NS_FORM_INPUT_COLOR &&
              !Preferences::GetBool("dom.forms.color", false))) {
           newType = kInputDefaultType->value;
           aResult.SetTo(newType, &aValue);
         }
       } else {
         newType = kInputDefaultType->value;
       }
--- a/content/html/content/test/forms/test_experimental_forms_pref.html
+++ b/content/html/content/test/forms/test_experimental_forms_pref.html
@@ -16,27 +16,27 @@ https://bugzilla.mozilla.org/show_bug.cg
 </div>
 <pre id="test">
 <script type="application/javascript">
 
   var input = document.createElement("input");
 
   SimpleTest.waitForExplicitFinish();
   SpecialPowers.pushPrefEnv({'set': [["dom.experimental_forms", false]]}, function() {
-    input.type = "number";
-    is(input.type, "text", "input type shouldn't be number when the experimental forms are disabled");
-    is(input.getAttribute('type'), "number", "input 'type' attribute should not change");
+    input.type = "date";
+    is(input.type, "text", "input type shouldn't be date when the experimental forms are disabled");
+    is(input.getAttribute('type'), "date", "input 'type' attribute should not change");
 
     SpecialPowers.pushPrefEnv({'set': [["dom.experimental_forms",true]]}, function() {
-      // Change the type of input to text and then back to number, 
+      // Change the type of input to text and then back to date, 
       // so that HTMLInputElement::ParseAttribute gets called with the pref enabled.
       input.type = "text";
-      input.type = "number";
-      is(input.type, "number", "input type should be number when the experimental forms are enabled");
-      is(input.getAttribute('type'), "number", "input 'type' attribute should not change");
+      input.type = "date";
+      is(input.type, "date", "input type should be date when the experimental forms are enabled");
+      is(input.getAttribute('type'), "date", "input 'type' attribute should not change");
     
       SimpleTest.finish();
     });
   });
 
 </script>
 </pre>
 </body>
--- a/mobile/android/app/mobile.js
+++ b/mobile/android/app/mobile.js
@@ -157,16 +157,17 @@ pref("findhelper.autozoom", true);
 /* autocomplete */
 pref("browser.formfill.enable", true);
 
 /* spellcheck */
 pref("layout.spellcheckDefault", 0);
 
 /* new html5 forms */
 pref("dom.experimental_forms", true);
+pref("dom.forms.number", true);
 
 /* extension manager and xpinstall */
 pref("xpinstall.whitelist.add", "addons.mozilla.org");
 pref("xpinstall.whitelist.add.180", "marketplace.firefox.com");
 
 pref("extensions.enabledScopes", 1);
 pref("extensions.autoupdate.enabled", true);
 pref("extensions.autoupdate.interval", 86400);
--- a/modules/libpref/src/init/all.js
+++ b/modules/libpref/src/init/all.js
@@ -797,16 +797,17 @@ pref("dom.send_after_paint_to_content", 
 
 // Timeout clamp in ms for timeouts we clamp
 pref("dom.min_timeout_value", 4);
 // And for background windows
 pref("dom.min_background_timeout_value", 1000);
 
 // Don't use new input types
 pref("dom.experimental_forms", false);
+pref("dom.forms.number", false);
 
 // Don't enable <input type=range> yet:
 pref("dom.experimental_forms_range", true);
 
 // Don't enable <input type=color> yet:
 pref("dom.forms.color", false);
 
 // Enables system messages and activities
--- a/testing/profiles/prefs_general.js
+++ b/testing/profiles/prefs_general.js
@@ -4,16 +4,17 @@ user_pref("browser.console.showInPanel",
 user_pref("browser.dom.window.dump.enabled", true);
 user_pref("browser.firstrun.show.localepicker", false);
 user_pref("browser.firstrun.show.uidiscovery", false);
 user_pref("browser.startup.page", 0); // use about:blank, not browser.startup.homepage
 user_pref("browser.ui.layout.tablet", 0); // force tablet UI off
 user_pref("dom.allow_scripts_to_close_windows", true);
 user_pref("dom.disable_open_during_load", false);
 user_pref("dom.experimental_forms", true); // on for testing
+user_pref("dom.forms.number", true); // on for testing
 user_pref("dom.experimental_forms_range", true); // on for testing
 user_pref("dom.forms.color", true); // on for testing
 user_pref("dom.max_script_run_time", 0); // no slow script dialogs
 user_pref("hangmonitor.timeout", 0); // no hang monitor
 user_pref("dom.max_chrome_script_run_time", 0);
 user_pref("dom.popup_maximum", -1);
 user_pref("dom.send_after_paint_to_content", true);
 user_pref("dom.successive_dialog_time_limit", 0);