layout/tools/tests/debug_utils.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/layout/tools/tests/debug_utils.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,111 @@
     1.4 +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
     1.5 +        "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
     1.6 +<html>
     1.7 +<head>
     1.8 +	<title>Layout Debug Utilities</title>
     1.9 +</head>
    1.10 +<script type="application/javascript">
    1.11 +
    1.12 +const nsILayoutDebuggingTools = Components.interfaces.nsILayoutDebuggingTools;
    1.13 +var gDebugTools;
    1.14 +
    1.15 +function Init()
    1.16 +{
    1.17 +  netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
    1.18 +  gDebugTools = Components.classes["@mozilla.org/layout-debug/layout-debuggingtools;1"].createInstance(nsILayoutDebuggingTools);
    1.19 +  gDebugTools.init(window);
    1.20 +}
    1.21 +
    1.22 +function SetShowFrameBorders(inShow)
    1.23 +{
    1.24 +  netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
    1.25 +  gDebugTools.visualDebugging = inShow;
    1.26 +}
    1.27 +
    1.28 +function SetShowEventTargetBorders(inShow)
    1.29 +{
    1.30 +  netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
    1.31 +  gDebugTools.visualEventDebugging = inShow;
    1.32 +}
    1.33 +
    1.34 +function SetShowReflowStats(inShow)
    1.35 +{
    1.36 +  netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
    1.37 +  gDebugTools.reflowCounts = inShow;
    1.38 +}
    1.39 +
    1.40 +function DumpFrames()
    1.41 +{
    1.42 +  netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
    1.43 +  gDebugTools.dumpFrames();
    1.44 +}
    1.45 +
    1.46 +function DumpContent()
    1.47 +{
    1.48 +  netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
    1.49 +  gDebugTools.dumpContent();
    1.50 +}
    1.51 +
    1.52 +function DumpViews()
    1.53 +{
    1.54 +  netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
    1.55 +  gDebugTools.dumpViews();
    1.56 +}
    1.57 +
    1.58 +function DumpWebShells()
    1.59 +{
    1.60 +  netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
    1.61 +  gDebugTools.dumpWebShells();
    1.62 +}
    1.63 +
    1.64 +</script>
    1.65 +
    1.66 +<body onload="Init()">
    1.67 +<h1>Layout Debug Utils</h1>
    1.68 +
    1.69 +<p>Note that these only work in debug builds</h1>
    1.70 +
    1.71 +<h2>Global settings</h2>
    1.72 +
    1.73 +<form name="globalsform">
    1.74 +<div>
    1.75 +<input type="checkbox" id="showBordersCheck" name="showBordersCheck"
    1.76 +    onchange="SetShowFrameBorders(document.globalsform.showBordersCheck.checked)"></input>
    1.77 +<label for="showBordersCheck">Show Frame Borders</label>
    1.78 +</div>
    1.79 +<div>
    1.80 +<input type="checkbox"
    1.81 +    id="showEventTargetCheck"
    1.82 +    name="showEventTargetCheck"
    1.83 +    onchange="SetShowEventTargetBorders(document.globalsform.showEventTargetCheck.checked)"></input>
    1.84 +<label for="showEventTargetCheck">Show Event Target Borders</label>
    1.85 +</div>
    1.86 +</form>
    1.87 +
    1.88 +<h2>Per-Window settings</h2>
    1.89 +
    1.90 +<form name="windowform">
    1.91 +<input type="checkbox"
    1.92 +    id="showReflowStatsCheck"
    1.93 +    name="showReflowStatsCheck"
    1.94 +    onchange="SetShowReflowStats(document.windowform.showReflowStatsCheck.checked)"></input>
    1.95 +<label for="showReflowStatsCheck">Show Reflow Stats</label>
    1.96 +</form>
    1.97 +
    1.98 +<h2>Dumping</h2>
    1.99 +
   1.100 +<form name="dumpform">
   1.101 +<div>
   1.102 +<input type="button" value="Dump Frames" onclick="DumpFrames()">
   1.103 +<input type="button" value="Dump Content" onclick="DumpContent()">
   1.104 +<input type="button" value="Dump Views" onclick="DumpViews()">
   1.105 +<input type="button" value="Dump WebShells" onclick="DumpWebShells()">
   1.106 +</div>
   1.107 +
   1.108 +</form>
   1.109 +
   1.110 +
   1.111 +
   1.112 +</body>
   1.113 +</html>
   1.114 +

mercurial