|
1 <html> |
|
2 <head> |
|
3 <title>Accessible events testing for document</title> |
|
4 <script> |
|
5 const STATE_BUSY = Components.interfaces.nsIAccessibleStates.STATE_BUSY; |
|
6 |
|
7 var gRetrieval = null; |
|
8 function waitForDocLoad() |
|
9 { |
|
10 if (!gRetrieval) { |
|
11 gRetrieval = Components.classes["@mozilla.org/accessibleRetrieval;1"]. |
|
12 getService(Components.interfaces.nsIAccessibleRetrieval); |
|
13 } |
|
14 |
|
15 var accDoc = gRetrieval.getAccessibleFor(document); |
|
16 |
|
17 var state = {}; |
|
18 accDoc.getState(state, {}); |
|
19 if (state.value & STATE_BUSY) { |
|
20 window.setTimeout(waitForDocLoad, 0); |
|
21 return; |
|
22 } |
|
23 |
|
24 hideIFrame(); |
|
25 } |
|
26 |
|
27 function hideIFrame() |
|
28 { |
|
29 var iframe = document.getElementById("iframe"); |
|
30 gRetrieval.getAccessibleFor(iframe.contentDocument); |
|
31 iframe.style.display = 'none'; |
|
32 } |
|
33 </script> |
|
34 </head> |
|
35 |
|
36 <body onload="waitForDocLoad();"> |
|
37 <iframe id="iframe"></iframe> |
|
38 </body> |
|
39 </html> |