layout/tools/tests/debug_utils.html

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

     1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
     2         "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
     3 <html>
     4 <head>
     5 	<title>Layout Debug Utilities</title>
     6 </head>
     7 <script type="application/javascript">
     9 const nsILayoutDebuggingTools = Components.interfaces.nsILayoutDebuggingTools;
    10 var gDebugTools;
    12 function Init()
    13 {
    14   netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
    15   gDebugTools = Components.classes["@mozilla.org/layout-debug/layout-debuggingtools;1"].createInstance(nsILayoutDebuggingTools);
    16   gDebugTools.init(window);
    17 }
    19 function SetShowFrameBorders(inShow)
    20 {
    21   netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
    22   gDebugTools.visualDebugging = inShow;
    23 }
    25 function SetShowEventTargetBorders(inShow)
    26 {
    27   netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
    28   gDebugTools.visualEventDebugging = inShow;
    29 }
    31 function SetShowReflowStats(inShow)
    32 {
    33   netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
    34   gDebugTools.reflowCounts = inShow;
    35 }
    37 function DumpFrames()
    38 {
    39   netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
    40   gDebugTools.dumpFrames();
    41 }
    43 function DumpContent()
    44 {
    45   netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
    46   gDebugTools.dumpContent();
    47 }
    49 function DumpViews()
    50 {
    51   netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
    52   gDebugTools.dumpViews();
    53 }
    55 function DumpWebShells()
    56 {
    57   netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
    58   gDebugTools.dumpWebShells();
    59 }
    61 </script>
    63 <body onload="Init()">
    64 <h1>Layout Debug Utils</h1>
    66 <p>Note that these only work in debug builds</h1>
    68 <h2>Global settings</h2>
    70 <form name="globalsform">
    71 <div>
    72 <input type="checkbox" id="showBordersCheck" name="showBordersCheck"
    73     onchange="SetShowFrameBorders(document.globalsform.showBordersCheck.checked)"></input>
    74 <label for="showBordersCheck">Show Frame Borders</label>
    75 </div>
    76 <div>
    77 <input type="checkbox"
    78     id="showEventTargetCheck"
    79     name="showEventTargetCheck"
    80     onchange="SetShowEventTargetBorders(document.globalsform.showEventTargetCheck.checked)"></input>
    81 <label for="showEventTargetCheck">Show Event Target Borders</label>
    82 </div>
    83 </form>
    85 <h2>Per-Window settings</h2>
    87 <form name="windowform">
    88 <input type="checkbox"
    89     id="showReflowStatsCheck"
    90     name="showReflowStatsCheck"
    91     onchange="SetShowReflowStats(document.windowform.showReflowStatsCheck.checked)"></input>
    92 <label for="showReflowStatsCheck">Show Reflow Stats</label>
    93 </form>
    95 <h2>Dumping</h2>
    97 <form name="dumpform">
    98 <div>
    99 <input type="button" value="Dump Frames" onclick="DumpFrames()">
   100 <input type="button" value="Dump Content" onclick="DumpContent()">
   101 <input type="button" value="Dump Views" onclick="DumpViews()">
   102 <input type="button" value="Dump WebShells" onclick="DumpWebShells()">
   103 </div>
   105 </form>
   109 </body>
   110 </html>

mercurial