Bug 1320095 Implement forwarder for onFindbarOpen() and other missing methods in the tabbrowser findbar object. f=frg r=IanN a=Ratty
authorPhilip Chee <philip.chee@gmail.com>
Sat, 10 Dec 2016 17:05:41 +0800
changeset 23894 541426af19003961a9c36fb776b33e261a191840
parent 23893 29b034f30fcb12b0e252a33502ba44521f5768d9
child 23895 bb630196e49350201ed7d9881a12362f08db895e
push id1973
push userclokep@gmail.com
push dateMon, 23 Jan 2017 21:55:50 +0000
treeherdercomm-aurora@9b85bcae26a8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersIanN, Ratty
bugs1320095
Bug 1320095 Implement forwarder for onFindbarOpen() and other missing methods in the tabbrowser findbar object. f=frg r=IanN a=Ratty Also update SeaMonkey's findbar.xml to sync with the toolkit findbar.xml
suite/browser/tabbrowser.xml
suite/common/bindings/findbar.xml
--- a/suite/browser/tabbrowser.xml
+++ b/suite/browser/tabbrowser.xml
@@ -2803,45 +2803,69 @@
             return this.finder.clipboardSearchString;
           },
           set clipboardSearchString(val) {
             return this.finder.clipboardSearchString = val;
           },
           set caseSensitive(val) {
             return this.finder.caseSensitive = val;
           },
+          set aEntireWord(val) {
+            return this.finder.aEntireWord = val;
+          },
+          get highlighter() {
+            return this.finder.highlighter;
+          },
+          get matchesCountLimit() {
+            return this.finder.matchesCountLimit;
+          },
           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);
+          highlight: function(...args) {
+            this.finder.highlight(...args);
           },
           getInitialSelection: function() {
             this.finder.getInitialSelection();
           },
+          getActiveSelectionText: function() {
+            return this.finder.getActiveSelectionText();
+          },
           enableSelection: function() {
             this.finder.enableSelection();
           },
           removeSelection: function() {
             this.finder.removeSelection();
           },
           focusContent: function() {
             this.finder.focusContent();
           },
+          onFindbarClose: function() {
+            this.finder.onFindbarClose();
+          },
+          onFindbarOpen: function() {
+            this.finder.onFindbarOpen();
+          },
+          onModalHighlightChange: function(...args) {
+            return this.finder.onModalHighlightChange(...args);
+          },
+          onHighlightAllChange: function(...args) {
+            return this.finder.onHighlightAllChange(...args);
+          },
           keyPress: function(aEvent) {
             this.finder.keyPress(aEvent);
           },
-          requestMatchesCount: function(aWord, aMatchLimit, aLinksOnly) {
-            this.finder.requestMatchesCount(aWord, aMatchLimit, aLinksOnly);
+          requestMatchesCount: function(...args) {
+            this.finder.requestMatchesCount(...args);
           }
         })
       ]]></field>
 
       <property name="docShell"
                 onget="return this.mCurrentBrowser.docShell"
                 readonly="true"/>
 
--- a/suite/common/bindings/findbar.xml
+++ b/suite/common/bindings/findbar.xml
@@ -87,20 +87,27 @@
 
           var prefsvc =
             Components.classes["@mozilla.org/preferences-service;1"]
                       .getService(Components.interfaces.nsIPrefBranch);
           prefsvc.removeObserver("accessibility.typeaheadfind.linksonly",
                                  this._observer);
           prefsvc.removeObserver("accessibility.typeaheadfind.casesensitive",
                                  this._observer);
+          prefsvc.removeObserver("findbar.entireword", this._observer);
+          prefsvc.removeObserver("findbar.highlightAll", this._observer);
+          prefsvc.removeObserver("findbar.modalHighlight", this._observer);
+
           prefsvc.removeObserver("accessibility.typeaheadfind.usefindbar",
                                  this._suiteObserver);
           prefsvc.removeObserver("accessibility.typeaheadfind.autostart",
                                  this._suiteObserver);
+
+          // Clear all timers that might still be running.
+          this._cancelTimers();
         ]]></body>
       </method>
 
       <method name="_updateBrowserWithState">
         <body><![CDATA[
           window.messageManager.broadcastAsyncMessage("Findbar:UpdateState", {
             findMode: this._findMode,
             findAsYouType: this._findAsYouType,
@@ -114,20 +121,21 @@
           switch (aMessage.name) {
             case "Findbar:Mouseup":
               if (!this.hidden && this._findMode != this.FIND_NORMAL)
                 this.close();
               break;
 
             case "Findbar:Keypress":
               if (this._useFindbar)
-                return this._onBrowserKeypress(aMessage.data);
+                return this._onBrowserKeypress(aMessage.data.fakeEvent,
+                                               aMessage.data.shouldFastFind);
               break;
           }
-          return true;
+          return undefined;
         ]]></body>
       </method>
 
       <method name="startFastFind">
         <parameter name="aMode"/>
         <body><![CDATA[
           if (this._findMode == aMode && this._quickFindTimeout) {
             this._findField.select();