448064.xhtml 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <html xmlns="http://www.w3.org/1999/xhtml">
  2. <head>
  3. </head>
  4. <body>
  5. <div id="mw_b">
  6. <div id="mw_f">
  7. <div id="mw_g" style="display: none;"/>
  8. </div>
  9. </div>
  10. <div id="mw_c" style="display: none;">
  11. <div id="mw_d">
  12. <div id="mw_e"></div>
  13. </div>
  14. </div>
  15. <input id="mw_a"/>
  16. <script>
  17. function dumpAccessibleNode(aNode, level) {
  18. var msg = "";
  19. try {
  20. msg += "name=\"" + aNode.name + "\" ";
  21. } catch (e) {
  22. msg += " noName ";
  23. }
  24. dump(msg + '\n');
  25. }
  26. function dumpAccessibleTree(aNode, level) {
  27. netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
  28. level = level || 0;
  29. dumpAccessibleNode(aNode, level);
  30. try {
  31. var child = aNode.firstChild;
  32. while (child) {
  33. dumpAccessibleTree(child, level + 1);
  34. child = child.nextSibling;
  35. }
  36. } catch (e) {
  37. dump("Error visiting child nodes: " + e + '\n');
  38. }
  39. }
  40. function A(o) {
  41. netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
  42. var acc = Components.classes['@mozilla.org/accessibilityService;1']
  43. .getService(Components.interfaces.nsIAccessibilityService);
  44. return acc.getAccessibleFor(o);
  45. }
  46. function beginAccessible() {
  47. netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
  48. dumpAccessibleTree(A(document),0);
  49. }
  50. setTimeout(beginAccessible, 100);
  51. setTimeout(doe, 200);
  52. function doe() {
  53. document.getElementById('mw_a').appendChild(document.getElementById('mw_b'));
  54. document.getElementById('mw_c').appendChild(document.getElementById('mw_d'));
  55. document.getElementById('mw_e').appendChild(document.getElementById('mw_f'));
  56. document.getElementById('mw_g').appendChild(document.getElementById('mw_b'));
  57. }
  58. </script>
  59. </body>
  60. </html>