accessible/tests/mochitest/events/docload_wnd.html

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

     1 <html>
     2 <head>
     3   <title>Accessible events testing for document</title>
     4   <script>
     5     const STATE_BUSY = Components.interfaces.nsIAccessibleStates.STATE_BUSY;
     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       }
    15       var accDoc = gRetrieval.getAccessibleFor(document);
    17       var state = {};
    18       accDoc.getState(state, {});
    19       if (state.value & STATE_BUSY) {
    20         window.setTimeout(waitForDocLoad, 0);
    21         return;
    22       }
    24       hideIFrame();
    25     }
    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>
    36 <body onload="waitForDocLoad();">
    37   <iframe id="iframe"></iframe>
    38 </body>
    39 </html>

mercurial