accessible/tests/mochitest/events/docload_wnd.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/accessible/tests/mochitest/events/docload_wnd.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,39 @@
     1.4 +<html>
     1.5 +<head>
     1.6 +  <title>Accessible events testing for document</title>
     1.7 +  <script>
     1.8 +    const STATE_BUSY = Components.interfaces.nsIAccessibleStates.STATE_BUSY;
     1.9 +
    1.10 +    var gRetrieval = null;
    1.11 +    function waitForDocLoad()
    1.12 +    {
    1.13 +      if (!gRetrieval) {
    1.14 +        gRetrieval = Components.classes["@mozilla.org/accessibleRetrieval;1"].
    1.15 +         getService(Components.interfaces.nsIAccessibleRetrieval);
    1.16 +      }
    1.17 +
    1.18 +      var accDoc = gRetrieval.getAccessibleFor(document);
    1.19 +
    1.20 +      var state = {};
    1.21 +      accDoc.getState(state, {});
    1.22 +      if (state.value & STATE_BUSY) {
    1.23 +        window.setTimeout(waitForDocLoad, 0);
    1.24 +        return;
    1.25 +      }
    1.26 +
    1.27 +      hideIFrame();
    1.28 +    }
    1.29 +
    1.30 +    function hideIFrame()
    1.31 +    {
    1.32 +      var iframe = document.getElementById("iframe");
    1.33 +      gRetrieval.getAccessibleFor(iframe.contentDocument);
    1.34 +      iframe.style.display = 'none';
    1.35 +    }
    1.36 +  </script>
    1.37 +</head>
    1.38 +
    1.39 +<body onload="waitForDocLoad();">
    1.40 +  <iframe id="iframe"></iframe>
    1.41 +</body>
    1.42 +</html>

mercurial