2 <script src=
"../../resources/js-test.js"></script>
4 function countAutofilledElements() {
5 return document
.querySelectorAll(':-webkit-autofill').length
;
9 if (window
.testRunner
) {
10 testRunner
.dumpAsText();
13 var field
= document
.getElementById('field');
14 var select
= document
.getElementById('select');
15 var textarea
= document
.getElementById('textarea');
16 if (window
.internals
) {
17 window
.internals
.setAutofilled(field
, true);
18 window
.internals
.setAutofilled(select
, true);
19 window
.internals
.setAutofilled(textarea
, true);
21 testFailed('This test requires a LayoutTestController.');
25 shouldBe('countAutofilledElements()', '3');
27 var form
= document
.getElementById('form');
30 shouldBe('countAutofilledElements()', '0');
37 background-color: #FFFFFF;
41 <body onload=
"test()">
42 This tests that a field's autofilled state is reverted when the form is reset. It can only be run using the test harness.
<br>
44 <input type=
"text" id=
"field">
45 <select id=
"select"></select>
46 <textarea id=
"textarea"></textarea>
48 <div id=
"console"></div>