editor/reftests/388980-1.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 <html>
michael@0 2 <head>
michael@0 3 <title>Reftest for bug 388980</title></html>
michael@0 4 <script type="text/javascript">
michael@0 5
michael@0 6 var text = '<html><head></head><body style="font-size:16px;">'
michael@0 7 + '<p id="redpar">This paragraph should be red</p>'
michael@0 8 + '<p id="bluepar">This paragraph should be blue</p>'
michael@0 9 + '<p>This paragraph should not be colored</p>'
michael@0 10 +'</body></html>';
michael@0 11
michael@0 12
michael@0 13 function colorPar(par, color) {
michael@0 14 var doc = document.getElementById('theIFrame').contentDocument;
michael@0 15 var win = document.getElementById('theIFrame').contentWindow;
michael@0 16 win.getSelection().selectAllChildren(doc.getElementById(par));
michael@0 17 doc.execCommand("hilitecolor", false, color);
michael@0 18 win.getSelection().removeAllRanges();
michael@0 19 }
michael@0 20
michael@0 21 function initIFrame() {
michael@0 22 var doc = document.getElementById('theIFrame').contentDocument;
michael@0 23 doc.designMode = 'on';
michael@0 24 doc.open('text/html');
michael@0 25 doc.write(text);
michael@0 26 doc.close();
michael@0 27
michael@0 28 // Test hilighting with styleWithCSS, should hilight the text...
michael@0 29 doc.execCommand("styleWithCSS", false, true);
michael@0 30 colorPar("redpar", "red");
michael@0 31
michael@0 32 // Test highlighting without styleWithCSS, should also work.
michael@0 33 doc.execCommand("styleWithCSS", false, false);
michael@0 34 colorPar("bluepar", "blue");
michael@0 35
michael@0 36 }
michael@0 37 </script>
michael@0 38 </head>
michael@0 39 <body>
michael@0 40 <iframe id="theIFrame" onload="initIFrame()">
michael@0 41 </iframe>
michael@0 42 </body>
michael@0 43 </html>

mercurial