Bug 1281455 - Prevent BrowserElementChildPreload._getContentDimensions to throw if called too early. r?fabrice draft
authorVivien Nicolas <vnicolas@mozilla.com>
Wed, 22 Jun 2016 15:03:59 +0200
changeset 380604 1fd75a5d7385b13229978bef5c0ba9a98ad867fb
parent 380603 9d67b83af043cd28b2e43f45aa20f922b504e44a
child 523758 ec6b65954fa88f804941339596f5c81858216080
push id21257
push userbmo:21@vingtetun.org
push dateWed, 22 Jun 2016 13:05:00 +0000
reviewersfabrice
bugs1281455
milestone50.0a1
Bug 1281455 - Prevent BrowserElementChildPreload._getContentDimensions to throw if called too early. r?fabrice MozReview-Commit-ID: J25ynAxQ8Pn
dom/browser-element/BrowserElementChildPreload.js
--- a/dom/browser-element/BrowserElementChildPreload.js
+++ b/dom/browser-element/BrowserElementChildPreload.js
@@ -1119,16 +1119,23 @@ BrowserElementChild.prototype = {
     });
   },
 
   _mozExitDomFullscreen: function(e) {
     sendAsyncMsg("exit-dom-fullscreen");
   },
 
   _getContentDimensions: function() {
+    if (!content.document.body) {
+      return {
+        width: 0,
+        height: 0
+      }
+    }
+
     return {
       width: content.document.body.scrollWidth,
       height: content.document.body.scrollHeight
     }
   },
 
   /**
    * Actually take a screenshot and foward the result up to our parent, given