accessible/tests/mochitest/events/docload_wnd.html

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

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

mercurial