layout/generic/test/frame_selection_underline.xhtml

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

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

mercurial