add: 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); }  
context: 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);    }}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/9421/a93892999394bb77c125a422dd8544c7e3393005/reftest.js/clean/layout/tools/reftest/reftest.js