editor/reftests/caret_on_presshell_reinit-2.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 class="reftest-wait">
     3   <body>
     4     <iframe src="data:text/html,<body><div></div></body>"></iframe>
     5     <script type="text/javascript">
     6       onload = function() {
     7         var i = document.querySelector("iframe");
     8         var win = i.contentWindow;
     9         var doc = win.document;
    10         var div = doc.querySelector("div");
    11         win.getSelection().collapse(div, 0);
    12         i.focus();
    13         div.contentEditable = true;
    14         div.focus();
    15         setTimeout(function() {
    16           var span = doc.createElement("span");
    17           span.appendChild(doc.createTextNode("foo"));
    18           div.appendChild(span);
    19           div.style.outlineWidth = 0; // remove the focus outline
    20           i.style.position = "absolute";
    21           document.body.clientWidth;
    22           document.documentElement.removeAttribute("class");
    23         }, 0);
    24       };
    25     </script>
    26   </body>
    27 </html>

mercurial