From 579f15ed3ac96a02084b374494ef55d884436c7c Mon Sep 17 00:00:00 2001 From: Robert O'Callahan Date: Thu, 22 Jan 2009 17:15:40 +1300 Subject: [PATCH] Bug 474472. reftest harness should go back to the event loop after reftest-wait is removed and before we start checking isMozAfterPaintPending, in case reftest-wait was removed in a load event handler and that load event will unsuppress painting after the event handler has run. r=dbaron --HG-- extra : rebase_source : 8b75034df21cf20db0160fa13e807225b45171b6 --- layout/tools/reftest/reftest.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/layout/tools/reftest/reftest.js b/layout/tools/reftest/reftest.js index ba997ff2ec91..7493ec7441be 100644 --- a/layout/tools/reftest/reftest.js +++ b/layout/tools/reftest/reftest.js @@ -623,6 +623,14 @@ function OnDocumentLoad(event) // We don't want to be notified again contentRootElement.removeEventListener("DOMAttrModified", AttrModifiedListener, false); + // Wait for the next return-to-event-loop before continuing to flush rendering and + // check isMozAfterPaintPending --- for example, the attribute may have been modified + // in an subdocument's load event handler, in which case we need load event processing + // to complete and unsuppress painting before we check isMozAfterPaintPending. + setTimeout(AttrModifiedListenerContinuation, 0); + } + + function AttrModifiedListenerContinuation() { if (doPrintMode()) setupPrintMode(); FlushRendering();