Bug 632233 - In XULBrowserWindow.onLocationChange, look for a "disablefastfind" attribute in content documents after ensuring the URI scheme is "about" or "chrome". r=gavin
authorDão Gottwald <dao@mozilla.com>
Thu, 05 Jan 2012 10:13:34 +0100
changeset 85079 dd994bf80fc0ab805e336bf94699ad19e7d6a798
parent 85078 2c1e788aea4eae6e68f325d95e9b5f626e2239fd
child 85080 18a8baa27b416dc5dbfaa5ad5342c0d6babb32f9
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgavin
bugs632233
milestone12.0a1
Bug 632233 - In XULBrowserWindow.onLocationChange, look for a "disablefastfind" attribute in content documents after ensuring the URI scheme is "about" or "chrome". r=gavin
browser/base/content/browser.js
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -4702,20 +4702,22 @@ var XULBrowserWindow = {
 
       // Show or hide browser chrome based on the whitelist
       if (this.hideChromeForLocation(location))
         document.documentElement.setAttribute("disablechrome", "true");
       else
         document.documentElement.removeAttribute("disablechrome");
 
       // Disable find commands in documents that ask for them to be disabled.
-      let docElt = content.document.documentElement;
-      let disableFind = aLocationURI &&
-        (docElt && docElt.getAttribute("disablefastfind") == "true") &&
-        (aLocationURI.schemeIs("about") || aLocationURI.schemeIs("chrome"));
+      let disableFind = false;
+      if (aLocationURI &&
+          (aLocationURI.schemeIs("about") || aLocationURI.schemeIs("chrome"))) {
+        let docElt = content.document.documentElement;
+        disableFind = docElt && docElt.getAttribute("disablefastfind") == "true";
+      }
       let findCommands = [document.getElementById("cmd_find"),
                           document.getElementById("cmd_findAgain"),
                           document.getElementById("cmd_findPrevious")];
       findCommands.forEach(function (elt) {
         if (disableFind)
           elt.setAttribute("disabled", "true");
         else
           elt.removeAttribute("disabled");