Bug 1079665 - [e10s] Findbar focusContent doesn't work when a link was found. r=enndeakin
authorFelipe Gomes <felipc@gmail.com>
Tue, 24 Mar 2015 18:58:32 -0300
changeset 235372 690cfd1cf8421dc4f395599c1834273e22527b46
parent 235371 603d839658dc555daca9f4e02a6fff6257eb473a
child 235373 466c2dfda162855809c3899b6ebc8bbc25977fe4
push id11959
push userfelipc@gmail.com
push dateTue, 24 Mar 2015 22:00:27 +0000
treeherderfx-team@690cfd1cf842 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersenndeakin
bugs1079665
milestone39.0a1
Bug 1079665 - [e10s] Findbar focusContent doesn't work when a link was found. r=enndeakin
toolkit/content/widgets/findbar.xml
toolkit/modules/RemoteFinder.jsm
--- a/toolkit/content/widgets/findbar.xml
+++ b/toolkit/content/widgets/findbar.xml
@@ -628,17 +628,16 @@
         <body><![CDATA[
           if (this.hidden)
             return;
 
           this.hidden = true;
 
           this.browser.finder.focusContent();
           this.browser.finder.enableSelection();
-          this._findField.blur();
 
           this._cancelTimers();
 
           this._findFailedString = null;
         ]]></body>
       </method>
 
       <method name="clear">
--- a/toolkit/modules/RemoteFinder.jsm
+++ b/toolkit/modules/RemoteFinder.jsm
@@ -100,26 +100,28 @@ RemoteFinder.prototype = {
     this._browser.messageManager.sendAsyncMessage("Finder:CaseSensitive",
                                                   { caseSensitive: aSensitive });
   },
 
   getInitialSelection: function() {
     this._browser.messageManager.sendAsyncMessage("Finder:GetInitialSelection", {});
   },
 
-  fastFind: function (aSearchString, aLinksOnly) {
+  fastFind: function (aSearchString, aLinksOnly, aDrawOutline) {
     this._browser.messageManager.sendAsyncMessage("Finder:FastFind",
                                                   { searchString: aSearchString,
-                                                    linksOnly: aLinksOnly });
+                                                    linksOnly: aLinksOnly,
+                                                    drawOutline: aDrawOutline });
   },
 
-  findAgain: function (aFindBackwards, aLinksOnly) {
+  findAgain: function (aFindBackwards, aLinksOnly, aDrawOutline) {
     this._browser.messageManager.sendAsyncMessage("Finder:FindAgain",
                                                   { findBackwards: aFindBackwards,
-                                                    linksOnly: aLinksOnly });
+                                                    linksOnly: aLinksOnly,
+                                                    drawOutline: aDrawOutline });
   },
 
   highlight: function (aHighlight, aWord) {
     this._browser.messageManager.sendAsyncMessage("Finder:Highlight",
                                                   { highlight: aHighlight,
                                                     word: aWord });
   },
 
@@ -138,16 +140,17 @@ RemoteFinder.prototype = {
         if ("shouldFocusContent" in l &&
             !l.shouldFocusContent())
           return;
       } catch (ex) {
         Cu.reportError(ex);
       }
     }
 
+    this._browser.focus();
     this._browser.messageManager.sendAsyncMessage("Finder:FocusContent");
   },
 
   keyPress: function (aEvent) {
     this._browser.messageManager.sendAsyncMessage("Finder:KeyPress",
                                                   { keyCode: aEvent.keyCode,
                                                     shiftKey: aEvent.shiftKey });
   },
@@ -216,21 +219,23 @@ RemoteFinderListener.prototype = {
         let selection = this._finder.getActiveSelectionText();
         this._global.sendAsyncMessage("Finder:CurrentSelectionResult",
                                       { selection: selection,
                                         initial: true });
         break;
       }
 
       case "Finder:FastFind":
-        this._finder.fastFind(data.searchString, data.linksOnly);
+
+        this._finder.fastFind(data.searchString, data.linksOnly, data.drawOutline);
+        this._finder.setSelectionModeAndRepaint(Ci.nsISelectionController.SELECTION_ON);
         break;
 
       case "Finder:FindAgain":
-        this._finder.findAgain(data.findBackwards, data.linksOnly);
+        this._finder.findAgain(data.findBackwards, data.linksOnly, data.drawOutline);
         break;
 
       case "Finder:Highlight":
         this._finder.highlight(data.highlight, data.word);
         break;
 
       case "Finder:RemoveSelection":
         this._finder.removeSelection();