mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-11-11 05:39:41 +02:00
Summary of major changes:
* Bookmarks, history, and tabs restriction chars now enter search mode. I added
a method to UrlbarProviderHeuristicFallback to return a result with a keyword
when one of these is used.
* This fixes other bugs like recognizing aliases that are entered at the
beginning of non-empty search strings, and not quasi-re-entering search mode
when search mode is already entered and you type another alias.
* The heuristic now determines whether we enter search mode, similar to how it
also determines whether we autofill. When the heuristic has a keyword but no
keyword offer, and the keyword is one of the recognized search mode keywords,
then we enter search mode, cancel the current query, and start a new query
with the remainder of the search string after the keyword.
* I slightly changed how we detect an alias, but only when update2 is
enabled. Now, an alias must be followed by a space; otherwise, the alias is
not recognized and instead just remains part of the seach string. Because if
we don't do that, then you end up in a strange situation after typing an alias
but before pressing space: The heuristic says "Search with <engine with the
alias>", but we haven't entered search mode yet because you haven't typed a
space yet. This is true for both @aliaes and non-@aliases.
* A consequence of the previous point is that we can still autofill @aliases
with a trailing space, which IMO is important. Then, once the user types any
char (space or not), we immediately enter search mode with the query being
whatever char they typed. This is less important after bug 1658605 landed, but
it's still good to have.
* Previously, `UrlbarView.onQueryResults` called UrlbarInput in order to
autofill after the first result is received. This is circuitous becaue the
input already has an `onFirstResult` method, which I now use to enter search
mode when appropriate. So I moved the autofill call from UrlbarView to
`UrlbarInput.onFirstResult`.
* As I mentioned, I improved some test framework and simplified some related
product (non-test) code. For example:
* I removed `UrlbarUtils.KEYWORD_OFFER.NONE` in favor of just leaving
`keywordOffer` as `undefined`.
* `tailOffsetIndex` can now be `undefined` if it's not relevant.
* I removed empty-string `icon` properties from payloads in favor of
`undefined`.
* In tests, I ignore `undefined` but present properties in payloads so they
don't count when comparing payloads with `deepEqual`.
* We weren't previously comparing `result.source` and `result.type` in
xpcshell tests, and that's important IMO, so I added checks for those and
updated tests.
* `isSearchHistory` is redundant, so I removed it. For form history, we
should be checking `result.source == HISTORY` and `result.type == SEARCH`.
* A bunch of tests needed to be updated for this new behavior.
Differential Revision: https://phabricator.services.mozilla.com/D87944
|
||
|---|---|---|
| .. | ||
| data | ||
| .eslintrc.js | ||
| head.js | ||
| test_ext_bookmarks.js | ||
| test_ext_browsingData.js | ||
| test_ext_browsingData_cookies_cache.js | ||
| test_ext_browsingData_downloads.js | ||
| test_ext_browsingData_passwords.js | ||
| test_ext_browsingData_settings.js | ||
| test_ext_chrome_settings_overrides_home.js | ||
| test_ext_chrome_settings_overrides_update.js | ||
| test_ext_distribution_popup.js | ||
| test_ext_history.js | ||
| test_ext_homepage_overrides_private.js | ||
| test_ext_manifest.js | ||
| test_ext_manifest_commands.js | ||
| test_ext_manifest_omnibox.js | ||
| test_ext_manifest_permissions.js | ||
| test_ext_normandyAddonStudy.js | ||
| test_ext_pageAction_shutdown.js | ||
| test_ext_pkcs11_management.js | ||
| test_ext_settings_overrides_defaults.js | ||
| test_ext_settings_overrides_search.js | ||
| test_ext_settings_overrides_search_mozParam.js | ||
| test_ext_settings_overrides_shutdown.js | ||
| test_ext_settings_validate.js | ||
| test_ext_topSites.js | ||
| test_ext_url_overrides_newtab.js | ||
| test_ext_url_overrides_newtab_update.js | ||
| test_ext_urlbar.js | ||
| xpcshell.ini | ||