1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/layout/generic/test/frame_selection_underline.xhtml Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,51 @@ 1.4 +<?xml version="1.0" encoding="ISO-8859-1"?> 1.5 +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 1.6 +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" class="willBeRemoved"> 1.7 +<head> 1.8 +<link rel="stylesheet" type="text/css" href="frame_selection_underline.css"/> 1.9 +<script type="text/javascript"> 1.10 +<![CDATA[ 1.11 + 1.12 +function init(aTest) 1.13 +{ 1.14 + var docShell = 1.15 + window.QueryInterface(Components.interfaces.nsIInterfaceRequestor) 1.16 + .getInterface(Components.interfaces.nsIWebNavigation) 1.17 + .QueryInterface(Components.interfaces.nsIDocShell); 1.18 + var controller = 1.19 + docShell.QueryInterface(Components.interfaces.nsIInterfaceRequestor) 1.20 + .getInterface(Components.interfaces.nsISelectionDisplay) 1.21 + .QueryInterface(Components.interfaces.nsISelectionController); 1.22 + 1.23 + var selections = [ 1.24 + controller.SELECTION_SPELLCHECK, 1.25 + controller.SELECTION_IME_RAWINPUT, 1.26 + controller.SELECTION_IME_SELECTEDRAWTEXT, 1.27 + controller.SELECTION_IME_CONVERTEDTEXT, 1.28 + controller.SELECTION_IME_SELECTEDCONVERTEDTEXT, 1.29 + ]; 1.30 + for (var i = 0; i < selections.length; i++) { 1.31 + var sel = controller.getSelection(selections[i]); 1.32 + sel.removeAllRanges(); 1.33 + } 1.34 + 1.35 + var target = document.getElementById("target"); 1.36 + target.style.fontFamily = aTest.font.family; 1.37 + target.style.fontSize = aTest.font.defaultSize; 1.38 + 1.39 + var range = document.createRange(); 1.40 + range.selectNodeContents(target); 1.41 + controller.getSelection(aTest.selection.type).addRange(range); 1.42 + 1.43 + document.documentElement.removeAttribute("class"); 1.44 + setTimeout(function () { 1.45 + document.documentElement.setAttribute("class", "willBeRemoved"); }, 0); 1.46 +} 1.47 + 1.48 +]]> 1.49 +</script> 1.50 +</head> 1.51 +<body class="test"> 1.52 + <div id="target"><span id="decoration"> </span></div> 1.53 +</body> 1.54 +</html> 1.55 \ No newline at end of file