tor-browser

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

frame_selection_underline.xhtml (1840B)


      1 <?xml version="1.0" encoding="ISO-8859-1"?>
      2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
      3 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" class="willBeRemoved">
      4 <head>
      5 <link rel="stylesheet" type="text/css" href="frame_selection_underline.css"/>
      6 <script type="text/javascript">
      7 <![CDATA[
      8 
      9 function init(aTest)
     10 {
     11  var docShell = window.docShell;
     12  var controller =
     13    docShell.QueryInterface(Ci.nsIInterfaceRequestor)
     14            .getInterface(Ci.nsISelectionDisplay)
     15            .QueryInterface(Ci.nsISelectionController);
     16 
     17  var selections = [
     18    controller.SELECTION_SPELLCHECK,
     19    controller.SELECTION_IME_RAWINPUT,
     20    controller.SELECTION_IME_SELECTEDRAWTEXT,
     21    controller.SELECTION_IME_CONVERTEDTEXT,
     22    controller.SELECTION_IME_SELECTEDCONVERTEDTEXT,
     23  ];
     24  for (var i = 0; i < selections.length; i++) {
     25    var sel = controller.getSelection(selections[i]);
     26    sel.removeAllRanges();
     27  }
     28 
     29  var target = document.getElementById("target");
     30  target.style.fontFamily = aTest.font.family;
     31  target.style.fontSize = aTest.font.defaultSize;
     32 
     33  var range = document.createRange();
     34  range.selectNodeContents(target);
     35  controller.getSelection(aTest.selection.type).addRange(range);
     36 
     37  document.documentElement.removeAttribute("class");
     38  setTimeout(function () {
     39    document.documentElement.setAttribute("class", "willBeRemoved"); }, 0);
     40 }
     41 
     42 ]]>
     43 </script>
     44 </head>
     45 <body class="test">
     46  <div id="target"><span id="decoration">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div>
     47 </body>
     48 </html>