Bug 833050 - JS errors during startup r=kats a=android-only
authorMark Finkle <mfinkle@mozilla.com>
Mon, 21 Jan 2013 14:43:09 -0500
changeset 119434 b5e93cc4237c7edfe185696f4d627b7411d99b3c
parent 119433 f8cb1716f5d42b3855c65d4ae3103433df1c82db
child 119435 a3313ce63be0d75a9bfbde17a29d7453b43affbd
push id24204
push usereakhgari@mozilla.com
push dateTue, 22 Jan 2013 17:50:00 +0000
treeherdermozilla-central@8962a7fabc33 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats, android-only
bugs833050
milestone21.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 833050 - JS errors during startup r=kats a=android-only
mobile/android/chrome/content/browser.js
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -529,18 +529,23 @@ var BrowserApp = {
   },
 
   // This function returns false during periods where the browser displayed document is
   // different from the browser content document, so user actions and some kinds of viewport
   // updates should be ignored. This period starts when we start loading a new page or
   // switch tabs, and ends when the new browser content document has been drawn and handed
   // off to the compositor.
   isBrowserContentDocumentDisplayed: function() {
-    if (window.top.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils).isFirstPaint)
+    try {
+      if (window.top.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils).isFirstPaint)
+        return false;
+    } catch (e) {
       return false;
+    }
+
     let tab = this.selectedTab;
     if (!tab)
       return true;
     return tab.contentDocumentIsDisplayed;
   },
 
   displayedDocumentChanged: function() {
     window.top.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils).isFirstPaint = true;
@@ -1016,16 +1021,19 @@ var BrowserApp = {
       gecko: {
         type: "Sanitize:Finished",
         success: success
       }
     });
   },
 
   getFocusedInput: function(aBrowser, aOnlyInputElements = false) {
+    if (!aBrowser)
+      return null;
+
     let doc = aBrowser.contentDocument;
     if (!doc)
       return null;
 
     let focused = doc.activeElement;
     while (focused instanceof HTMLFrameElement || focused instanceof HTMLIFrameElement) {
       doc = focused.contentDocument;
       focused = doc.activeElement;