forked from mozilla/gecko-dev
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1672507 - History results are not shown in search mode when they …
…are set to come before search suggestions. r=harry When the user unchecks the "Show search suggestions before history results" pref, we change browser.urlbar.matchBuckets to general:5;suggestions:Infinity. When the code inverted the buckets, it put Infinity suggestions before general results, pushing them away. That pref could also be modified by the users or an experiment, so we can't just set a suggestions limit from the default value (4 at this time). The safest solution seems to be to get the results, then transplant suggestions at the top, that allows to keep the matchBuckets defined number of general results and fill remaining space above them with suggestions. Differential Revision: https://phabricator.services.mozilla.com/D102346
- Loading branch information
Showing
5 changed files
with
104 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
browser/components/urlbar/tests/browser/searchSuggestionEngineMany.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- Any copyright is dedicated to the Public Domain. | ||
- http://creativecommons.org/publicdomain/zero/1.0/ --> | ||
|
||
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/"> | ||
<ShortName>browser_searchSuggestionEngineMany searchSuggestionEngineMany.xml</ShortName> | ||
<Url type="application/x-suggestions+json" method="GET" template="http://mochi.test:8888/browser/browser/components/urlbar/tests/browser/searchSuggestionEngine.sjs?{searchTerms}&count=10"/> | ||
<Url type="text/html" method="GET" template="http://mochi.test:8888/" rel="searchform"> | ||
<Param name="terms" value="{searchTerms}"/> | ||
</Url> | ||
</SearchPlugin> |