diff --git a/layout/tools/reftest/reftest-content.js b/layout/tools/reftest/reftest-content.js index 28cce1d57b0c..e21383bf5b4a 100644 --- a/layout/tools/reftest/reftest-content.js +++ b/layout/tools/reftest/reftest-content.js @@ -582,7 +582,11 @@ function WaitForTestEnd(contentRootElement, inPrintMode, spellCheckedElements) { return; } - FlushRendering(); + // We don't need to flush styles any more when we are in the state + // after reftest-wait has removed. + if (state != STATE_WAITING_TO_FINISH) { + FlushRendering(); + } switch (state) { case STATE_WAITING_TO_FIRE_INVALIDATE_EVENT: {