layout/tools/tests/content_dumping.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>Control Frame</title>
     6 </head>
     8 <script type="application/javascript">
    10 const nsILayoutDebuggingTools = Components.interfaces.nsILayoutDebuggingTools;
    11 var gDebugTools;
    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 }
    20 function SetShowFrameBorders(inShow)
    21 {
    22   netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
    23   gDebugTools.visualDebugging = inShow;
    24 }
    26 function SetShowEventTargetBorders(inShow)
    27 {
    28   netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
    29   gDebugTools.visualEventDebugging = inShow;
    30 }
    32 function SetShowReflowStats(inShow)
    33 {
    34   netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
    35   gDebugTools.reflowCounts = inShow;
    36 }
    38 function DumpFrames()
    39 {
    40   netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
    41   gDebugTools.dumpFrames();
    42 }
    44 function DumpContent()
    45 {
    46   netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
    47   gDebugTools.dumpContent();
    48 }
    50 function DumpViews()
    51 {
    52   netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
    53   gDebugTools.dumpViews();
    54 }
    56 function DumpWebShells()
    57 {
    58   netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
    59   gDebugTools.dumpWebShells();
    60 }
    62 function InputKey(inEvent)
    63 {
    64   if (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 }
    72 function IframeLoaded()
    73 {
    74   netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
    75   document.dumpform.urlfield.value = window.frames.pageframe.location.href;
    76 }
    77 </script>
    79 <body onload="Init()">
    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()">
    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>
    97 <iframe name="pageframe" style="border: 1px solid black; width:800px; height:800px;" onload="IframeLoaded()"></iframe>
    99 </body>
   100 </html>

mercurial