layout/reftests/font-face/resize-detector-iframe.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 <!DOCTYPE HTML>
     2 <html>
     3 <head>
     4 	<title>Resize-notifying IFRAME</title>
     5 	<script type="application/ecmascript">
     7 	var gTarget;
     9 	/* the test is done after the next resize */
    10 	function arm() {
    11 		gTarget = -1;
    12 		window.addEventListener("resize", got_resize, false);
    13 	}
    15 	/* the test is done after the next resize to wider than the current width */
    16 	function arm_for_wider() {
    17 		gTarget = window.innerWidth;
    18 		window.addEventListener("resize", got_resize, false);
    19 	}
    21 	function got_resize() {
    22 		if (window.innerWidth > gTarget) {
    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