dom/imptests/editing/selecttest/test-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 <title>Selection test iframe</title>
     3 <link rel=author title="Aryeh Gregor" href=ayg@aryeh.name>
     4 <body>
     5 <script src=common.js></script>
     6 <script>
     7 "use strict";
     9 // This script only exists because we want to evaluate the range endpoints
    10 // in each iframe using that iframe's local variables set up by common.js.  It
    11 // just creates a range with the endpoints given by
    12 // eval(window.testRangeInput), and assigns the result to window.testRange.  If
    13 // there's an exception, it's assigned to window.unexpectedException.
    14 // Everything else is to be done by the script that created the iframe.
    15 window.unexpectedException = null;
    17 function run() {
    18 	window.unexpectedException = null;
    19 	try {
    20 		window.testRange = rangeFromEndpoints(eval(window.testRangeInput));
    21 	} catch(e) {
    22 		window.unexpectedException = e;
    23 	}
    24 }
    26 // Remove the scripts so they don't run repeatedly when the iframe is
    27 // reinitialized
    28 [].forEach.call(document.querySelectorAll("script"), function(script) {
    29 	script.parentNode.removeChild(script);
    30 });
    32 testDiv.style.display = "none";
    33 </script>

mercurial