Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / security / set-form-autocomplete-attribute.html
blob1a39adc25bf3191e9b21ceed88d3183f16d84cf7
1 <html>
2 <head>
3 <script>
5 if (window.testRunner)
6 testRunner.dumpAsText();
8 function log(message)
9 {
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");
19 else
20 log("Element does *not* autocomplete");
23 function runTest()
25 if (!window.testRunner) {
26 alert("This test can only be run in DumpRenderTree");
27 return;
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);
71 </script>
72 </head>
73 <body onload="runTest();">
74 <div id="logger"></div>
75 <form id="autoForm" method="post">
76 <input type="text" id="autoInput"/>
77 </form>
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.
79 </body>
80 </html>