~ubuntu-branches/ubuntu/precise/kompozer/precise

« back to all changes in this revision

Viewing changes to mozilla/layout/tools/tests/content_dumping.html

  • Committer: Bazaar Package Importer
  • Author(s): Anthony Yarusso
  • Date: 2007-08-27 01:11:03 UTC
  • Revision ID: james.westby@ubuntu.com-20070827011103-2jgf4s6532gqu2ka
Tags: upstream-0.7.10
ImportĀ upstreamĀ versionĀ 0.7.10

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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>Control Frame</title>
 
6
</head>
 
7
 
 
8
<script type="application/x-javascript" language="Javascript">
 
9
 
 
10
const nsILayoutDebuggingTools = Components.interfaces.nsILayoutDebuggingTools;
 
11
var gDebugTools;
 
12
 
 
13
function Init()
 
14
{
 
15
  netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
 
16
  gDebugTools = Components.classes["@mozilla.org/layout-debug/layout-debuggingtools;1"].createInstance(nsILayoutDebuggingTools);
 
17
  gDebugTools.init(window.frames.pageframe);
 
18
}
 
19
 
 
20
function SetShowFrameBorders(inShow)
 
21
{
 
22
  netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
 
23
  gDebugTools.visualDebugging = inShow;
 
24
}
 
25
 
 
26
function SetShowEventTargetBorders(inShow)
 
27
{
 
28
  netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
 
29
  gDebugTools.visualEventDebugging = inShow;
 
30
}
 
31
 
 
32
function SetShowReflowStats(inShow)
 
33
{
 
34
  netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
 
35
  gDebugTools.reflowCounts = inShow;
 
36
}
 
37
 
 
38
function DumpFrames()
 
39
{
 
40
  netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
 
41
  gDebugTools.dumpFrames();
 
42
}
 
43
 
 
44
function DumpContent()
 
45
{
 
46
  netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
 
47
  gDebugTools.dumpContent();
 
48
}
 
49
 
 
50
function DumpViews()
 
51
{
 
52
  netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
 
53
  gDebugTools.dumpViews();
 
54
}
 
55
 
 
56
function DumpWebShells()
 
57
{
 
58
  netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
 
59
  gDebugTools.dumpWebShells();
 
60
}
 
61
 
 
62
function InputKey(inEvent)
 
63
{
 
64
  if (inEvent.keyCode == KeyEvent.DOM_VK_ENTER || inEvent.keyCode == KeyEvent.DOM_VK_RETURN)
 
65
  {
 
66
    var pageFrame = window.frames.pageframe;
 
67
    pageFrame.location.href = document.dumpform.urlfield.value;
 
68
    inEvent.preventDefault();   // avoid form submit on hitting return
 
69
  }
 
70
}
 
71
 
 
72
function IframeLoaded()
 
73
{
 
74
  netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
 
75
  document.dumpform.urlfield.value = window.frames.pageframe.location.href;
 
76
}
 
77
</script>
 
78
 
 
79
<body onload="Init()">
 
80
 
 
81
<form name="dumpform">
 
82
<div style="margin-bottom: 5px">
 
83
URL: <input type="text" size="100" name="urlfield" value="http://www.mozilla.org" onkeypress="InputKey(event)"></input>
 
84
</div>
 
85
<div>
 
86
<input type="button" value="Dump Frames" onclick="DumpFrames()">
 
87
<input type="button" value="Dump Content" onclick="DumpContent()">
 
88
<input type="button" value="Dump Views" onclick="DumpViews()">
 
89
<input type="button" value="Dump WebShells" onclick="DumpWebShells()">
 
90
 
 
91
<input type="checkbox" id="showBordersCheck" name="showBordersCheck"
 
92
    onchange="SetShowFrameBorders(document.dumpform.showBordersCheck.checked)"></input>
 
93
<label for="showBordersCheck">Show Frame Borders</label>
 
94
</div>
 
95
</form>
 
96
 
 
97
<iframe name="pageframe" style="border: 1px solid black; width:800px; height:800px;" onload="IframeLoaded()"></iframe>
 
98
 
 
99
</body>
 
100
</html>
 
101