Bug 569342: Find bar should not be enabled in about:addons. r=gavin
☠☠ backed out by 3e15e567ae44 ☠ ☠
authorDave Townsend <dtownsend@oxymoronical.com>
Mon, 07 Jun 2010 09:31:48 -0700
changeset 43313 33760547ecf7edc099b4ca4abc5cb475d9dfb86a
parent 43312 5ca801749b47e8a153b39f30c7248f2ae3900a0b
child 43314 6c3d62593a9e91d842e6f458a930da72b204d143
child 43315 3e15e567ae44cd4b2fdd044a7d973fb0089d5cc7
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgavin
bugs569342
milestone1.9.3a5pre
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 569342: Find bar should not be enabled in about:addons. r=gavin
browser/base/content/test/Makefile.in
browser/base/content/test/browser_bug569342.js
toolkit/components/viewconfig/content/config.xul
toolkit/content/widgets/findbar.xml
toolkit/mozapps/extensions/content/extensions.xul
--- a/browser/base/content/test/Makefile.in
+++ b/browser/base/content/test/Makefile.in
@@ -118,16 +118,17 @@ include $(topsrcdir)/config/rules.mk
                  browser_bug517902.js \
                  browser_bug520538.js \
                  browser_bug521216.js \
                  browser_bug537474.js \
                  browser_bug550565.js \
                  browser_bug555224.js \
                  browser_bug556061.js \
                  browser_bug563588.js \
+                 browser_bug569342.js \
                  browser_contextSearchTabPosition.js \
                  browser_ctrlTab.js \
                  browser_discovery.js \
                  browser_drag.js \
                  browser_gestureSupport.js \
                  browser_getshortcutoruri.js \
                  browser_inspector_initialization.js \
                  browser_inspector_treeSelection.js \
new file mode 100644
--- /dev/null
+++ b/browser/base/content/test/browser_bug569342.js
@@ -0,0 +1,48 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/
+ */
+
+var gTab = null;
+
+function cleanUp() {
+  gBrowser.removeTab(gTab);
+  finish();
+}
+
+// function borrowed from browser_bug386835.js
+function load(tab, url, cb) {
+  tab.linkedBrowser.addEventListener("load", function (event) {
+    event.currentTarget.removeEventListener("load", arguments.callee, true);
+    cb();
+  }, true);
+  tab.linkedBrowser.loadURI(url);
+}
+
+function test() {
+  waitForExplicitFinish();
+
+  gTab = gBrowser.selectedTab = gBrowser.addTab();
+  ok(gFindBar.hidden, "Find bar should not be visible");
+
+  run_test_1();
+}
+
+function run_test_1() {
+  load(gTab, "about:config", function() {
+    ok(gFindBar.hidden, "Find bar should not be visible");
+    EventUtils.synthesizeKey("/", {}, gTab.linkedBrowser.contentWindow);
+    ok(gFindBar.hidden, "Find bar should not be visible");
+
+    run_test_2();
+  });
+}
+
+function run_test_2() {
+  load(gTab, "about:addons", function() {
+    ok(gFindBar.hidden, "Find bar should not be visible");
+    EventUtils.synthesizeKey("/", {}, gTab.linkedBrowser.contentWindow);
+    ok(gFindBar.hidden, "Find bar should not be visible");
+
+    cleanUp();
+  });
+}
--- a/toolkit/components/viewconfig/content/config.xul
+++ b/toolkit/components/viewconfig/content/config.xul
@@ -43,16 +43,17 @@
 <!DOCTYPE window SYSTEM "chrome://global/locale/config.dtd">
 
 <window id="config"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" 
         title="&window.title;"
         windowtype="Preferences:ConfigManager"
         width="750"
         height="500"
+        disablefastfind="true"
         onunload="onConfigUnload();"
         onload="onConfigLoad();">
 
 <script src="chrome://global/content/config.js"/>
 
 <stringbundle id="configBundle" src="chrome://global/locale/config.properties"/>
 
 <popup id="configContext" onpopupshowing="if (event.target == this) updateContextMenu();">
--- a/toolkit/content/widgets/findbar.xml
+++ b/toolkit/content/widgets/findbar.xml
@@ -1363,20 +1363,25 @@
             else if (elt instanceof HTMLTextAreaElement ||
                      elt instanceof HTMLSelectElement ||
                      elt instanceof HTMLIsIndexElement ||
                      elt instanceof HTMLObjectElement ||
                      elt instanceof HTMLEmbedElement)
               return false;
           }
 
-          // disable FAYT in about:config and about:blank to prevent FAYT
-          // opening unexpectedly - to fix bugs 264562, 267150, 269712
-          var url = this.browser.currentURI.spec;
-          if (url == "about:blank" || url == "about:config")
+          // disable FAYT in about:blank to prevent FAYT opening unexpectedly.
+          var url = this.browser.currentURI;
+          if (url.spec == "about:blank")
+            return false;
+
+          // disable FAYT in documents that ask for it to be disabled.
+          if ((url.schemeIs("about") || url.schemeIs("chrome")) &&
+              (win.document.documentElement &&
+               win.document.documentElement.getAttribute("disablefastfind") == "true"))
             return false;
 
           if (win) {
             try {
               var editingSession = win.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
                                    .getInterface(Components.interfaces.nsIWebNavigation)
                                    .QueryInterface(Components.interfaces.nsIInterfaceRequestor)
                                    .getInterface(Components.interfaces.nsIEditingSession);
--- a/toolkit/mozapps/extensions/content/extensions.xul
+++ b/toolkit/mozapps/extensions/content/extensions.xul
@@ -41,16 +41,17 @@
 <?xml-stylesheet href="chrome://mozapps/skin/extensions/extensions.css"?>
 
 <!DOCTYPE page [
 <!ENTITY % extensionsDTD SYSTEM "chrome://mozapps/locale/extensions/extensions.dtd">
 %extensionsDTD;
 ]>
 
 <page xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+      disablefastfind="true"
       id="addons-page" title="&addons.windowTitle;">
 
   <script type="application/javascript"
           src="chrome://mozapps/content/extensions/extensions.js"/>
 
   <popupset>
     <!-- menu for an addon item -->
     <menupopup id="addonitem-popup">