4 <script src=
"../../resources/js-test.js"></script>
6 function deleteChar(target
) {
8 target
.setSelectionRange(7, 7);
9 if (window
.testRunner
) {
10 eventSender
.keyDown("backspace", []);
15 function validate(evt
) {
16 var node
= evt
.target
;
17 var cloneNode
= node
.cloneNode();
18 var result
= node
.validity
.tooLong
== cloneNode
.validity
.tooLong
;
19 log(result
, node
.nodeName
.toLowerCase());
22 function log(msg
, consoleName
) {
23 var console
= document
.getElementById(consoleName
+ "Console" );
24 console
.innerHTML
= console
.innerHTML
+ msg
+ "<br>";
27 function startTest() {
28 deleteChar(document
.getElementById("input"));
29 deleteChar(document
.getElementById("textarea"));
30 if (window
.testRunner
)
31 testRunner
.notifyDone();
34 if (window
.testRunner
)
35 testRunner
.waitUntilDone();
39 <body onload=
"startTest()">
41 <input type=
"text" id=
"input" maxlength=
4 value=
"sampletext" onchange=
"validate(event)"/>
42 <div id=
"inputConsole">Input : validity.tooLong is equal for node and cloned node=
</div>
44 <textarea id=
"textarea" maxlength=
4 onchange=
"validate(event)">sampletext
</textarea>
45 <div id=
"textareaConsole">Textarea: validity.tooLong is equal for node and cloned node=
</div>