Bug 1023618 - Always call FlushRendering in the reftest harness. r=roc

This commit is contained in:
Seth Fowler 2014-06-11 20:21:08 -07:00
parent 43e9352610
commit ae3dab62d4

View File

@ -321,12 +321,7 @@ const STATE_WAITING_FOR_SPELL_CHECKS = 2;
const STATE_WAITING_TO_FINISH = 3;
const STATE_COMPLETED = 4;
function WaitForTestEnd(contentRootElement, inPrintMode, spellCheckedElements) {
var stopAfterPaintReceived = false;
var currentDoc = content.document;
var state = STATE_WAITING_TO_FIRE_INVALIDATE_EVENT;
function FlushRendering() {
function FlushRendering() {
var anyPendingPaintsGeneratedInDescendants = false;
function flushWindow(win) {
@ -357,7 +352,12 @@ function WaitForTestEnd(contentRootElement, inPrintMode, spellCheckedElements) {
!windowUtils().isMozAfterPaintPending) {
LogWarning("Internal error: descendant frame generated a MozAfterPaint event, but the root document doesn't have one!");
}
}
}
function WaitForTestEnd(contentRootElement, inPrintMode, spellCheckedElements) {
var stopAfterPaintReceived = false;
var currentDoc = content.document;
var state = STATE_WAITING_TO_FIRE_INVALIDATE_EVENT;
function AfterPaintListener(event) {
LogInfo("AfterPaintListener in " + event.target.document.location.href);
@ -597,6 +597,9 @@ function OnDocumentLoad(event)
var contentRootElement =
content.document ? content.document.documentElement : null;
// Flush the document in case it got modified in a load event handler.
FlushRendering();
// Take a snapshot now. We need to do this before we check whether
// we should wait, since this might trigger dispatching of
// MozPaintWait events and make shouldWaitForExplicitPaintWaiters() true