accesskey.xul 1.5 KB

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