layout/generic/test/bug421839-2-page.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 <html>
     2 <head>
     3 </head>
     4 <body style="position: absolute;">
     5 <iframe id="a"></iframe>
     6 <iframe></iframe>
     7 <script>
     8 function tripleclick(){
     9 var wu =  SpecialPowers.getDOMWindowUtils(window);
    10 wu.sendMouseEvent('mousedown',  100, 100, 0, 1, 0);
    11 setTimeout(tripleclick,20);
    12 }
    13 setTimeout(tripleclick,200,0, 0);
    15 function doe2() {
    16 document.body.setAttribute('style', 'position: absolute;');
    17 document.body.offsetHeight;
    18 document.getElementById('a').setAttribute('style', 'position: absolute; direction: rtl; ');
    19 setTimeout(doe3,200);
    20 }
    22 function doe3() {
    23 document.getElementsByTagName('*')[2].setAttribute('style', 'unicode-bidi: inherit; ime-mode: disabled; font-family: Al Bayan; ');
    24 }
    25 setTimeout(doe2,500,0);
    27 setTimeout(function(){window.location.reload()}, 1000);
    30 function designmodes(i){
    31 if (i>=0)
    32   {
    33 try {
    34 window.frames[i].document.designMode='on';
    35 window.frames[i].document.execCommand('inserthtml', false, 'tesxt ');
    36 window.frames[i].document.designMode='off';
    37 }
    38 catch(e) {}
    39 }
    40 else { 
    41 i = window.frames.length-1;
    42  }
    43   i--;
    44 setTimeout(designmodes,50,i);
    45 }
    46 setTimeout(designmodes,500,window.frames.length-1);
    48 function doe2(i) {
    49 document.body.style.position == 'absolute' ? document.body.style.position = '' : document.body.style.position = 'absolute';
    50 setTimeout(doe2,200,i);
    51 }
    52 setTimeout(doe2,500,0);
    53 </script>
    54 </body>
    55 </html>

mercurial