tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

file_select_all_without_body.html (865B)


      1 <html>
      2 <head>
      3 <script type="text/javascript">
      4 
      5 function is(aLeft, aRight, aMessage) {
      6  window.opener.SimpleTest.is(aLeft, aRight, aMessage);
      7 }
      8 
      9 function unload() {
     10  window.opener.SimpleTest.finish();
     11 }
     12 
     13 function boom() {
     14  var root = document.documentElement;
     15  while (root.firstChild) {
     16    root.firstChild.remove();
     17  }
     18  root.appendChild(document.createTextNode("Mozilla"));
     19  root.focus();
     20  let cespan = document.createElementNS("http://www.w3.org/1999/xhtml", "span");
     21  cespan.setAttributeNS(null, "contenteditable", "true");
     22  root.appendChild(cespan);
     23  try {
     24    document.execCommand("selectAll", false, null);
     25  } catch (e) { }
     26 
     27  is(window.getSelection().toString(), "Mozilla",
     28     "The nodes are not selected");
     29 
     30  window.close();
     31 }
     32 
     33 window.opener.SimpleTest.waitForFocus(boom, window);
     34 
     35 </script></head>
     36 
     37 <body onunload="unload();"></body>
     38 </html>