Bug 681666 - Add formNoValidate attribute to test_button_attributes_reflection.html r=Ms2ger
authorMounir Lamouri <mounir.lamouri@gmail.com>
Wed, 24 Aug 2011 21:32:06 +0200
changeset 75831 650aad33a441307a7e13e25221ad43253f9fb6cb
parent 75830 0dffbdf36868a6f630d35ac29c63c7e42a76cc7d
child 75832 7f4eeae55c3006aa4c34a623e8d3e63040455c7e
push id3
push userfelipc@gmail.com
push dateFri, 30 Sep 2011 20:09:13 +0000
reviewersMs2ger
bugs681666
milestone9.0a1
Bug 681666 - Add formNoValidate attribute to test_button_attributes_reflection.html r=Ms2ger
content/html/content/test/forms/test_button_attributes_reflection.html
content/html/content/test/forms/test_formnovalidate_attribute.html
--- a/content/html/content/test/forms/test_button_attributes_reflection.html
+++ b/content/html/content/test/forms/test_button_attributes_reflection.html
@@ -23,12 +23,18 @@ https://bugzilla.mozilla.org/show_bug.cg
 reflectLimitedEnumerated({
   element: document.createElement("button"),
   attribute: "type",
   validValues: [ "submit", "reset", "button" ],
   invalidValues: [ "this-is-probably-a-wrong-type", "", "tulip" ],
   defaultValue: "submit",
 });
 
+// .formNoValidate
+reflectBoolean({
+  element: document.createElement("button"),
+  attribute: "formNoValidate",
+});
+
 </script>
 </pre>
 </body>
 </html>
--- a/content/html/content/test/forms/test_formnovalidate_attribute.html
+++ b/content/html/content/test/forms/test_formnovalidate_attribute.html
@@ -41,46 +41,16 @@ https://bugzilla.mozilla.org/show_bug.cg
     <button id='e' type='submit' formnovalidate></button>
   </form>
 </div>
 <pre id="test">
 <script type="application/javascript">
 
 /** Test for Bug 589696 **/
 
-function checkFormNoValidateAttribute(aElementName)
-{
-  var element = document.createElement(aElementName);
-
-  ok("formNoValidate" in element, "formNoValidate should be a " + aElementName +
-                              " element IDL attribute");
-
-  ok(!element.formNoValidate, "formnovalidate attribute should be disabled");
-  is(element.getAttribute('formnovalidate'), null,
-    "formnovalidate attribute should be disabled");
-
-  element.formNoValidate = true;
-  ok(element.formNoValidate, "formnovalidate attribute should be enabled");
-  isnot(element.getAttribute('formnovalidate'), null,
-    "formnovalidate attribute should be enabled");
-
-  element.removeAttribute('formnovalidate');
-  element.setAttribute('formnovalidate', '');
-  ok(element.formNoValidate, "formnovalidate attribute should be enabled");
-  isnot(element.getAttribute('formnovalidate'), null,
-    "formnovalidate attribute should be enabled");
-
-  element.removeAttribute('formnovalidate');
-  ok(!element.formNoValidate, "formnovalidate attribute should be disabled");
-  is(element.getAttribute('formnovalidate'), null,
-    "formnovalidate attribute should be disabled");
-}
-
-checkFormNoValidateAttribute('button');
-
 netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
 var os = Components.classes['@mozilla.org/observer-service;1']
                    .getService(Components.interfaces.nsIObserverService);
 var observers = os.enumerateObservers("invalidformsubmit");
 
 /**
  * formnovalidate should prevent form validation if set on the submit control
  * used to submit the form.