Bug 839179 - Part c: Add a test for HTMLButtonElement attributes reflection; r=bz
authorMs2ger <ms2ger@gmail.com>
Fri, 08 Feb 2013 13:50:30 +0100
changeset 121292 7357eb529db251ca3dd09b8b70e849396a6f3170
parent 121291 cd295f459224cca4b8b85c1e9930c597e17ab74b
child 121293 a84ee921895faaa52dcb162bda414f97f972a339
child 121294 090f4f3aab7de5c402233c3cc274af985f87d912
push id22678
push userMs2ger@gmail.com
push dateFri, 08 Feb 2013 12:55:43 +0000
treeherdermozilla-inbound@7357eb529db2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs839179
milestone21.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 839179 - Part c: Add a test for HTMLButtonElement attributes reflection; r=bz
content/html/content/test/forms/test_button_attributes_reflection.html
--- a/content/html/content/test/forms/test_button_attributes_reflection.html
+++ b/content/html/content/test/forms/test_button_attributes_reflection.html
@@ -1,40 +1,103 @@
 <!DOCTYPE HTML>
 <html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=551670
--->
 <head>
-  <title>Test for Bug 551670</title>
+  <title>Test for HTMLButtonElement attributes reflection</title>
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <script type="application/javascript" src="../reflect.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 </head>
 <body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=551670">Mozilla Bug 551670</a>
 <p id="display"></p>
 <div id="content" style="display: none">
 </div>
 <pre id="test">
 <script type="application/javascript">
 
-/** Test for Bug 551670 **/
+/** Test for HTMLButtonElement attributes reflection **/
+
+// .autofocus
+reflectBoolean({
+  element: document.createElement("button"),
+  attribute: "autofocus",
+});
 
-// .type
+// .disabled
+reflectBoolean({
+  element: document.createElement("button"),
+  attribute: "disabled",
+});
+
+// TODO: formAction (URL).  But note that we currently reflect it weirdly; see
+// content/html/content/test/test_bug607145.html
+
+// .formEnctype
 reflectLimitedEnumerated({
   element: document.createElement("button"),
-  attribute: "type",
-  validValues: [ "submit", "reset", "button" ],
-  invalidValues: [ "this-is-probably-a-wrong-type", "", "tulip" ],
-  defaultValue: "submit",
+  attribute: "formEnctype",
+  validValues: [
+    "application/x-www-form-urlencoded",
+    "multipart/form-data",
+    "text/plain",
+  ],
+  invalidValues: [ "text/html", "", "tulip" ],
+// TODO (Bug 839171):
+//  defaultValue: {
+//    invalid: "application/x-www-form-urlencoded",
+//    missing: "",
+//  }
+  defaultValue: "application/x-www-form-urlencoded",
+});
+
+// .formMethod
+reflectLimitedEnumerated({
+  element: document.createElement("button"),
+  attribute: "formMethod",
+  validValues: [ "get", "post" ],
+  invalidValues: [ "put", "", "tulip" ],
+  unsupportedValues: [ "dialog" ],
+// TODO (Bug 839171):
+//  defaultValue: {
+//    invalid: "get",
+//    missing: "",
+//  }
+  defaultValue: "get",
 });
 
 // .formNoValidate
 reflectBoolean({
   element: document.createElement("button"),
   attribute: "formNoValidate",
 });
 
+// .formTarget
+reflectString({
+  element: document.createElement("button"),
+  attribute: "formTarget",
+});
+
+// .name
+reflectString({
+  element: document.createElement("button"),
+  attribute: "name",
+});
+
+// .type
+reflectLimitedEnumerated({
+  element: document.createElement("button"),
+  attribute: "type",
+  validValues: [ "submit", "reset", "button" ],
+  invalidValues: [ "this-is-probably-a-wrong-type", "", "tulip" ],
+  unsupportedValues: [ "menu" ],
+  defaultValue: "submit",
+});
+
+// .value
+reflectString({
+  element: document.createElement("button"),
+  attribute: "value",
+});
+
 </script>
 </pre>
 </body>
 </html>