|
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"> |
|
8 |
|
9 const nsILayoutDebuggingTools = Components.interfaces.nsILayoutDebuggingTools; |
|
10 var gDebugTools; |
|
11 |
|
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 } |
|
18 |
|
19 function SetShowFrameBorders(inShow) |
|
20 { |
|
21 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); |
|
22 gDebugTools.visualDebugging = inShow; |
|
23 } |
|
24 |
|
25 function SetShowEventTargetBorders(inShow) |
|
26 { |
|
27 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); |
|
28 gDebugTools.visualEventDebugging = inShow; |
|
29 } |
|
30 |
|
31 function SetShowReflowStats(inShow) |
|
32 { |
|
33 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); |
|
34 gDebugTools.reflowCounts = inShow; |
|
35 } |
|
36 |
|
37 function DumpFrames() |
|
38 { |
|
39 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); |
|
40 gDebugTools.dumpFrames(); |
|
41 } |
|
42 |
|
43 function DumpContent() |
|
44 { |
|
45 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); |
|
46 gDebugTools.dumpContent(); |
|
47 } |
|
48 |
|
49 function DumpViews() |
|
50 { |
|
51 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); |
|
52 gDebugTools.dumpViews(); |
|
53 } |
|
54 |
|
55 function DumpWebShells() |
|
56 { |
|
57 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); |
|
58 gDebugTools.dumpWebShells(); |
|
59 } |
|
60 |
|
61 </script> |
|
62 |
|
63 <body onload="Init()"> |
|
64 <h1>Layout Debug Utils</h1> |
|
65 |
|
66 <p>Note that these only work in debug builds</h1> |
|
67 |
|
68 <h2>Global settings</h2> |
|
69 |
|
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> |
|
84 |
|
85 <h2>Per-Window settings</h2> |
|
86 |
|
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> |
|
94 |
|
95 <h2>Dumping</h2> |
|
96 |
|
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> |
|
104 |
|
105 </form> |
|
106 |
|
107 |
|
108 |
|
109 </body> |
|
110 </html> |
|
111 |