Bug 1292321 - Pressing tab key in address bar selects one-off search buttons instead of the entries in the history dropdown list. r?florian draft
authorDrew Willcoxon <adw@mozilla.com>
Thu, 11 Aug 2016 14:46:02 -0700
changeset 399689 e3c367808b8dd2f79c007b22611566e01febbffc
parent 399051 df29bfbb6d10d6c5451abd2bfed40c6470ab7161
child 528027 d4860b4ddf7adb24698b721af19f3e581624cf3a
push id25944
push userdwillcoxon@mozilla.com
push dateThu, 11 Aug 2016 21:46:39 +0000
reviewersflorian
bugs1292321
milestone51.0a1
Bug 1292321 - Pressing tab key in address bar selects one-off search buttons instead of the entries in the history dropdown list. r?florian MozReview-Commit-ID: 6hbW7n5jiLS
browser/base/content/urlbarBindings.xml
browser/components/search/content/search.xml
--- a/browser/base/content/urlbarBindings.xml
+++ b/browser/base/content/urlbarBindings.xml
@@ -1287,16 +1287,17 @@ file, You can obtain one at http://mozil
       <xul:richlistbox anonid="richlistbox" class="autocomplete-richlistbox"
                        flex="1"/>
       <xul:hbox anonid="footer">
         <children/>
         <xul:vbox anonid="one-off-search-buttons"
                   class="search-one-offs"
                   compact="true"
                   includecurrentengine="true"
+                  disabletab="true"
                   flex="1"/>
       </xul:hbox>
     </content>
 
     <implementation>
       <field name="_maxResults">0</field>
 
       <field name="_bundle" readonly="true">
--- a/browser/components/search/content/search.xml
+++ b/browser/components/search/content/search.xml
@@ -1746,17 +1746,18 @@
           let stopEvent = false;
 
           // Tab cycles through the one-offs and moves the focus out at the end.
           // But only if non-Shift modifiers aren't also pressed, to avoid
           // clobbering other shortcuts.
           if (event.keyCode == KeyEvent.DOM_VK_TAB &&
               !event.altKey &&
               !event.ctrlKey &&
-              !event.metaKey) {
+              !event.metaKey &&
+              this.getAttribute("disabletab") != "true") {
             stopEvent = this.advanceSelection(!event.shiftKey, false, true);
           }
 
           // Alt + up/down is very similar to (shift +) tab but differs in that
           // it loops through the list, whereas tab will move the focus out.
           else if (event.altKey &&
                    (event.keyCode == KeyEvent.DOM_VK_DOWN ||
                     event.keyCode == KeyEvent.DOM_VK_UP)) {