6 testRunner
.dumpAsText();
10 var txt
= document
.createTextNode(message
);
11 document
.getElementById("logger").appendChild(txt
);
12 document
.getElementById("logger").appendChild(document
.createElement('br'));
15 function logAutoCompleteAPIResult(input
)
17 if (internals
.elementShouldAutoComplete(input
))
18 log("Element does autocomplete");
20 log("Element does *not* autocomplete");
25 if (!window
.testRunner
) {
26 alert("This test can only be run in DumpRenderTree");
30 var form
= document
.getElementById("autoForm");
31 var input
= document
.getElementById("autoInput");
33 // Test with no autocomplete attribute on the <form>
34 logAutoCompleteAPIResult(input
);
36 input
.setAttribute("autocomplete", "cheese");
37 logAutoCompleteAPIResult(input
);
39 input
.setAttribute("autocomplete", "off");
40 logAutoCompleteAPIResult(input
);
42 input
.setAttribute("autocomplete", "on");
43 logAutoCompleteAPIResult(input
);
45 input
.setAttribute("autocomplete", "cheese");
46 logAutoCompleteAPIResult(input
);
48 input
.removeAttribute("autocomplete");
49 logAutoCompleteAPIResult(input
);
51 // Test with autocomplete="off" on the <form>
52 form
.setAttribute("autocomplete", "off");
53 logAutoCompleteAPIResult(input
);
55 input
.setAttribute("autocomplete", "cheese");
56 logAutoCompleteAPIResult(input
);
58 input
.setAttribute("autocomplete", "off");
59 logAutoCompleteAPIResult(input
);
61 input
.setAttribute("autocomplete", "on");
62 logAutoCompleteAPIResult(input
);
64 input
.setAttribute("autocomplete", "cheese");
65 logAutoCompleteAPIResult(input
);
67 input
.removeAttribute("autocomplete");
68 logAutoCompleteAPIResult(input
);
73 <body onload=
"runTest();">
74 <div id=
"logger"></div>
75 <form id=
"autoForm" method=
"post">
76 <input type=
"text" id=
"autoInput"/>
78 This test exercises the WebKit API
"elementDoesAutoComplete:" to make sure that API clients get the correct answer about whether or not a an element should autocomplete.