if (doPrintMode()) { var PSSVC = Components.classes["@mozilla.org/gfx/printsettings-service;1"] .getService(Components.interfaces.nsIPrintSettingsService); var ps = PSSVC.newPrintSettings; ps.paperWidth = 5; ps.paperHeight = 3; ps.headerStrLeft = ""; ps.headerStrCenter = ""; ps.headerStrRight = ""; ps.footerStrLeft = ""; ps.footerStrCenter = ""; ps.footerStrRight = ""; gBrowser.docShell.contentViewer.setPageMode(true, ps); }  
function OnDocumentLoad(event){    if (event.target != gBrowser.contentDocument)        // Ignore load events for subframes.        return;    function shouldWait() {      return contentRootElement.className.split(/\s+/)                               .indexOf("reftest-wait") != -1;    }    var contentRootElement = gBrowser.contentDocument.documentElement;    if (shouldWait()) {        // The testcase will let us know when the test snapshot should be made.        // Register a mutation listener to know when the 'reftest-wait' class        // gets removed.        contentRootElement.addEventListener(            "DOMAttrModified",            function(event) {                if (!shouldWait()) {                    contentRootElement.removeEventListener(                        "DOMAttrModified",                        arguments.callee,                        false);                    setTimeout(DocumentLoaded, 0);                }            }, false);    } else {        // Since we can't use a bubbling-phase load listener from chrome,        // this is a capturing phase listener.  So do setTimeout twice, the        // first to get us after the onload has fired in the content, and        // the second to get us after any setTimeout(foo, 0) in the content.        setTimeout(setTimeout, 0, DocumentLoaded, 0);    }}
5459	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/5459/9b61bf8ea8cb27d534679f0edc4fdf4ab87e850d/reftest.js/buggy/layout/tools/reftest/reftest.js