6 var item = document.createElement("li");
7 item.appendChild(document.createTextNode(message));
8 document.getElementById("console").appendChild(item);
10 function pressKey(key)
12 var event = document.createEvent("KeyboardEvent");
13 if (navigator.userAgent.search(/\bMac OS X\b/) != -1)
14 event.initKeyboardEvent("keydown", true, true, document.defaultView, key, 0, true, false, false, false, false);
16 event.initKeyboardEvent("keydown", true, true, document.defaultView, key, 0, false, true, false, false, false);
17 document.dispatchEvent(event);
21 if (window.layoutTestController)
22 layoutTestController.dumpAsText();
24 for(i = 1; i <= 9; i++) {
34 <body onload="test()">
35 <p>This test checks to see if accesskey attributes works on the specified elements.</p>
36 <p>If this test passes you should see 1 - 9 and a, b and c clicked or focussed.</p>
39 <button accesskey="1" onclick="log('1 button clicked')"></button>
40 <input type="button" value="Click me!" accesskey="2" onfocus="log('2 input type button focussed')"/>
41 <input type="checkbox" accesskey="3" onfocus="log('3 input type checkbox focussed')"/>
42 <input type="text" accesskey="4" onfocus="log('4 input type text focussed')"/>
43 <input type="submit" accesskey="5" onfocus="log('5 input type submit clicked')"/>
44 <input type="reset" accesskey="6" onfocus="log('6 input type reset clicked')"/>
45 <a href="#" accesskey="7" onclick="log('7 link clicked')"></a>
46 <fieldset><legend accesskey="8"></legend><input type="text" onfocus="log('8 input type associated to legend focussed')"/></fieldset>
47 <label accesskey="9" for="test1"><input type="text" id="test1" onfocus="log('9 input type associated to label around input focussed')"/></label>
48 <label accesskey="a" for="test2"></label><input type="text" id="test2" onfocus="log('a input type associated to label closed before input focussed')"/>
50 <area accesskey="b" shape="rect" coords="0,0,5,10" alt="" href="#" onclick="log('b area 1 clicked')">
51 <area accesskey="c" shape="rect" coords="6,0,10,10" alt="" href="#" onclick="log('c area 2 clicked')">
53 <img usemap="#mymap" alt="pic" src="#" height="10" width="10"/>
56 <ol id="console"></ol>