4 <script src=
"../../resources/js-test.js"></script>
5 <script src=
"resources/common.js"></script>
8 <div id=
"console"></div>
10 <fieldset name=name01
></fieldset>
11 <input name=name02 type=hidden
>
12 <input name=name03 type=text
>
13 <input name=name04 type=tel
>
14 <input name=name05 type=url
>
15 <input name=name06 type=email
>
16 <input name=name07 type=password
>
17 <!-- Don't test optional types.
18 <input name=name08 type=datetime>
19 <input name=name09 type=date>
20 <input name=name10 type=month>
21 <input name=name11 type=week>
22 <input name=name12 type=time>
23 <input name=name13 type=datetime-local>
25 <input name=name14 type=number
>
26 <input name=name15 type=range
>
27 <!-- <input name=name16 type=color> -->
28 <input name=name17 type=checkbox
>
29 <input name=name18 type=radio
>
30 <input name=name19 type=file
>
31 <input name=name20 type=submit
>
32 <input name=name21 type=reset
>
33 <input name=name22 type=button
>
34 <button name=name23 type=submit
></button>
35 <button name=name24 type=reset
></button>
36 <button name=name25 type=button
></button>
37 <select name=name26
></select>
38 <select name=name27 multiple
></select>
39 <textarea name=name28
></textarea>
41 <output name=name30
></output>
44 console
.log('Test if state of stateless form control types are not saved.');
47 function dumpFormState() {
48 if (window
.internals
) {
49 var statefulTypes
= ['hidden', 'text', 'tel', 'url', 'email', 'number', 'range', 'checkbox',
50 'radio', 'file', 'select-one', 'select-multiple', 'textarea'];
51 var statelessTypes
= ['fieldset', 'password', 'submit', 'reset', 'button', 'keygen', 'output'];
53 var states
= internals
.formControlStateOfHistoryItem();
54 for (var i
= 0; i
< statefulTypes
.length
; ++i
) {
55 if (states
.indexOf(statefulTypes
[i
]) >= 0)
56 testPassed('There is a state for ' + statefulTypes
[i
]);
58 testFailed('There no state for ' + statefulTypes
[i
]);
61 for (var i
= 0; i
< statelessTypes
.length
; ++i
) {
62 if (states
.indexOf(statelessTypes
[i
]) < 0)
63 testPassed('There is no state for ' + statelessTypes
[i
]);
65 testFailed('There is a state for ' + statelessTypes
[i
]);
68 // Remove the input elements from the document to avoid a bunch of trailing
69 // whitespace in the test output.
70 document
.body
.removeChild(document
.getElementById("elements"));
74 window
.onload = function() {
75 setTimeout(function() {
79 window
.onunload = function() {
81 location
.hash
= "#done";