layout/reftests/font-face/restore-size-detector-iframe.html

Thu, 15 Jan 2015 15:59:08 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:59:08 +0100
branch
TOR_BUG_9701
changeset 10
ac0c01689b40
permissions
-rw-r--r--

Implement a real Private Browsing Mode condition by changing the API/ABI;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

     1 <!DOCTYPE HTML>
     2 <html>
     3 <head>
     4 	<title>Resize-notifying IFRAME</title>
     5 	<script type="application/ecmascript">
     7 	var gTarget;
     9 	/*
    10 	 * the test is done after the width becomes narrower (immediately)
    11 	 * and then comes back to the same size.  However, the two things
    12 	 * might happen at once.
    13 	 */
    14 	function arm() {
    15 		gTarget = window.innerWidth;
    16 		window.addEventListener("resize", got_resize, false);
    17 		setTimeout(got_resize, 200);
    18 	}
    20 	function got_resize() {
    21 		if (window.innerWidth == gTarget) {
    22 			gTarget = -1;
    23 			// Remove the class="reftest-wait" from the top window
    24 			window.top.document.documentElement.removeAttribute("class");
    25 		}
    26 	}
    28 	</script>
    29 </head>
    30 <body>
    31 </body>
    32 </html>

mercurial