frame_selection_underline-ref.xhtml (1968B)
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 target = document.getElementById("target"); 12 var decoration = document.getElementById("decoration"); 13 var leftSpacer = document.getElementById("leftspacer"); 14 var rightSpacer = document.getElementById("rightspacer"); 15 16 var docShell = window.docShell; 17 var controller = 18 docShell.QueryInterface(Ci.nsIInterfaceRequestor) 19 .getInterface(Ci.nsISelectionDisplay) 20 .QueryInterface(Ci.nsISelectionController); 21 22 const nsISelectionController = Ci.nsISelectionController; 23 if (aTest.selection.isIME) { 24 leftSpacer.style.display = rightSpacer.style.display = "inline-block"; 25 } else { 26 leftSpacer.style.display = rightSpacer.style.display = "none"; 27 } 28 29 target.style.fontFamily = aTest.font.family; 30 target.style.fontSize = aTest.font.defaultSize; 31 32 decoration.style.textDecorationStyle = aTest.decoration.styleName; 33 decoration.style.textDecorationColor = aTest.selection.decorationColor; 34 35 document.documentElement.removeAttribute("class"); 36 setTimeout(function () { 37 document.documentElement.setAttribute("class", "willBeRemoved"); }, 0); 38 } 39 40 ]]> 41 </script> 42 </head> 43 <body class="reference"> 44 <div id="target"><span id="decoration"><span id="leftspacer"> </span> <span id="rightspacer"></span> </span></div> 45 </body> 46 </html>