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>";
10 if (window
.layoutTestController
)
11 layoutTestController
.dumpAsText();
13 v
= document
.getElementsByName("victim");
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");
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" />
38 <ol id=
"console"></ol>