rem: clearTimeout(gFailureTimeout);     setTimeout(setTimeout, 0, DocumentLoaded, 0); 
add: function shouldWait() { return contentRootElement.className.split(/\s+/) .indexOf("reftest-wait") != -1; }  var contentRootElement = gBrowser.contentDocument.documentElement; if (shouldWait()) {    contentRootElement.addEventListener( "DOMAttrModified", function(event) { if (!shouldWait()) { contentRootElement.removeEventListener( "DOMAttrModified", arguments.callee, false); setTimeout(DocumentLoaded, 0); } }, false); } else {     setTimeout(setTimeout, 0, DocumentLoaded, 0); } 
context: function OnDocumentLoad(event){    if (event.target != gBrowser.contentDocument)        // Ignore load events for subframes.        return;    clearTimeout(gFailureTimeout);    // 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/be0b28d6a29fef05c688e161bce604d66f1f9284/reftest.js/clean/layout/tools/reftest/reftest.js