Bug 1442063 - Don't call FlushRendering() after we reached the state of STATE_WAITING_TO_FINISH. r?dbaron draft
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Fri, 09 Mar 2018 15:16:52 +0900
changeset 765153 085e3035b48cc4e55a9203bc9f7ae89334bb10b8
parent 765132 31a33fc619562e5b326585c6864d86832dac5126
push id101985
push userhikezoe@mozilla.com
push dateFri, 09 Mar 2018 06:25:39 +0000
reviewersdbaron
bugs1442063
milestone60.0a1
Bug 1442063 - Don't call FlushRendering() after we reached the state of STATE_WAITING_TO_FINISH. r?dbaron Once we reached the state of STATE_WAITING_TO_FINISH, we just need to wait for the final MozAfterPaint which is corresponding to flushRendering() after "reftest-wait" removal. MozReview-Commit-ID: EJxDYUnqbmr
layout/tools/reftest/reftest-content.js
--- a/layout/tools/reftest/reftest-content.js
+++ b/layout/tools/reftest/reftest-content.js
@@ -577,17 +577,21 @@ function WaitForTestEnd(contentRootEleme
     // change from returning true to returning false is monitored via some kind
     // of event listener which eventually calls this function.
     function MakeProgress() {
         if (state >= STATE_COMPLETED) {
             LogInfo("MakeProgress: STATE_COMPLETED");
             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: {
             LogInfo("MakeProgress: STATE_WAITING_TO_FIRE_INVALIDATE_EVENT");
             if (shouldWaitForExplicitPaintWaiters() || shouldWaitForPendingPaints()) {
                 gFailureReason = "timed out waiting for pending paint count to reach zero";
                 if (shouldWaitForExplicitPaintWaiters()) {
                     gFailureReason += " (waiting for MozPaintWaitFinished)";