diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /layout/tools/tests/debug_utils.html | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'layout/tools/tests/debug_utils.html')
-rw-r--r-- | layout/tools/tests/debug_utils.html | 111 |
1 files changed, 111 insertions, 0 deletions
diff --git a/layout/tools/tests/debug_utils.html b/layout/tools/tests/debug_utils.html new file mode 100644 index 000000000..4c2ba98c5 --- /dev/null +++ b/layout/tools/tests/debug_utils.html @@ -0,0 +1,111 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" + "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd"> +<html> +<head> + <title>Layout Debug Utilities</title> +</head> +<script type="application/javascript"> + +const nsILayoutDebuggingTools = Components.interfaces.nsILayoutDebuggingTools; +var gDebugTools; + +function Init() +{ + netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); + gDebugTools = Components.classes["@mozilla.org/layout-debug/layout-debuggingtools;1"].createInstance(nsILayoutDebuggingTools); + gDebugTools.init(window); +} + +function SetShowFrameBorders(inShow) +{ + netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); + gDebugTools.visualDebugging = inShow; +} + +function SetShowEventTargetBorders(inShow) +{ + netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); + gDebugTools.visualEventDebugging = inShow; +} + +function SetShowReflowStats(inShow) +{ + netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); + gDebugTools.reflowCounts = inShow; +} + +function DumpFrames() +{ + netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); + gDebugTools.dumpFrames(); +} + +function DumpContent() +{ + netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); + gDebugTools.dumpContent(); +} + +function DumpViews() +{ + netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); + gDebugTools.dumpViews(); +} + +function DumpWebShells() +{ + netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); + gDebugTools.dumpWebShells(); +} + +</script> + +<body onload="Init()"> +<h1>Layout Debug Utils</h1> + +<p>Note that these only work in debug builds</h1> + +<h2>Global settings</h2> + +<form name="globalsform"> +<div> +<input type="checkbox" id="showBordersCheck" name="showBordersCheck" + onchange="SetShowFrameBorders(document.globalsform.showBordersCheck.checked)"></input> +<label for="showBordersCheck">Show Frame Borders</label> +</div> +<div> +<input type="checkbox" + id="showEventTargetCheck" + name="showEventTargetCheck" + onchange="SetShowEventTargetBorders(document.globalsform.showEventTargetCheck.checked)"></input> +<label for="showEventTargetCheck">Show Event Target Borders</label> +</div> +</form> + +<h2>Per-Window settings</h2> + +<form name="windowform"> +<input type="checkbox" + id="showReflowStatsCheck" + name="showReflowStatsCheck" + onchange="SetShowReflowStats(document.windowform.showReflowStatsCheck.checked)"></input> +<label for="showReflowStatsCheck">Show Reflow Stats</label> +</form> + +<h2>Dumping</h2> + +<form name="dumpform"> +<div> +<input type="button" value="Dump Frames" onclick="DumpFrames()"> +<input type="button" value="Dump Content" onclick="DumpContent()"> +<input type="button" value="Dump Views" onclick="DumpViews()"> +<input type="button" value="Dump WebShells" onclick="DumpWebShells()"> +</div> + +</form> + + + +</body> +</html> + |