Bug 1282334 part 1 - Not check transaction id for non-e10s. r?dao draft
authorXidorn Quan <me@upsuper.org>
Tue, 28 Jun 2016 18:12:11 +1000
changeset 382161 d3f273e614f7bca9bff05f6f6b23196867f4d20a
parent 382160 260b04d1226f35bcb3c61bc3d17115507b573486
child 382162 a258bc82dcded36513e32db86b085de38f856980
push id21643
push userxquan@mozilla.com
push dateWed, 29 Jun 2016 03:37:41 +0000
reviewersdao
bugs1282334
milestone50.0a1
Bug 1282334 part 1 - Not check transaction id for non-e10s. r?dao 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
@@ -606,16 +606,20 @@ var WebBrowserChrome = {
 if (Services.appinfo.processType == Services.appinfo.PROCESS_TYPE_CONTENT) {
   let tabchild = docShell.QueryInterface(Ci.nsIInterfaceRequestor)
                          .getInterface(Ci.nsITabChild);
   tabchild.webBrowserChrome = WebBrowserChrome;
 }
 
 
 var DOMFullscreenHandler = {
+  // Smaller than any real transaction id, so that if the id is not set
+  // elsewhere (which is the case for non-e10s), the condition in the
+  // handler of MozAfterPaint can always be true.
+  _lastTransactionId: -1,
   _fullscreenDoc: null,
 
   init: function() {
     addMessageListener("DOMFullscreen:Entered", this);
     addMessageListener("DOMFullscreen:CleanUp", this);
     addEventListener("MozDOMFullscreen:Request", this);
     addEventListener("MozDOMFullscreen:Entered", this);
     addEventListener("MozDOMFullscreen:NewOrigin", this);
@@ -641,17 +645,17 @@ 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 (content.document.fullscreenElement && windowUtils) {
           this._lastTransactionId = windowUtils.lastTransactionId;
           windowUtils.exitFullscreen();
         }
         this._fullscreenDoc = null;
         break;
       }
     }
   },