Bug 1282334 part 1 - Not check transaction id for non-e10s. r=dao a=sylvestre
authorXidorn Quan <me@upsuper.org>
Thu, 30 Jun 2016 14:57:30 +1000
changeset 341787 cea38bcafb6ad58462496b582cec8eb361a727df
parent 341786 c4d9753fc143a9e47d553bee75944b6746ea6662
child 341788 19de2d70cf3ff501837ea13a3803e31d8e54b259
push id1183
push userraliiev@mozilla.com
push dateMon, 05 Sep 2016 20:01:49 +0000
treeherdermozilla-release@3148731bed45 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdao, sylvestre
bugs1282334
milestone49.0a2
Bug 1282334 part 1 - Not check transaction id for non-e10s. r=dao a=sylvestre Before this patch, there are two issues for non-e10s window: * The initial entering fullscreen would hit timeout because we do not record lastTransitionId for entering for non-e10s, and a number is never larger than undefined, so MozAfterPaint never triggers the message it should trigger. * Every exiting fullscreen may hit timeout because when we record the transition id in DOMFullscreen:CleanUp, the last paint for fullscreen change may have completed, and consequently we won't receive any new MozAfterPaint with a larger transition if the page is static. MozReview-Commit-ID: IWCC6QHA3AL
browser/base/content/tab-content.js
--- a/browser/base/content/tab-content.js
+++ b/browser/base/content/tab-content.js
@@ -641,17 +641,21 @@ var DOMFullscreenHandler = {
           // If we don't actually have any pending fullscreen request
           // to handle, neither we have been in fullscreen, tell the
           // parent to just exit.
           sendAsyncMessage("DOMFullscreen:Exit");
         }
         break;
       }
       case "DOMFullscreen:CleanUp": {
-        if (windowUtils) {
+        // If we've exited fullscreen at this point, no need to record
+        // transaction id or call exit fullscreen. This is especially
+        // important for non-e10s, since in that case, it is possible
+        // that no more paint would be triggered after this point.
+        if (content.document.fullscreenElement && windowUtils) {
           this._lastTransactionId = windowUtils.lastTransactionId;
           windowUtils.exitFullscreen();
         }
         this._fullscreenDoc = null;
         break;
       }
     }
   },
@@ -682,17 +686,20 @@ var DOMFullscreenHandler = {
           // ensure that the parent always exits fullscreen when we do.
           sendAsyncMessage("DOMFullscreen:Exit");
         }
         break;
       }
       case "MozAfterPaint": {
         // Only send Painted signal after we actually finish painting
         // the transition for the fullscreen change.
-        if (aEvent.transactionId > this._lastTransactionId) {
+        // Note that this._lastTransactionId is not set when in non-e10s
+        // mode, so we need to check that explicitly.
+        if (!this._lastTransactionId ||
+            aEvent.transactionId > this._lastTransactionId) {
           removeEventListener("MozAfterPaint", this);
           sendAsyncMessage("DOMFullscreen:Painted");
         }
         break;
       }
     }
   }
 };