accesskey.xhtml (1941B)
1 <?xml version="1.0"?> 2 <?xml-stylesheet href="chrome://global/skin" type="text/css"?> 3 4 <!-- This test checks that access keys are rendered properly, both when set with the 5 accesskey attribute in the markup and updated via script later. 6 --> 7 <window class="reftest-wait" onload="changeKeys()" 8 xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> 9 <script> 10 <![CDATA[ 11 12 var keys = ['L', 'l', 'b', 'x', 'l']; 13 14 function changeKeys() 15 { 16 var box = document.getElementById('d'); 17 for (var b = 0; b < 5; b++) 18 box.childNodes[b * 2].accessKey = keys[b]; 19 20 document.documentElement.className=''; 21 } 22 23 ]]> 24 </script> 25 26 <hbox align="start"> 27 <label control="b1" accesskey="L">Label1</label><input xmlns="http://www.w3.org/1999/xhtml" id="b1" size="2"/> 28 <label control="b2" accesskey="l">Label2</label><input xmlns="http://www.w3.org/1999/xhtml" id="b2" size="2"/> 29 <label control="b3" accesskey="b">Label3</label><input xmlns="http://www.w3.org/1999/xhtml" id="b3" size="2"/> 30 <label control="b4" accesskey="x">Label4</label><input xmlns="http://www.w3.org/1999/xhtml" id="b4" size="2"/> 31 <label control="b5" accesskey="l" maxwidth="50">Quite a long label. Hopefully it will wrap</label><input xmlns="http://www.w3.org/1999/xhtml" id="b5" size="2"/> 32 </hbox> 33 34 <hbox id="d" align="start"> 35 <label control="d1" accesskey="z">Label1</label><input xmlns="http://www.w3.org/1999/xhtml" id="d1" size="2"/> 36 <label control="d2">Label2</label><input xmlns="http://www.w3.org/1999/xhtml" id="d2" size="2"/> 37 <label control="d3" accesskey="t">Label3</label><input xmlns="http://www.w3.org/1999/xhtml" id="d3" size="2"/> 38 <label control="d4" accesskey="b">Label4</label><input xmlns="http://www.w3.org/1999/xhtml" id="d4" size="2"/> 39 <label control="d5" accesskey="l" maxwidth="50">Quite a long label. Hopefully it will wrap</label><input xmlns="http://www.w3.org/1999/xhtml" id="d5" size="2"/> 40 </hbox> 41 42 </window>