Bug 978861: disable prefillWithSelection on OSX by default, fix its semantics when enabled. r=ehsan
☠☠ backed out by f4782d7db879 ☠ ☠
authorMike de Boer <mdeboer@mozilla.com>
Fri, 02 May 2014 16:01:08 +0200
changeset 181782 e3c1fffb0145233bde8fad42deef96dc13db632b
parent 181781 4dc06a48ed13d8815eb270fbbbc43ba34863ee04
child 181783 0610c2dcc6f5c9dec754b158b8086567770e5087
push id272
push userpvanderbeken@mozilla.com
push dateMon, 05 May 2014 16:31:18 +0000
reviewersehsan
bugs978861
milestone32.0a1
Bug 978861: disable prefillWithSelection on OSX by default, fix its semantics when enabled. r=ehsan
modules/libpref/src/init/all.js
toolkit/content/widgets/findbar.xml
--- a/modules/libpref/src/init/all.js
+++ b/modules/libpref/src/init/all.js
@@ -518,17 +518,21 @@ pref("accessibility.typeaheadfind.autost
 // other - "auto"   (case-sensitive for mixed-case input, insensitive otherwise)
 pref("accessibility.typeaheadfind.casesensitive", 0);
 pref("accessibility.typeaheadfind.linksonly", true);
 pref("accessibility.typeaheadfind.startlinksonly", false);
 pref("accessibility.typeaheadfind.timeout", 4000);
 pref("accessibility.typeaheadfind.enabletimeout", true);
 pref("accessibility.typeaheadfind.soundURL", "beep");
 pref("accessibility.typeaheadfind.enablesound", true);
+#ifdef XP_MACOSX
+pref("accessibility.typeaheadfind.prefillwithselection", false);
+#else
 pref("accessibility.typeaheadfind.prefillwithselection", true);
+#endif
 pref("accessibility.typeaheadfind.matchesCountTimeout", 250);
 pref("accessibility.typeaheadfind.matchesCountLimit", 100);
 
 // use Mac OS X Appearance panel text smoothing setting when rendering text, disabled by default
 pref("gfx.use_text_smoothing_setting", false);
 
 // loading and rendering of framesets and iframes
 pref("browser.frames.enabled", true);
--- a/toolkit/content/widgets/findbar.xml
+++ b/toolkit/content/widgets/findbar.xml
@@ -1193,16 +1193,23 @@
           let searchString = this.browser.finder.setSearchStringToSelection();
           if (searchString)
             this._findField.value = searchString;
         ]]></body>
       </method>
 
       <method name="_onFindFieldFocus">
         <body><![CDATA[
+          let prefsvc =
+            Components.classes["@mozilla.org/preferences-service;1"]
+                      .getService(Components.interfaces.nsIPrefBranch);
+          const kPref = "accessibility.typeaheadfind.prefillwithselection";
+          if (this.prefillWithSelection && prefsvc.getBoolPref(kPref))
+            return;
+
           let clipboardSearchString = this._browser.finder.clipboardSearchString;
           if (clipboardSearchString && this._findField.value != clipboardSearchString) {
             this._findField.value = clipboardSearchString;
             // Changing the search string makes the previous status invalid, so
             // we better clear it here.
             this._updateStatusUI();
           }
         ]]></body>