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.

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

mercurial