Bug 962910 Findbar only shows status messages for the original tab r=Ratty a=IanN
authorNeil Rashbrook <neil@parkwaycc.co.uk>
Mon, 30 Mar 2015 00:42:37 +0100
changeset 25745 0bf9ce4891ac7e4086248973e8007d20f909877b
parent 25744 8c85927c474b15c93493fb89ff5879240eb8a5bf
child 25746 5576f057ebbd3e81298c72d4bf55e50a2cacb4b5
push id1850
push userclokep@gmail.com
push dateWed, 08 Mar 2017 19:29:12 +0000
treeherdercomm-esr52@028df196b2d9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersRatty, IanN
bugs962910
Bug 962910 Findbar only shows status messages for the original tab r=Ratty a=IanN
suite/browser/tabbrowser.xml
--- a/suite/browser/tabbrowser.xml
+++ b/suite/browser/tabbrowser.xml
@@ -983,22 +983,25 @@
             //       so we use mCurrentTab.linkedBrowser instead.
             newBrowser.droppedLinkHandler = this.mCurrentTab.linkedBrowser.droppedLinkHandler;
             newBrowser.showWindowResizer = this.mCurrentTab.linkedBrowser.showWindowResizer;
             newBrowser.docShellIsActive = this.mCurrentTab.linkedBrowser.docShellIsActive;
             if (this.mCurrentBrowser) {
               this.mCurrentBrowser.droppedLinkHandler = null;
               this.mCurrentBrowser.docShellIsActive = false;
               this.mCurrentBrowser.setAttribute("type", "content-targetable");
+              this.finder.mListeners.forEach(l => this.mCurrentBrowser.finder.removeResultListener(l));
             }
 
             newBrowser.setAttribute("type", "content-primary");
             this.mCurrentBrowser = newBrowser;
             this.mCurrentTab = this.selectedTab;
             this.mCurrentTab.removeAttribute("unread");
+            this.finder.mListeners.forEach(l => this.mCurrentBrowser.finder.addResultListener(l));
+
             var tabListener = this.mTabListeners[this.tabContainer.selectedIndex];
 
             // Update the URL bar.
             const nsIWebProgressListener = Components.interfaces.nsIWebProgressListener;
             this.updateUrlBar(newBrowser.webProgress,
                               null,
                               newBrowser.currentURI,
                               0,
@@ -2561,19 +2564,75 @@
           ]]>
         </body>
       </method>
 
       <property name="currentURI"
                 onget="return this.mCurrentBrowser.currentURI;"
                 readonly="true"/>
 
-      <property name="finder"
-                onget="return this.mCurrentBrowser.finder"
-                readonly="true"/>
+      <field name="finder"><![CDATA[
+        ({
+          mTabBrowser: this,
+          mListeners: new Set(),
+          get finder() {
+            return this.mTabBrowser.mCurrentBrowser.finder;
+          },
+          addResultListener: function(aListener) {
+            this.mListeners.add(aListener);
+            this.finder.addResultListener(aListener);
+          },
+          removeResultListener: function(aListener) {
+            this.mListeners.delete(aListener);
+            this.finder.removeResultListener(aListener);
+          },
+          get searchString() {
+            return this.finder.searchString;
+          },
+          get clipboardSearchString() {
+            return this.finder.clipboardSearchString;
+          },
+          set clipboardSearchString(val) {
+            return this.finder.clipboardSearchString = val;
+          },
+          set caseSensitive(val) {
+            return this.finder.caseSensitive = val;
+          },
+          fastFind: function(aSearchString, aLinksOnly, aDrawOutline) {
+            this.finder.fastFind(aSearchString, aLinksOnly, aDrawOutline);
+          },
+          findAgain: function(aFindBackwards, aLinksOnly, aDrawOutline) {
+            this.finder.findAgain(aFindBackwards, aLinksOnly, aDrawOutline);
+          },
+          setSearchStringToSelection: function() {
+            return this.finder.setSearchStringToSelection();
+          },
+          highlight: function(aHighlight, aWord) {
+            this.finder.highlight(aHighlight, aWord);
+          },
+          getInitialSelection: function() {
+            this.finder.getInitialSelection();
+          },
+          enableSelection: function() {
+            this.finder.enableSelection();
+          },
+          removeSelection: function() {
+            this.finder.removeSelection();
+          },
+          focusContent: function() {
+            this.finder.focusContent();
+          },
+          keyPress: function(aEvent) {
+            this.finder.keyPress(aEvent);
+          },
+          requestMatchesCount: function(aWord, aMatchLimit, aLinksOnly) {
+            this.finder.requestMatchesCount(aWord, aMatchLimit, aLinksOnly);
+          }
+        })
+      ]]></field>
 
       <property name="docShell"
                 onget="return this.mCurrentBrowser.docShell"
                 readonly="true"/>
 
       <property name="webNavigation"
                 onget="return this.mCurrentBrowser.webNavigation"
                 readonly="true"/>