4 <link rel=
"help" href=
"http://www.w3.org/TR/DOM-Level-3-Events/#events-KeyboardEvent-repeat" />
5 <script src=
"../../resources/js-test.js"></script>
9 description("Tests KeyboardEvent.repeat attribute");
11 var lastKeyboardEvent
;
13 function recordKeyEvent(ev
) {
15 ev
.keyCode
= (ev
.which
|| ev
.keyCode
);
16 if (window
.eventSender
) {
17 lastKeyboardEvent
= ev
;
19 debug("Type=" + ev
.type
+ "," +
20 "keyCode=" + ev
.keyCode
+ ',' +
21 "repeat=" + ev
.repeat
);
25 var textarea
= document
.createElement("textarea");
26 textarea
.addEventListener("keydown", recordKeyEvent
, false);
27 document
.body
.insertBefore(textarea
, document
.body
.firstChild
);
30 if (window
.eventSender
) {
31 eventSender
.keyDown("a");
32 shouldBeFalse("lastKeyboardEvent.repeat");
34 eventSender
.keyDown("a", ["autoRepeat"]);
35 shouldBeTrue("lastKeyboardEvent.repeat");