Bug 607518 - After performed Paste & Go and Paste & Search , Ctrl+Z makes blank, Ctrl+Z is necessary twice to undo it. r+a=gavin
authorFrank Yan <fryn@frankyan.com>
Fri, 05 Nov 2010 12:56:03 -0700
changeset 56961 a75778b8f736657a8f3fa26025522f4eae843147
parent 56960 3769e11d18d6a18b05c277242f53180165eb9c17
child 56962 54ce534806447445d7b42a2427da994d79adc3e5
push id16739
push userfyan@mozilla.com
push dateFri, 05 Nov 2010 20:41:44 +0000
treeherdermozilla-central@13929bb5fbbe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs607518
milestone2.0b8pre
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 607518 - After performed Paste & Go and Paste & Search , Ctrl+Z makes blank, Ctrl+Z is necessary twice to undo it. r+a=gavin
browser/base/content/urlbarBindings.xml
browser/components/search/content/search.xml
--- a/browser/base/content/urlbarBindings.xml
+++ b/browser/base/content/urlbarBindings.xml
@@ -156,17 +156,17 @@
           insertLocation = insertLocation.nextSibling;
         if (insertLocation) {
           pasteAndGo = document.createElement("menuitem");
           let label = Services.strings.createBundle("chrome://browser/locale/browser.properties").
                                    GetStringFromName("pasteAndGo.label");
           pasteAndGo.setAttribute("label", label);
           pasteAndGo.setAttribute("anonid", "paste-and-go");
           pasteAndGo.setAttribute("oncommand",
-              "gURLBar.value = ''; goDoCommand('cmd_paste'); gURLBar.handleCommand();");
+              "gURLBar.select(); goDoCommand('cmd_paste'); gURLBar.handleCommand();");
           cxmenu.insertBefore(pasteAndGo, insertLocation.nextSibling);
         }
       ]]></constructor>
 
       <destructor><![CDATA[
         this._prefs.removeObserver("", this);
         this._prefs = null;
         this.inputField.controllers.removeController(this._copyCutController);
--- a/browser/components/search/content/search.xml
+++ b/browser/components/search/content/search.xml
@@ -600,17 +600,17 @@
                  insertLocation.getAttribute("cmd") != "cmd_paste")
             insertLocation = insertLocation.nextSibling;
           if (insertLocation) {
             element = document.createElementNS(kXULNS, "menuitem");
             label = this._stringBundle.getString("cmd_pasteAndSearch");
             element.setAttribute("label", label);
             element.setAttribute("anonid", "paste-and-search");
             element.setAttribute("oncommand",
-                "BrowserSearch.searchBar.value = ''; goDoCommand('cmd_paste'); BrowserSearch.searchBar.handleSearchCommand();");
+                "BrowserSearch.searchBar.select(); goDoCommand('cmd_paste'); BrowserSearch.searchBar.handleSearchCommand();");
             cxmenu.insertBefore(element, insertLocation.nextSibling);
             pasteAndSearch = element;
           }
 
           element = document.createElementNS(kXULNS, "menuitem");
           label = this._stringBundle.getString("cmd_clearHistory");
           akey = this._stringBundle.getString("cmd_clearHistory_accesskey");
           element.setAttribute("label", label);