Rubber-stamped by Brady Eidson.
[webbrowser.git] / LayoutTests / fast / forms / ValidityState-customError-004.html
blobdfaa8fbeff81bdf7b7711308016d65fcf9294195
1 <html>
2 <head>
3 <title>setCustomValidity and customError 4</title>
4 <script language="JavaScript" type="text/javascript">
5 function log(message) {
6 document.getElementById("console").innerHTML += "<li>"+message+"</li>";
9 function test() {
10 if (window.layoutTestController)
11 layoutTestController.dumpAsText();
13 v = document.getElementsByName("victim");
15 // Blank
16 for (i = 0; i < v.length; i++) {
17 v[i].setCustomValidity("Custom string");
18 v[i].setCustomValidity();
19 log(!v[i].validity.customError ? "SUCCESS" : "FAILURE");
20 v[i].setCustomValidity("one", "two", "three");
21 log(v[i].validity.customError ? "SUCCESS" : "FAILURE");
22 v[i].setCustomValidity(null);
23 log(!v[i].validity.customError ? "SUCCESS" : "FAILURE");
24 v[i].setCustomValidity("Custom string");
25 v[i].setCustomValidity(undefined);
26 log(!v[i].validity.customError ? "SUCCESS" : "FAILURE");
29 </script>
30 </head>
31 <body onload="test()">
32 <fieldset name="victim"></fieldset>
33 <button name="victim"></button>
34 <select name="victim"></select>
35 <textarea name="victim"></textarea>
36 <input name="victim" />
37 <hr>
38 <ol id="console"></ol>
39 </body>
40 </html>