Commit graph

1019 commits

Author SHA1 Message Date
Drew Willcoxon
72ff93fcf2 Bug 1678155 - Restyle all heuristic result types when a one-off is selected/search mode is previewed. r=harry
We currently restyle URL heuristic results when a one-off is selected/search
mode is previewed, but afaict we should restyle all types. In the case of this
bug, the heuristic is a search result. I ended up rewriting most of
browser_oneOffs_heuristicRestyle.js to check various result types (URL, search,
and keyword) and both Alt-arrowing and non-Alt-arrowing down to the one-offs in
case that makes a difference.

This fixes part of bug 1678765, the part where we do the wrong thing when a
restyled keyword result is picked. It doesn't fix the visual part where the
action text is flush against the title text.

This also fixes a small error in `UrlbarView._on_SelectedOneOffButtonChanged`
where we were using `result.payload.title` when restyling heuristics, but
`result.title` is the correct property.

Depends on D97376

Differential Revision: https://phabricator.services.mozilla.com/D97843
2020-12-02 01:29:20 +00:00
Christian Holler
894124e3cf Bug 1677049 - Skip problematic mochitest-bc tests in TSan. r=Gankro,preferences-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D98365
2020-12-01 20:21:20 +00:00
Ryan VanderMeulen
64984d8c54 Backed out 2 changesets (bug 1577539) for causing bug 1675735.
Backed out changeset 4cf859c2cad2 (bug 1577539)
Backed out changeset 693a84154f2f (bug 1577539)
2020-11-17 14:24:03 -05:00
harry
8bd5602f02 Bug 1675926 - Do not restore search mode if pageproxystate is valid. r=adw
We were restoring search mode after tab switch even if the destination tab had a valid pageproxystate. This was causing issues in the case where the user switched away from a tab that was still loading and had not yet called setURI. If the user switched back to that tab after it was done loading, we would re-enter search mode, using the page's URL as the search string.

Making this change also requires storing pageproxystate differently. If we only made the change to setURI, we would sometimes not restore search mode when we should. If the user entered search mode with an empty string, userTypedValue would never be updated and it would still be the page URL. After the user switched from, then to, that tab, we'd call setURI. setURI would restore userTypedValue, which would be the page URL. Since that page now had a valid pageproxystate, we would not restore search mode. Now we update userTypedValue when we enter search mode, so we restore search mode properly even when there is no search string.

Differential Revision: https://phabricator.services.mozilla.com/D97798
2020-11-21 06:15:10 +00:00
Daisuke Akatsuka
0f2a371c85 Bug 1643850: Handle 'www.<something>' as a URI. r=mak
Differential Revision: https://phabricator.services.mozilla.com/D97282
2020-11-21 00:48:43 +00:00
Drew Willcoxon
e6cc468b9a Bug 1657790 - Allow local search mode buttons to be toggled separately from engines. r=mak,ntim
* Add prefs for each local search shortcut
* Remove the `update2.localOneOffs` pref since it's not necessary with the three
  new prefs
* Modify preferences UI by adding a new row in the engines tree for each local
  shortcut
* Add `UrlbarUtils.LOCAL_SEARCH_MODES` so we have a single place where local
  search modes and their properties are defined
* Add a new test file for the preferences UI
* Modify browser_oneOffs.js to test the three new preferences

Differential Revision: https://phabricator.services.mozilla.com/D97376
2020-11-20 22:35:08 +00:00
Daisuke Akatsuka
e4556b3b77 Bug 1606231: Make URL autofill case insensitive. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D96524
2020-11-20 03:51:43 +00:00
Narcis Beleuzu
a670d3c7e5 Backed out changeset 42b7efc693fb (bug 1606231) for xpcshell failures on test_casing.js . CLOSED TREE 2020-11-20 01:51:04 +02:00
Daisuke Akatsuka
10588177b8 Bug 1606231: Make URL autofill case insensitive. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D96524
2020-11-19 22:57:12 +00:00
Marco Bonardo
4b048acc74 Bug 1676038 - Change partial tab-to-search matching to avoid autofilling unexpected subdomains. r=adw
The previous approach was autofilling partial subdomains from search engines.
Having a search engine pointing to "developer.mozilla.org, when "moz" was typed
we ended up autofilling "moz[illa.org]" but pointing to "developer.mozilla.org".
Unfortunately that made impossible to actually go to "mozilla.org" by typing it.

The new approach instead allows tab-to-search results to appear even if there's
no autofill, because the provider checks autonomously the autofill threshold.
There's a downside though, with the old approach we could return more partial
matches, and the Muxer would pick one, depending on the autofilled host. For
example we could return "rover.ebay.com" and match it to "eb[ay.it]".
With the new approach we don't have an autofilled host, and fetching it would
be expensive, we can only compare the search string with the engine's host.
For this reason the patch also tries to partially match against the searchForm
host, that often points to a page the user visits more often.

Differential Revision: https://phabricator.services.mozilla.com/D96942
2020-11-18 15:26:58 +00:00
Nika Layzell
42028efc71 Bug 1671983 - Part 4: Stop awaiting BrowserTestUtils.loadURI, r=annyG,remote-protocol-reviewers,extension-reviewers,preferences-reviewers,whimboo,zombie
This method only is async in order to allow callers to wait for a process switch
triggered by the call to `loadURI` to be finished before resolving. With
DocumentChannel, we should never trigger a process switch eagerly like this
again, so we don't need any of the async behaviour here anymore.

This part is largely mechanical changes to tests, removing the `await` calls on
`loadURI`, and a follow-up part will remove the actual async logic from
`BrowserTestUtils.loadURI`.

Differential Revision: https://phabricator.services.mozilla.com/D94641
2020-11-12 18:01:03 +00:00
Harry Twyford
1035ee8d1d Bug 1675611 - Part 2 - Show tab-to-search onboarding results until they are interacted with three times. r=mak
Differential Revision: https://phabricator.services.mozilla.com/D96905
2020-11-13 20:15:16 +00:00
Harry Twyford
4461ec8d03 Bug 1675611 - Part 1 - Add UrlbarProvider.onSelection. r=mak
Differential Revision: https://phabricator.services.mozilla.com/D97023
2020-11-13 20:15:08 +00:00
Harry Twyford
9275645bf0 Bug 1675045 - Add search mode hostname check to the muxer. r=mak
Differential Revision: https://phabricator.services.mozilla.com/D95929
2020-11-13 18:18:57 +00:00
Mark Banner
b804f5e4df Bug 1673758 - Search bar in the new tab page should show a default icon for non-app provided engines in all modes. r=daleharvey
Depends on D96744

Differential Revision: https://phabricator.services.mozilla.com/D96745
2020-11-12 19:05:36 +00:00
Marco Bonardo
30d595887d Bug 1672509 - Simple keyword searches are treated as potential domain visits. r=harry
Differential Revision: https://phabricator.services.mozilla.com/D96604
2020-11-11 08:49:37 +00:00
Daisuke Akatsuka
8c63634052 Bug 1676054: The caret position is kept until keyup enter. r=mak
Differential Revision: https://phabricator.services.mozilla.com/D96505
2020-11-11 00:59:59 +00:00
Harry Twyford
838cbb5c54 Bug 1676398 - browser.urlbar.update2.emptySearchBehavior should only affect search engines in search mode. r=mak
Differential Revision: https://phabricator.services.mozilla.com/D96616
2020-11-10 23:18:14 +00:00
Harry Twyford
9f2041a14b Bug 1675627 - Do not show alias engines in search mode. r=mak
Differential Revision: https://phabricator.services.mozilla.com/D96256
2020-11-09 17:59:35 +00:00
Daisuke Akatsuka
14d7da43af Bug 1661000: Avoid urlbar search string canonization if ctrl key comes from a previous action. r=mak
Differential Revision: https://phabricator.services.mozilla.com/D93920
2020-11-08 23:34:48 +00:00
Harry Twyford
162add7d39 Bug 1675622 - Show tab-to-search onboarding results more frequently in Firefox 83. r=mak
Differential Revision: https://phabricator.services.mozilla.com/D96114
2020-11-06 09:46:35 +00:00
Harry Twyford
6af06ad706 Bug 1674485 - Restore URL heuristic icon after unselecting a one-off. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D95537
2020-11-05 22:17:20 +00:00
Marco Bonardo
a2f405c9b9 Bug 1675537 - Switch browser.urlbar.update2.emptySearchBehavior to 0. r=harry
Differential Revision: https://phabricator.services.mozilla.com/D96063
2020-11-05 17:06:08 +00:00
Harry Twyford
600d60fa26 Bug 1674469 - Introduce experimental pref that can override urlbar.update2 for a holdback study. r=mak,mikedeboer
This default-true pref has no effect when true and overrides update2 when false. This will allow us to set it to true for our Control branch so they will just fall back to the default-true update2 pref. We can set it to false for the Treatment branch, who will not get update2 features regardless of the value of urlbar.update2.

We want to uplift this patch to 83. That way, we can set browser.urlbar.experiment.update2 in Release 82, but it will have no effect either way until 83 merges to Release.

Differential Revision: https://phabricator.services.mozilla.com/D95806
2020-11-04 11:04:36 +00:00
Razvan Maries
10425eddfc Backed out 7 changesets (bug 1658084, bug 1671983) for perma failures on browser_async_remove_tab.js and browser_e10s_chrome_process.js. CLOSED TREE
Backed out changeset 2e6309c1cdbd (bug 1658084)
Backed out changeset 99aafd9304ef (bug 1671983)
Backed out changeset 80280b85280a (bug 1671983)
Backed out changeset 008db2659002 (bug 1671983)
Backed out changeset 32bd45c7fe3a (bug 1671983)
Backed out changeset 56e227e6580c (bug 1671983)
Backed out changeset a404f809f79d (bug 1671983)
2020-11-04 04:23:47 +02:00
Nika Layzell
5f9c85da95 Bug 1671983 - Part 4: Stop awaiting BrowserTestUtils.loadURI, r=annyG,remote-protocol-reviewers,extension-reviewers,preferences-reviewers,whimboo,zombie
This method only is async in order to allow callers to wait for a process switch
triggered by the call to `loadURI` to be finished before resolving. With
DocumentChannel, we should never trigger a process switch eagerly like this
again, so we don't need any of the async behaviour here anymore.

This part is largely mechanical changes to tests, removing the `await` calls on
`loadURI`, and a follow-up part will remove the actual async logic from
`BrowserTestUtils.loadURI`.

Differential Revision: https://phabricator.services.mozilla.com/D94641
2020-11-04 00:55:36 +00:00
Daisuke Akatsuka
94ebd2d669 Bug 1577539: Use fixed uri since the beginning of the loading. r=mak
Depends on D93187

Differential Revision: https://phabricator.services.mozilla.com/D94821
2020-11-04 00:19:29 +00:00
Daisuke Akatsuka
6e9b0feb75 Bug 1577539: Change the timing of formatting/unformatting the URL. r=mak
Differential Revision: https://phabricator.services.mozilla.com/D93187
2020-11-02 15:13:26 +00:00
Marco Bonardo
08716c9980 Bug 1670253 - Tab-to-search doesn't work as expected by the user on some engines. r=adw
Allow autofill to fill partial search providers domains so that, for example,
en.wikipedia.org can be filled by typing "wiki".

Differential Revision: https://phabricator.services.mozilla.com/D95277
2020-11-03 10:11:38 +00:00
Cosmin Sabou
a7366ed9c8 Backed out changeset 680264f74a86 (bug 1674485) for bc failures on browser_oneOffs_heuristicRestyle.js. 2020-11-03 03:51:22 +02:00
Harry Twyford
b85e194225 Bug 1674485 - Restore URL heuristic icon after unselecting a one-off. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D95537
2020-11-03 00:41:26 +00:00
Marco Bonardo
5a339a3ea6 Bug 1671508 - Convert some urlbar histograms to scalars. r=harry
This converts FX_URLBAR_SELECTED_RESULT_TYPE_2, FX_URLBAR_SELECTED_RESULT_INDEX
and the correlation between them FX_URLBAR_SELECTED_RESULT_INDEX_BY_TYPE_2 to
keyed scalars, that are nicer to use and analyze.

They are converted to one keyed scalar per result type, tracking the number
of times that type was picked per urlbar index.
The sums (count per type or per index) can still be derived from this structure.

Differential Revision: https://phabricator.services.mozilla.com/D94498
2020-10-27 11:36:15 +00:00
Harry Twyford
859123c553 Bug 1669710 - Rename (preview, nonPreview) searchMode to (preview, confirmed). r=adw
Differential Revision: https://phabricator.services.mozilla.com/D95174
2020-10-30 17:01:26 +00:00
Harry Twyford
dd1223cccf Bug 1671241 - Set aria-activedescendant upon selecting a tab-to-search result if the user previously selected the tab-to-search result. r=mak
Differential Revision: https://phabricator.services.mozilla.com/D95214
2020-10-30 12:43:07 +00:00
Harry Twyford
bae28c541a Bug 1669526 - Don't show the heuristic result for partially typed token aliases and show all the matching token aliases. r=adw
The heavily nested structure of UrlbarInput.setValueFromResult made it difficult to handle a result that was both a keywordoffer and autofilled. I took this opportunity to refactor setValueFromResult to be flatter. I think it's a bit easier to read now.

Differential Revision: https://phabricator.services.mozilla.com/D94903
2020-10-28 20:52:37 +00:00
Drew Willcoxon
b799e5865b Bug 1673062 - Fix intermittent TV browser/components/urlbar/tests/browser/browser_tokenAlias.js by increasing the timeout. r=mak
The log shows that the last test task finishes, so it looks like the test is now
just taking too long on these Mac machines in verify mode. That's plausible
because I added a bunch of new checks in bug 1672680 (checking for different
types of space characters).

Green try run: https://treeherder.mozilla.org/#/jobs?repo=try&revision=a320a06d40ddacfc76abc6cf097b11a959228c61&selectedTaskRun=Geg2Cpj5Q16A4-KuYuegyw.0

Differential Revision: https://phabricator.services.mozilla.com/D94665
2020-10-26 23:12:56 +00:00
Daisuke Akatsuka
df57cd5036 Bug 1641287: Focus on browser after keyup. r=mak
Differential Revision: https://phabricator.services.mozilla.com/D92561
2020-10-26 05:30:44 +00:00
Harry Twyford
abd4222fa6 Bug 1667766 - Part 2 - Restyle URL heuristic results as search results when cycling through one-offs. r=adw
This patch replaces the heuristic's icon, title, and action text when cycling through the one-offs. One problem is that the underlying result is still of RESULT_TYPE.URL, so picking it would visit its underlying URL. One way to get around this would be to create a new search UrlbarResult and swap it with the heuristic result, or change all the properties of the UrlbarResult so it becomes a search result. These approaches were discussed in review and rejected because they break the design of the QuantumBar. Having the URL result navigate to a SERP when picked would also require a lot of flags and conditionals throughout our navigation logic, which isn't ideal. I settled on promoting search mode when one of these restyled results is picked. I admit that this is a bit of a strange interaction, given that something that looks like a search heuristic result behaves like a keywordoffer, but I think its preferable to us navigating to a URL the user cannot see in the UI. As discussed in review, this result can only be picked by clicking on it. The chance of a user clicking the heuristic result while arrowing through the one-offs is exceedingly slim, so it seems like a decent compromise between UX and engineering effort. It also means selecting the restyled result with click and Enter does the same thing, so it's not completely out of nowhere.

I checked a11y with this patch applied and things are mostly unchanged from a screen reader perspective. Currently, typing the string "moz", alt+arrowing to the first one-off, then selecting it will create announcements like: "m", "o", "z", "Selection replaced. Google (@google), button", "Selection replaced. moz, Search with Google, edit text". The same annoucements are made with this patch applied. Pressing down arrow (not alt) will announce the second result. Arrowing back up to the heuristic will announce the original autofill result, because the original autofill result has been swapped back in. I'll ping Jamie in the bug once this patch is mature.

Differential Revision: https://phabricator.services.mozilla.com/D94338
2020-10-24 02:05:11 +00:00
Harry Twyford
629710dc11 Bug 1667766 - Part 1 - Refactor UrlbarView._on_SelectedOneOffButtonChange and fix one-off selection papercuts. r=adw
This patch fixes two issues:

1. When a history result was autofilled, cycling through the engine one-offs would not change its icon (as expected) and cycling through the local one-offs would change its icon, but only to the history icon. This was because UrlbarView._iconForSearchResult was only checking for the result source and wasn't checking that the result was of search type as well. For consistency, we no longer change the icon when local one-offs are selected (we will change it once we figure out a way to change it for engine one-offs as well). I also renamed this method to _iconForResult to prep for Part 2 of this patch.

2. Typing a string, alt+arrowing through the one-offs, then pressing Enter flickers the heuristic result. This is because the one-off button is deselected, so we restore the original heuristic result. However, the search mode query also fires at the same time and quickly replaces the heuristic result. I added a check to not restore the original heuristic result in this case, eliminating the flicker.

This patch also refactors UrlbarView._on_SelectedOneOffButtonChanged. Previously, the main loop bailed early if a local one-off was selected, thus treating local one-offs as if they were very different from engine one-offs. This new flow handles both local and engine one-offs over the course of the same loop. I think it's a bit easier to read and understand.

Differential Revision: https://phabricator.services.mozilla.com/D94637
2020-10-24 02:05:11 +00:00
Harry Twyford
43ebd9bbc5 Bug 1672533 - Dedupe SERPs in history whose query parameters are a subset of a generated search URL. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D94396
2020-10-23 16:01:42 +00:00
Drew Willcoxon
267d556690 Bug 1672680 - Properly handle non-ASCII spaces in search alias and restriction token searches. r=mak
This fixes all the problems created by bug 1658964 and modifies existing tests
so we check a variety of spaces.

Differential Revision: https://phabricator.services.mozilla.com/D94555
2020-10-23 13:49:20 +00:00
Drew Willcoxon
d73a9e4b15 Bug 1672643 - Do not show form history (search suggestions from history) at all when browser.urlbar.maxHistoricalSearchSuggestions == 0. r=mak
Differential Revision: https://phabricator.services.mozilla.com/D94504
2020-10-22 22:25:12 +00:00
Peter Van der Beken
7512711077 Bug 1672193 - Re-enable some tests that are now succeeding with session history in parent and Fission. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D94120
2020-10-20 17:48:51 +00:00
Drew Willcoxon
4155f60be3 Bug 1671045 - Fix intermittent in browser_searchMode_sessionStore.js by requesting a longer timeout and disabling on Mac debug. r=mak
This test times out on macOS 10.14 opt and debug.  Logs show that the test
finishes properly but it exceeds the timeout threshold, so it appears that it
just takes too long.  Increasing the timeout threshold fixes the problem on opt,
but it reveals another problem on debug where the watchdog process kills the
main process because its shutdown lasts too long.  This happens during step 3 of
test-verify, which is "Run each test 10 times in one browser, in chaos mode."
Around the time that the crash happens, logs show that there are "2047 DOMWINDOW
created and 2037 destroyed log strings."  The test opens, closes, and reopens
many windows -- with chaos mode on top of that -- so it's possible that debug
window instrumentation or just the debug nature of the build itself, plus slow
machines, causes all the window opening and closing to perform very poorly and
take a long time.

This patch increases the timeout, which fixes opt, and disables the test
entirely on debug -- and to reiterate, it's Mac only.  Maybe the test could open
and close tabs instead of windows in order to test session store, but I'm not
sure it's worth rewriting.

Here's a successful try run with an earlier version of this patch that did not
disable the test on debug, but it shows that opt is green:

https://treeherder.mozilla.org/#/jobs?repo=try&revision=7ab33a9225b9edf0cb8a95d556f9b76c7fc69470

And here's a run without the patch that shows opt is always orange:

https://treeherder.mozilla.org/#/jobs?repo=try&revision=1e02bfc26ecb67f503cb24a180536e8c220226d5

Differential Revision: https://phabricator.services.mozilla.com/D94069
2020-10-20 21:06:11 +00:00
Harry Twyford
b19f066d1c Bug 1671803 - Add localized names for Baidu and Yandex to WEB_ENGINE_NAMES. r=mak
Differential Revision: https://phabricator.services.mozilla.com/D94012
2020-10-19 18:33:51 +00:00
Cosmin Sabou
a4f27b590d Backed out changeset 73e461c6ee8d (bug 1671803) for bc failures on browser_tabToSearch.js. 2020-10-19 20:25:35 +03:00
Harry Twyford
cd454d0141 Bug 1671803 - Add localized names for Baidu and Yandex to WEB_ENGINE_NAMES. r=mak
Differential Revision: https://phabricator.services.mozilla.com/D94012
2020-10-19 15:05:09 +00:00
Peter Van der Beken
b9f1b3e0e2 Bug 1671223 - Reenable some tests that are now succeeding with session history in parent. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D93770
2020-10-19 08:41:11 +00:00
Mark Banner
fd67c74cb7 Bug 1671404 - Add Provider Name to the urlbar engagement telemetry. r=mak
Differential Revision: https://phabricator.services.mozilla.com/D93660
2020-10-16 14:39:50 +00:00
Harry Twyford
447fc3d66a Bug 1670944 - Allow tabbing past tab-to-search results after focusing the Urlbar with the keyboard. r=mak
Differential Revision: https://phabricator.services.mozilla.com/D93601
2020-10-16 13:53:03 +00:00
smolnar
bb2cc96565 Backed out 2 changesets (bug 1665938, bug 1671404) for causing browser_urlbar_event_telemetry failures. CLOSED TREE
Backed out changeset ce37b9b99fd6 (bug 1665938)
Backed out changeset fa95a02b2c90 (bug 1671404)
2020-10-16 15:43:47 +03:00
Mark Banner
6de3a96e83 Bug 1671404 - Add Provider Name to the urlbar engagement telemetry. r=mak
Differential Revision: https://phabricator.services.mozilla.com/D93660
2020-10-16 11:17:07 +00:00
Marco Bonardo
c1fdaba807 Bug 1647925 - Make EventBufferer more reliable with tab-to-search. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D92818
2020-10-16 07:29:38 +00:00
Harry Twyford
8dd990259e Bug 1665934 - Part 3 - Add tab-to-search onboarding telemetry. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D93113
2020-10-15 16:29:13 +00:00
Harry Twyford
4c7b5c4e29 Bug 1665934 - Part 2 - Add onboarding intervention for tab-to-search. r=fluent-reviewers,adw,flod
There are a couple of issues that still need to be resolved, but I think this is ready for review:
- This patch does not use the icon in the UX spec. I'm waiting on that icon and just using the engine icon in the meantime.
- We also don't have a spec for how the result should wrap at narrow window widths, so I put some placeholder behaviour in.
- It appears dynamic results are incapable of overriding the CSS for normal Urlbar classes unless !important is used, regardless of specificity. Thus a few rules in dynamic-tabToSearch.css use !important, which isn't ideal. It appears this is because dynamic result stylesheets are [loaded](https://searchfox.org/mozilla-central/rev/919607a3610222099fbfb0113c98b77888ebcbfb/browser/components/urlbar/UrlbarView.jsm#1783,1785,1802) as `AGENT_SHEET`s. Changing that value to AUTHOR_SHEET allows the dynamic result CSS to override the normal Urlbar classes without !important. This strikes me as a tough issue. dynamic-tabToSearch.css is an agent sheet since it's provided by the browser. I do wonder if its defensible to load it as an author sheet since it will usually be loaded by an extension/external developer (this might be a stretch :). I'm not well-versed enough in the technicalities here to really make a call, so I'm eager to hear if @dao or @adw have any thoughts on how to resolve this issue.

Differential Revision: https://phabricator.services.mozilla.com/D93015
2020-10-15 16:31:00 +00:00
Harry Twyford
6bf1f3306d Bug 1665934 - Part 1 - Allow results to set their own resultSpan. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D93112
2020-10-15 12:30:41 +00:00
Butkovits Atila
e5807896fb Backed out 4 changesets (bug 1665934) as requested by Harry. CLOSED TREE
Backed out changeset 342354dfd594 (bug 1665934)
Backed out changeset 56946d59bf0a (bug 1665934)
Backed out changeset 1b03418a14f6 (bug 1665934)
Backed out changeset 8c1edb639aa6 (bug 1665934)
2020-10-15 15:26:00 +03:00
Harry Twyford
d0e8d7d1b3 Bug 1665934 - Part 3 - Add tab-to-search onboarding telemetry. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D93113
2020-10-15 11:19:17 +00:00
Harry Twyford
7745e46508 Bug 1665934 - Part 2 - Add onboarding intervention for tab-to-search. r=fluent-reviewers,adw,flod
There are a couple of issues that still need to be resolved, but I think this is ready for review:
- This patch does not use the icon in the UX spec. I'm waiting on that icon and just using the engine icon in the meantime.
- We also don't have a spec for how the result should wrap at narrow window widths, so I put some placeholder behaviour in.
- It appears dynamic results are incapable of overriding the CSS for normal Urlbar classes unless !important is used, regardless of specificity. Thus a few rules in dynamic-tabToSearch.css use !important, which isn't ideal. It appears this is because dynamic result stylesheets are [loaded](https://searchfox.org/mozilla-central/rev/919607a3610222099fbfb0113c98b77888ebcbfb/browser/components/urlbar/UrlbarView.jsm#1783,1785,1802) as `AGENT_SHEET`s. Changing that value to AUTHOR_SHEET allows the dynamic result CSS to override the normal Urlbar classes without !important. This strikes me as a tough issue. dynamic-tabToSearch.css is an agent sheet since it's provided by the browser. I do wonder if its defensible to load it as an author sheet since it will usually be loaded by an extension/external developer (this might be a stretch :). I'm not well-versed enough in the technicalities here to really make a call, so I'm eager to hear if @dao or @adw have any thoughts on how to resolve this issue.

Differential Revision: https://phabricator.services.mozilla.com/D93015
2020-10-15 11:18:53 +00:00
Harry Twyford
57a3c24a05 Bug 1665934 - Part 1 - Allow results to set their own resultSpan. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D93112
2020-10-15 11:18:12 +00:00
Marco Bonardo
4405a56b00 Bug 1667931 - Add a urlbar test searching a single word with a default POST engine. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D93538
2020-10-14 19:59:26 +00:00
Harry Twyford
83c008cce2 Bug 1647929 - Announce tab-to-search results to screen readers. r=Jamie,mak,fluent-reviewers,flod
This is a pretty simple implementation of the approach discussed in the bug. When a tab-to-search result is shown, we announce it to screen readers. We keep track of which engines are announced to be sure we don't keep announcing the same engine as the user types.

This approach is maybe slightly crude, but I didn't find a working elegant approach. One approach I considered is checking for tab-to-search results in the loop in UrlbarView._updateResults. After the loop is finished, if we found a tab-to-search result, we go back and change the aria-label on the action text of the prior result to something like "Visit, or press Tab to search with { $engine }. This didn't work because we don't read action text for the heuristic result as the user types. This is presumbably to avoid disrupting the user as they type. This is what my patch does regardless, however... Since Jamie was skeptical about whether we should announce this at all, I put this behaviour behind a default-true pref, browser.urlbar.tabToSearch.accessibility.announceResults.

Differential Revision: https://phabricator.services.mozilla.com/D93451
2020-10-14 17:22:33 +00:00
Harry Twyford
a8a88b6d18 Bug 1668873 - Change tab-to-search icon to a magnifying glass. r=dao
Differential Revision: https://phabricator.services.mozilla.com/D93411
2020-10-14 16:22:53 +00:00
Daisuke Akatsuka
73ecdc2952 Bug 1665294: Avoid capturing click event twice from search mode close button. r=mak
Differential Revision: https://phabricator.services.mozilla.com/D93466
2020-10-14 12:18:31 +00:00
Drew Willcoxon
e3f93f8e8c Bug 1659203 - Add a test to make sure search mode is duplicated when duplicating tabs. r=harry
Differential Revision: https://phabricator.services.mozilla.com/D93293
2020-10-13 13:52:06 +00:00
Drew Willcoxon
21053215a9 Bug 1665115 - Update userTypedValue when entering search mode so that search strings are properly restored. r=mak
Differential Revision: https://phabricator.services.mozilla.com/D93289
2020-10-13 14:47:52 +00:00
Drew Willcoxon
978ea7cfe4 Bug 1670826 - Rename browser_searchModeIndicator.js to browser_searchMode_indicator.js. r=harry
Differential Revision: https://phabricator.services.mozilla.com/D93284
2020-10-13 13:49:46 +00:00
Drew Willcoxon
7fcd89e4bb Bug 1655486 - Support search mode across sessions. r=mak
* Always update the `_searchModesByBrowser` map when entering/exiting search
  mode, not only for non-selected browsers, so that search mode can be saved and
  restored properly per tab.
* Rename `setSearchMode` to `_updateSearchModeUI` and make it only update the UI.
* Add a new `setSearchMode` method that takes a browser and updates the map.
* Add `getSearchMode` so that SessionStore can get the search mode for a given
  browser.
* Add a `searchMode` getter and setter for convenience. They call
  `getSearchMode` and `setSearchMode` with the selected browser.

Differential Revision: https://phabricator.services.mozilla.com/D91910
2020-10-12 03:34:59 +00:00
Marco Bonardo
9b1fbb15df Bug 1668939 - Make tab-to-search origin autofill comparison more lenient when matching autofilled hosts. r=harry,Standard8
Differential Revision: https://phabricator.services.mozilla.com/D92978
2020-10-10 08:49:41 +00:00
Harry Twyford
a576962a26 Bug 1668389 - Only set #urlbar[open] if we are sure there will be either results or one-offs. r=mak
This was more difficult to solve than I expected. The main issue is that the
`[open]` attribute on `#urlbar` wasn't accurate when the view was "open" but
there were no results or one-offs, so it was in fact closed. This broke a few
style rules.

This bug can also be reached when the user has no engines and clears the search
string while in search mode. This includes pressing Accel+K when typing a search
string while not in search mode.

The relationship between the UrlbarView and the one-offs is complex and depends
on a lot of listeners and async calls made in synchronous contexts. Furthermore,
most of the UrlbarView open/close code is synchronous, but checking the number
of engines (to determine if the one-offs will open) is an async operation. These
factors make it difficult for the view to discern any state about the one-offs
and plan accordingly.

First I tried adding a [oneoff] attribute to .urlbarView, set asynchronously when
the one-offs are built. Then I changed CSS rules to check
```
.urlbarView:not([noresults]),
.urlbarView[oneoffs]
```
instead of just `#urlbar[open]`. This approach would've required changing
a bunch of CSS from the simple `#urlbar[open]` to the more complicated CSS
above, which was not good for code readability. Also it would keep `[open]` in
a weird useless state where it couldn't really be trusted. This would've caused
other styling problems.

I settled on adding a `.then` call around the affected UrlbarView opening. The
view opens only if we are sure that we will have either results or one-offs,
so we can once again trust the `[open]` parameter. This approach has its
drawbacks. Mainly, it's a more JavaScript-heavy solution so it's possibly
slow. Thankfully, it's something that can be easily cached.

Differential Revision: https://phabricator.services.mozilla.com/D92526
2020-10-07 15:02:16 +00:00
Kirk Steuber
8d8587f199 Bug 1668096 - Replace activeUpdate with downloadingUpdate and readyUpdate in tests r=mhowell
Differential Revision: https://phabricator.services.mozilla.com/D92291
2020-10-06 18:07:56 +00:00
Daisuke Akatsuka
3fd06191a8 Bug 1669271: Set browser.urlbar.update2.oneOffsRefresh pref to avoid failing tests for besides nightly. r=mak
Differential Revision: https://phabricator.services.mozilla.com/D92513
2020-10-06 08:10:30 +00:00
Daisuke Akatsuka
bbe5d0b6b5 Bug 1668212: Unselect one-off button when exiting search mode. r=mak
Depends on D92022

Differential Revision: https://phabricator.services.mozilla.com/D92023
2020-10-05 21:53:32 +00:00
Marco Bonardo
21f74268b5 Bug 1668982 - Perma browser_searchMode_preview.js failure on beta due to lack of update2. r=harry
Differential Revision: https://phabricator.services.mozilla.com/D92462
2020-10-05 17:17:34 +00:00
Marco Bonardo
57d2177080 Bug 1668370 - Cycling through local one-offs changes the engine name in keywordoffer results. r=harry
Differential Revision: https://phabricator.services.mozilla.com/D92248
2020-10-05 14:36:34 +00:00
Daisuke Akatsuka
d65144f8d3 Bug 1668430: Add a test about search mode when typing an alias after selecting one-off button. r=mak
Depends on D91393

Differential Revision: https://phabricator.services.mozilla.com/D92022
2020-10-04 21:42:43 +00:00
Harry Twyford
a1ea381dac Bug 1661882 - Remove getAutofillSearchString test helper. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D91971
2020-10-02 07:00:34 +00:00
Harry Twyford
822844eeb6 Bug 1667470 - Enable tab-to-search on Nightly. r=adw
Tests are passing: https://treeherder.mozilla.org/#/jobs?repo=try&revision=2de70d799eb0d0f4a5ae3d2c0b76c96bc7a34bbd

Differential Revision: https://phabricator.services.mozilla.com/D92156
2020-10-02 07:01:46 +00:00
Marco Bonardo
5b1de7558c Bug 1668012 - Keyboard navigating one-off buttons after typing doesn't update the engine chiclet. r=harry
Differential Revision: https://phabricator.services.mozilla.com/D91973
2020-10-01 22:09:58 +00:00
Dorel Luca
3d5f114958 Backed out changeset a853a9d96612 (bug 1668012) for Browser-chrome failures in newtab/test/browser/browser_topsites_section.js. CLOSED TREE 2020-10-01 21:23:40 +03:00
Marco Bonardo
412c8a6e8c Bug 1668012 - Keyboard navigating one-off buttons after typing doesn't update the engine chiclet. r=harry
Differential Revision: https://phabricator.services.mozilla.com/D91973
2020-10-01 13:16:42 +00:00
Olli Pettay
8a508eaa66 Bug 1668357 - Disable tests which fail when fission and session-history-in-parent are enabled, r=peterv,marionette-reviewers,whimboo
In many cases with wpt, most of the tests in the file pass, but it is rather time consuming to annotate
.ini files case by case.

Differential Revision: https://phabricator.services.mozilla.com/D91977
2020-10-01 10:23:47 +00:00
Daisuke Akatsuka
0842bae1d5 Bug 1665908: Remove one-off button selection when entering search mode. r=mak
Differential Revision: https://phabricator.services.mozilla.com/D91393
2020-10-01 08:40:03 +00:00
Harry Twyford
7d1be95fd3 Bug 1647927 - Return an array from UrlbarSearchUtils.enginesForDomainPrefix and support UrlbarProviderTabToSearch sending multiple results. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D91959
2020-09-30 17:58:21 +00:00
Harry Twyford
67da2887ec Bug 1668340 - Fix browser_tabKeyBehavior.js on Beta. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D91968
2020-09-30 17:53:47 +00:00
Harry Twyford
e51e1ee06f Bug 1647923 - Add tab-to-search telemetry. r=adw
This adds tab-to-search telemetry, both for the new tabtosearch search mode entry point and for tabtosearch results in our usual Urlbar result-selection scalars. I also added a subtest in browser_urlbar_event_telemetry, but realized as I was writing it that it was not useful. We don't consider entering search more as the end of an engagement, so tab-to-search results will not appear in event telemetry. We already considered this in bug 1654680 and resolved it by adding detailed urlbar.searchmode.* scalars, so I don't consider it a blocker. I left the new subtest in since it was mostly done anyways and it can't hurt.

Differential Revision: https://phabricator.services.mozilla.com/D91469
2020-09-29 21:21:44 +00:00
Harry Twyford
17135ee67d Bug 1647923 - Add UrlbarProviderTabToSearch. r=adw,fluent-reviewers
This patch adds tab-to-search results, partially reusing the existing code in `UrlbarProviderAutofill._matchSearchEngineDomain`. Tests are included. Telemetry is included in a child revision.

This patch doesn't add the "Search <engine name> directly from the address bar." action text. Our current action text code l10n is in a .properties file and I thought adding branching translation logic in UrlbarView would be a mess. I think Marco might be converting that .properties file to Fluent in bug 1658629. If he is, I'll rebase my patch on his and add the new action text it in this patch. If he isn't, I'll file a follow-up for converting that .properties file and adding the tab-to-search action text, which we can address before preffing `update2.tabToComplete` on. Either way, I think this is ready for a first-round review.

This patch is based on D91076 and D91077. It doesn't have any functional dependency, but there are some conflicts, especially in the added telemetry.

Differential Revision: https://phabricator.services.mozilla.com/D91468
2020-09-30 00:22:03 +00:00
Tooru Fujisawa
7a98582567 Bug 1558642 - Part 2: Use EventUtils.synthesizeNative* where possible. r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D39604
2020-09-29 20:01:12 +00:00
Marco Bonardo
7ba41c5370 Bug 1667133 - Perma failure in browser_searchFunction.js when merging to beta without update2. r=harry
Differential Revision: https://phabricator.services.mozilla.com/D91711
2020-09-29 15:41:36 +00:00
Marco Bonardo
df9986afac Bug 1667133 - Perma failure in browser_remove_match.js when merging to beta. r=harry
Differential Revision: https://phabricator.services.mozilla.com/D91610
2020-09-29 15:41:36 +00:00
Harry Twyford
aa74e74c84 Bug 1666927 - Allow tabbing past keywordoffer results with update2 enabled. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D91295
2020-09-29 03:52:56 +00:00
Marco Bonardo
04fc7ba215 Bug 1658629 - Update heuristic action when cycling through local one-offs with a search string. r=adw,fluent-reviewers,flod
Differential Revision: https://phabricator.services.mozilla.com/D91574
2020-09-29 10:07:08 +00:00
Harry Twyford
4515b74439 Bug 1665076 - Call setSearchMode directly from search(), fix search mode handoff, and introduce new search mode probes. r=adw
This patch calls setSearchMode directly from search(). This sets up a solution for the problem in the bug and also fixes the issue where a call to search() with a restriction token would flicker the token before it was replaced with the search mode indicator. I added new tabmenu and bookmarkmenu entry points to take advantage of this new functionality.

This also fixes the issues with handoff. Besides the problem of search() recording typed for handoff, `handoff` wasn't even registered as a Telemetry probe! That was my mistake. I added a test for handoff telemetry. It was only practical to test it in PBM since it uses a different implementation than about:home that's easier to test. I wrote a lengthy comment above the subtest about why I think this is okay.

Differential Revision: https://phabricator.services.mozilla.com/D91076
2020-09-25 20:45:33 +00:00
Daisuke Akatsuka
b4424c49ee Bug 1663984: Add a test for the interaction with the ESC key on browsing page. r=mak
Depends on D91099

Differential Revision: https://phabricator.services.mozilla.com/D91232
2020-09-25 00:35:43 +00:00
Marco Bonardo
af4bee6b34 Bug 1659752 - One-offs footer not always visible in private mode. r=harry
Differential Revision: https://phabricator.services.mozilla.com/D91123
2020-09-23 18:56:00 +00:00
Marco Bonardo
227392af30 Bug 1664760 - Improve the set of results when in search mode for a non-general search engine. r=adw
- always show search suggestions first in search mode
  - use restyleSearches only in search mode, to get cleaner history results and dedupe against search history
  - filter redirects differently depending on restyleSearches

Differential Revision: https://phabricator.services.mozilla.com/D90719
2020-09-23 08:26:06 +00:00
Harry Twyford
8227f1f618 Bug 1666087 - Fix beta failure in browser_searchMode_preview.js. r=mak
Differential Revision: https://phabricator.services.mozilla.com/D90876
2020-09-21 14:51:28 +00:00
Drew Willcoxon
ca2055baa0 Bug 1659204 - Don't show a heuristic in local search modes except for autofill. r=mak,harry
Differential Revision: https://phabricator.services.mozilla.com/D90671
2020-09-19 00:34:26 +00:00
Bogdan Tara
f49aabcd28 Backed out changeset 8c8cb264f283 (bug 1659204) for urlbar related failures 2020-09-19 03:22:51 +03:00
Drew Willcoxon
a1cd9c24d5 Bug 1659204 - Don't show a heuristic in local search modes except for autofill. r=mak,harry
Differential Revision: https://phabricator.services.mozilla.com/D90671
2020-09-18 21:37:28 +00:00
Marco Bonardo
85e164814e Bug 1665951 - test_search_suggestions.js fails when merging to beta without update2. r=harry
Differential Revision: https://phabricator.services.mozilla.com/D90720
2020-09-18 17:03:32 +00:00
Harry Twyford
832d0c9d22 Bug 1664320 - Enter search mode preview when cycling through one-offs with the keyboard. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D90600
2020-09-18 14:39:01 +00:00
Marco Bonardo
1501ffe928 Bug 1663686 - Convert question mark into search mode. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D90357
2020-09-17 19:03:35 +00:00
Harry Twyford
b2cc3e61c2 Bug 1657676 - Add search mode preview. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D89964
2020-09-17 03:31:04 +00:00
Dorel Luca
ac0e714d57 Backed out changeset b445d02b1367 (bug 1657676) for Browser-chrome failures in newtab/test/browser/browser_topsites_section.js. CLOSED TREE 2020-09-17 04:46:23 +03:00
Harry Twyford
8f95a2e763 Bug 1657676 - Add search mode preview. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D89964
2020-09-16 23:18:59 +00:00
Drew Willcoxon
08b6f031d0 Bug 1665292 - Clear the view's selected result and UrlbarInput._resultForCurrentValue when the view is cleared. r=harry
First, `UrlbarView.clear` needs to null the selected element. Second, setting
the selected element to null needs to also null
`UrlbarInput._resultForCurrentValue`. `UrlbarView._selectElement` does call
`input.setValueFromResult`, which sets `_resultForCurrentValue` -- but not if
the `updateInput` arg is false. So I added a new
`UrlbarInput.setResultForCurrentValue` method so `_selectElement` can set it. At
first I tried unconditionally calling `input.setValueFromResult`, but a bunch of
tests failed. I looked into it, but it's complicated, so I gave up and added
this new method.

This also makes some other changes that I'll comment on inline.

Differential Revision: https://phabricator.services.mozilla.com/D90360
2020-09-16 20:26:03 +00:00
Harry Twyford
0f023b01db Bug 1665036 - Enable update2 prefs in browser_searchMode_engineRemoval.js. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D90281
2020-09-15 23:26:07 +00:00
Brindusan Cristian
09fafce1c6 Backed out changeset 6e3078121a13 (bug 1657676) for bc failures at browser_oneOffs_keyModifiers.js. CLOSED TREE 2020-09-16 03:18:05 +03:00
Harry Twyford
b769c92faf Bug 1657676 - Add search mode preview. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D89964
2020-09-15 22:55:12 +00:00
Harry Twyford
d4b85bd17a Bug 1657801 - Exit search mode if the current search mode engine is removed. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D89827
2020-09-14 20:27:10 +00:00
Marco Bonardo
24042ff483 Bug 1662509 - Add a pref to experiment with zero-prefix search in search mode. r=harry
Differential Revision: https://phabricator.services.mozilla.com/D89914
2020-09-14 17:05:08 +00:00
Dorel Luca
89114e2339 Backed out changeset a526a04f7f4c (bug 1662509) for Reftest failures in js/src/tests/test262/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-4.js. CLOSED TREE 2020-09-14 13:07:10 +03:00
Marco Bonardo
c082da74be Bug 1662509 - Add a pref to experiment with zero-prefix search in search mode. r=harry
Differential Revision: https://phabricator.services.mozilla.com/D89914
2020-09-13 22:41:27 +00:00
Marco Bonardo
4cbf7b36fd Bug 1662477 - Don't toggle local one-offs if urlbar privacy preferences are flipped. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D89917
2020-09-12 08:46:34 +00:00
Drew Willcoxon
475e72fb04 Bug 1663025 - Fix Beta failure in browser/components/urlbar/tests/browser/browser_searchMode_autofill.js. r=harry
This test requires search mode, but it doesn't enable update2, so it fails on
non-Nightly.  It only needs to enable update2 like other search-mode tests do.

Differential Revision: https://phabricator.services.mozilla.com/D89850
2020-09-11 17:55:35 +00:00
Drew Willcoxon
20622667b0 Bug 1663016 - Fix Beta failure in browser/components/urlbar/tests/unit/test_search_suggestions_aliases.js. r=harry
The "Search in a Private Window" result is included only in Nightly builds, so
this test needs to either enable the corresponding pref, or disable the pref and
remove that result from the expected results. This patch does the latter.

Differential Revision: https://phabricator.services.mozilla.com/D89849
2020-09-11 17:55:42 +00:00
Mark Banner
1ea88a81e4 Bug 1619656 - Drop the separate recording of _shortName in the search service, use the telemetry Id instead. r=daleharvey
The _shortName variable is basically redundant, and we can transfer the remaining 'identifier' handling across to the telemetry Id as they were virtually the same.

Differential Revision: https://phabricator.services.mozilla.com/D88623
2020-09-11 19:31:42 +00:00
Harry Twyford
b896496e10 Bug 1657212 - Support one-off key modifiers and remove one-off context menus. r=adw
This patch adds support for key modifiers on the refreshed one-offs. They work the same as the old key modifiers, with one exception: Shift+Click and Shift+Enter both execute a search immediately in the current tab, replicating the behaviour of the old one-offs. For empty searches, Shift+Click and Shift+Enter just enter search mode. To support these Shift modifiers, we dropped support for opening a one-off search in a new window. Users can still search in a new window with a non-default engine by typing a search string, selecting a one-off with the keyboard, then Shift+Clicking the heuristic result or the Go button.

Other key modifiers worth pointing out include Accel+Click to search in a new background tab and Alt+Enter to search in a new foreground tab. If these modifiers are used on the local one offs or with an empty query, we open search mode in the new tab.

Differential Revision: https://phabricator.services.mozilla.com/D89504
2020-09-11 20:07:07 +00:00
Marco Bonardo
a8c141c472 Bug 1660778 - Improve urlbar search mode history results by properly filtering on host and redirect sources. r=harry
Differential Revision: https://phabricator.services.mozilla.com/D89610
2020-09-09 16:07:11 +00:00
Marco Bonardo
19a5cf747e Bug 1661949 - Can't search from the Address Bar with ? if keyword.enabled = false. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D89143
2020-09-07 22:07:28 +00:00
Narcis Beleuzu
f620d860b0 Backed out changeset ef2483cfdf64 (bug 1661949) for xpcshell failures on test_search_suggestions.js . CLOSED TREE 2020-09-04 13:01:45 +03:00
Marco Bonardo
b38ca2d2cb Bug 1661949 - Can't search from the Address Bar with ? if keyword.enabled = false. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D89143
2020-09-04 08:57:57 +00:00
Brindusan Cristian
3d4c960502 Backed out changeset 0eacf15bc150 (bug 1661949) for xpcshell failures at test_416211.js. CLOSED TREE 2020-09-03 11:40:18 +03:00
Marco Bonardo
5296eb600f Bug 1661949 - Can't search from the Address Bar with ? if keyword.enabled = false. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D89143
2020-09-02 20:33:25 +00:00
Mark Banner
090dd4370d Bug 1612824 - Search Services shouldn't use reInit for when the locale is changed or the ignore list is updated. r=daleharvey
reInit is unsafe as it completely removes the existing data before reloading. If something interrupts the process that can cause dataloss.

_maybeReloadEngines is safer as it does changes progressively, it also now handles removing engines, which it didn't before.

Depends on D88023

Differential Revision: https://phabricator.services.mozilla.com/D88272
2020-09-02 22:24:20 +00:00
Harry Twyford
4cd4dde714 Bug 1655473 - Allow autofill only in local search modes. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D88219
2020-09-02 19:23:12 +00:00
Drew Willcoxon
6d6402fb4e Bug 1658964 - Convert local restriction chars to search mode and make other improvements to search mode. r=harry
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
2020-09-02 00:52:12 +00:00
Mark Banner
552793d2cc Bug 1619926 - Remove remnants of Search geo-location handling now it is handled by Region.jsm. r=daleharvey
Depends on D88021

Differential Revision: https://phabricator.services.mozilla.com/D88022
2020-09-01 18:08:46 +00:00
Harry Twyford
63344f5398 Bug 1654680 - Add telemetry for search mode. r=adw
Summary of changes:
1. Adds an `entry` property to the searchMode object to tag how search mode was entered.
2. Introduces `urlbar.searchmode.*` scalars.  These scalars are suffixed with an entry point into search mode, for example `urlbar.searchmode.oneoff`, or `urlbar.searchmode.topsites_urlbar`. Those entry points tell us how search mode is entered most often. The keys for these scalars are strings describing what kind of search mode was entered. In most cases, this will be the name of a search engine, like "Google", or "DuckDuckGo". It may also be one of "history", "bookmarks", or "tabs". We only collect the names of engines that are bundled with Firefox. If the user enters search mode with an engine they installed themselves, we record "other" as the key.
3. Adds a urlbar-searchmode SAP to SEARCH_COUNTS.
4. Adds a browser.engagement.navigation.urlbar_searchmode probe.
5. Adds a urlbar_searchmode SAP to the navigation.search event.

Differential Revision: https://phabricator.services.mozilla.com/D87510
2020-09-02 15:08:50 +00:00
Drew Willcoxon
67317ab76f Bug 1658993 - Disable the context menu for local one-off search buttons. r=mak
Differential Revision: https://phabricator.services.mozilla.com/D88948
2020-09-01 20:01:26 +00:00
Butkovits Atila
7b340f9684 Backed out 15 changesets (bug 1612824, bug 1661234, bug 1619926, bug 1612380, bug 1559530, bug 1642990) for Xpc failures. CLOSED TREE
Backed out changeset 426d017d7e46 (bug 1642990)
Backed out changeset 84ab4021d403 (bug 1559530)
Backed out changeset 82a8305543e5 (bug 1559530)
Backed out changeset 38832c1185b8 (bug 1559530)
Backed out changeset f16918c10a6b (bug 1661234)
Backed out changeset 3a13258fbd51 (bug 1661234)
Backed out changeset abf8d8b24845 (bug 1612824)
Backed out changeset 7dfeb065a385 (bug 1619926)
Backed out changeset bc9d3e210fe7 (bug 1619926)
Backed out changeset 786164c461ae (bug 1619926)
Backed out changeset d89793e9d17d (bug 1619926)
Backed out changeset d665885bc912 (bug 1619926)
Backed out changeset 9260b6620943 (bug 1619926)
Backed out changeset af69a4896f2f (bug 1619926)
Backed out changeset b9cd6b7047b9 (bug 1612380)
2020-09-01 21:03:23 +03:00
Mark Banner
fd382ca569 Bug 1612824 - Search Services shouldn't use reInit for when the locale is changed or the ignore list is updated. r=daleharvey
reInit is unsafe as it completely removes the existing data before reloading. If something interrupts the process that can cause dataloss.

_maybeReloadEngines is safer as it does changes progressively, it also now handles removing engines, which it didn't before.

Depends on D88023

Differential Revision: https://phabricator.services.mozilla.com/D88272
2020-08-28 11:25:34 +00:00
Mark Banner
074a2c9ecb Bug 1619926 - Remove remnants of Search geo-location handling now it is handled by Region.jsm. r=daleharvey
Depends on D88021

Differential Revision: https://phabricator.services.mozilla.com/D88022
2020-08-31 16:34:25 +00:00
harry
e89f24d809 Bug 1660681 - Replace gURLBar.setSearchMode({}) calls in tests with exitSearchMode helper. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D88671
2020-08-29 00:51:21 +00:00
Marco Bonardo
ed163ca20b Bug 1658605 - Enter search mode when a token alias is autofilled. r=harry
Differential Revision: https://phabricator.services.mozilla.com/D88415
2020-08-27 15:29:42 +00:00
Marco Bonardo
71fc634105 Bug 1657526 - Copy from URLbar adds extra http:// with decodeURLsOnCopy. r=dao
Differential Revision: https://phabricator.services.mozilla.com/D88380
2020-08-27 09:18:38 +00:00
Harry Twyford
0e75c3d10c Bug 1659131 - Top Site search shortcuts should enter search mode. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D87908
2020-08-24 23:21:13 +00:00
Drew Willcoxon
bbe5591583 Bug 1657648 - Rewrite muxer and show more local suggestions if there aren't many remote suggestions. r=harry
This rewrites the muxer. I'll explain why.

The obvious way to fix this bug is to modify UrlbarProviderSearchSuggestions so
it adds `maxHistoricalSearchSuggestions` form history results first, followed by
as many remote suggestions as there are, followed by any remaining form history
results. And in fact that's what this patch does. But the muxer isn't capable of
handling that very well, with regard to deuping SERPs and form history.

The muxer does a first pass through all results, and it builds a set of form
history suggestions. Then, as it's adding URL results in the second pass, it
excludes SERPs whose search terms are in the set. The problem is that the set
can include search terms from form history results that do not end up in the
final list of results. And that's because UrlbarProviderSearchSuggestions now
returns many form history results -- as many as `context.maxResults + 1` so that
there are enough of them to fill the view when appropriate.

This is a problem with the muxer in general. It collects a bunch of state from
all results in its first pass, even though not all of those results may end up
in the final list. Worst case, we may end up excluding results we should not
exclude. The fundamental problem is that the muxer doesn't know which results
will end up being included until it starts including results.

The key thing about this rewrite is that the muxer builds up state as it goes
along filling its buckets. If a result is excluded, then it doesn't contribute
to the state used to determine whether subsequent results should be included.
There are a couple of exceptions though where it still does build state using
all results. (1) It still determines the heuristic this way, but that's OK since
there's only one heuristic. (2) It still builds `strippedUrlToTopPrefixAndTitle`
this way. I couldn't think of a nice way around that, because AFAICT there's no
guarantee that UnifiedComplete will put the higher-ranking URL result before the
lower one. If the lower one comes first, we'd end up including it too since
`strippedUrlToTopPrefixAndTitle` would not contain the higher-ranking one at
that point.

There's one drawback of building up the state in this new way. It's the flip
side of solving the problem above. If a result depends in some way on a
subsequent result, then the state at that first result won't be accurate and the
muxer will make a bad decision about that result. There's an example of this in
test_search_suggestions.js, near the bottom of the `formHistory` task. In that
test, `matchBuckets` is defined so that general results (e.g., history) appear
before search suggestions. That means the SERP in history can't be deduped in
favor of the form history result that appears later, so both results appear. I
think that's better than the alternative of possibly deduping too aggressively.

One important thing to note is that this patch isn't restricted to search
mode. It will always include more form history results to fill out the final
list if some other higher-ranked result group doesn't fill it out
sooner. Currently `matchBuckets` is `heuristic,1,extension,5,suggestion,4,general,Infinity,suggestion,Infinity,general,Infinity.`
Since `general,Infinity` comes before `suggestion,Infinity`, this means that if
there aren't enough general results to fill out the list, then suggestions will
fill it out as much as possible. Within suggestions, remote suggestions will
fill it out first and then form history, since that's the order that
UrlbarProviderSearchSuggestions adds them in after the initial
`maxHistoricalSearchSuggestions` form history results. I think that's what we
want regardless of search mode.

Finally, this patch also breaks up `sort` into more, smaller methods. The patch
started out as a much larger version that also redesigned `matchBuckets`. That's
the main reason I split it up, but it's nice by itself I think. (I'd like to
come back to that `matchBuckets` redesign, which could now build on top of
this. The original patch is in D87830.)

Differential Revision: https://phabricator.services.mozilla.com/D87838
2020-08-24 14:44:58 +00:00
Harry Twyford
7aeba750f4 Bug 1660425 - Use the entire search string when autofilling in UrlbarProviderTokenAliasEngines. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D87919
2020-08-22 02:37:05 +00:00
Dale Harvey
ec890e8f1e Bug 1650887 - Let unprefixed engines be accessed via @ r=harry
Differential Revision: https://phabricator.services.mozilla.com/D86221
2020-08-21 19:45:16 +00:00
Harry Twyford
7f48f83bec Bug 1659775 - Restrict adaptive history from appearing in search mode. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D87796
2020-08-20 20:12:01 +00:00
Drew Willcoxon
e57db4c2e2 Bug 1659610 - Split up browser_searchMode_setURI.js to fix intermittent timeout. r=harry
The last line from the test in the failure log is "INFO - Leaving test bound
tabSwitch", which is the final task in the test. I'm pretty sure the test is just
doing too much rather than timing out waiting for something to happen. So let's
split it up.

Depends on D87172

Differential Revision: https://phabricator.services.mozilla.com/D87384
2020-08-18 22:37:01 +00:00
Drew Willcoxon
999a645aa0 Bug 1659309 - UrlbarProviderHeuristicFallback should return a search heuristic when in search mode, not a URL heuristic, even when not restricting results to search. r=harry
* Add a check for `queryContext.searchMode` in
  `UrlbarProviderHeuristicFallback._matchUnknownUrl`. We should not match a URL
  when search mode is active, in addition to the existing check for a
  restricting source.
* Move the aforementioned checks to the top of the method so that we avoid when
  possible the more expensive string escaping and parsing currently at the top
  of that method.
* Add a test task.
* Beef up the existing test tasks.

Differential Revision: https://phabricator.services.mozilla.com/D87189
2020-08-17 14:55:21 +00:00
Drew Willcoxon
4a6570ffd6 Bug 1659128 - Exit search mode as appropriate when input.setURI is called. r=harry
We need to exit search mode when a page loads in the current tab. We may need to
exit search mode for page loads in other tabs too: If you're in search mode,
click a slow link, switch tabs, and the page loads in the meantime, then search
mode should be not be entered when you switch back. I don't think we handle that
case correctly right now, and this patch doesn't address that at all. That's
worth doing in another bug because I think the fix will be different.

At first I added an `onLocationChange` method to UrlbarInput that was called by
`XULBrowserWindow.onLocationChange` in browser.js [1], just like we have an
`onLocationChange` in UrlbarProviderSearchTips called by
`XULBrowserWindow.onLocationChange`. But we need to potentially exit search mode
any time `input.setURI` is called. `setURI` happens to be called by
`XULBrowserWindow.onLocationChange`, one of the several places that calls it
[2].

`setURI` is also called when switching tabs. Bug 1647899 already took care of
handling search mode for tab switches, but it would be nice to handle all this
in one place. `setURI` is also how `userTypedValue` is restored in the input,
and of course `userTypedValue` is something we need to restore when switching
tabs, just like search mode. For these reasons I moved per-tab search mode
restoration to `setURI` as part of this.

I'm also changing the name of the second parameter in `setURI`. I wasn't sure
whether it's true iff we're switching tabs, so I tracked down why that param was
added. It was added in bug 1478348, and comment 21 confirms it was added to tell
`setURI` and `XULBrowserWindow.onLocationChange` when they're being called due
to a tab switch. To make this clearer, I renamed the param and added some
javadoc for `XULBrowserWindow.onLocationChange`.

[1] https://searchfox.org/mozilla-central/rev/50cb0892948fb4291b9a6b1b30122100ec7d4ef2/browser/base/content/browser.js#5205
[2] https://searchfox.org/mozilla-central/search?q=symbol:%23setURI&redirect=false

Differential Revision: https://phabricator.services.mozilla.com/D87172
2020-08-17 20:31:44 +00:00
Harry Twyford
39cb08ad68 Bug 1647917 - Announce search mode to screen readers. r=adw,fluent-reviewers,flod
Differential Revision: https://phabricator.services.mozilla.com/D87082
2020-08-14 19:06:47 +00:00
Harry Twyford
13a0e9233c Bug 1658646 - Show local results for search modes other than general purpose search engines. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D86998
2020-08-14 03:57:15 +00:00
Csoregi Natalia
764a7a6ede Backed out changeset e5655c6b1c5f (bug 1658646) for failures on browser_oneOffs_searchSuggestions.js. CLOSED TREE 2020-08-14 06:30:46 +03:00
Harry Twyford
f51ddfbfeb Bug 1658646 - Show local results for search modes other than general purpose search engines. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D86998
2020-08-14 01:15:43 +00:00
Drew Willcoxon
bb98fe7927 Bug 1659011 - Fix intermittent TV browser/components/urlbar/tests/browser/browser_oneOffs.js. r=harry
I can reproduce this reliably after refreshing my tree and applying the patch to
bug 1657918. It seems to be permanent in fact. The problem is that a previous
test (or the test itself, since this is a failure in verify mode) leaves the
mouse over the heuristic result, which causes it to be highlighted and show its
action text ("Search with Google"). The test is checking that the action text is
hidden.

We just need to synthesize a mousemove away from the view as the test starts. We
do something similar in a few tests already, although sometimes we use
`EventUtils.synthesizeNativeMouseMove` instead of what I use here. I tried that
function first but it didn't work here, so I went with the other one we use,
`EventUtils.synthesizeMouse` with `mousemove`.

Differential Revision: https://phabricator.services.mozilla.com/D87015
2020-08-14 00:35:18 +00:00
Drew Willcoxon
e2ab883d49 Bug 1657918 - Don't add a heuristic result for empty searches in local search modes, and modify the view to allow it to stay open when empty. r=harry
This excludes the heuristic for empty searches when in search mode. I haven't
heard back from Verdi yet about excluding it for all searches in search mode. We
can add that in a follow-up if necessary.

Since we're now excluding the heuristic but we want the view to remain open,
it's possible for the view to be empty while it's open. I had to make some
changes to allow that to happen. There are three cases I want to call out:

1. When the search string is empty, the view shows top sites. If you then enter
   search mode and the resulting search doesn't return any results, we
   previously closed the view. This patch keeps it open. An example of this
   scenario is when you don't have any bookmarks and you click the bookmarks
   one-off.
2. When the urlbar isn't focused, it's in search mode, the input is empty, and
   the search didn't return any results, then focusing the urlbar didn't do
   anything previously. This patch auto-opens the view.
3. When the input contains a single char and it's in search mode, deleting the
   char previously closed the view if the empty search didn't return any
   results. This patch keeps the view open.

When the view is empty, we also need to hide the one-offs' top border that
usually separates them from the results. Otherwise there are two separator lines
right next to each other, the one above the one-offs and the one at the bottom
edge of the input. I don't think there's any CSS selector that will let us
easily do this due to the DOM structure, so I added a new `noresults` attribute
on the view for this.

I had to call `context.searchString.trim()` to tell whether the search string is
empty. Since we do that in a bunch of places, I added
`context.trimmedSearchString`, and a lot of this patch is replacing those `trim`
calls.

Differential Revision: https://phabricator.services.mozilla.com/D86908
2020-08-13 19:00:14 +00:00
Harry Twyford
b39c619461 Bug 1654801 - Part 3 - Fix tests to work with update2/oneOffsRefresh prefs enabled. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D86767
2020-08-12 03:40:28 +00:00
Harry Twyford
fe111533bb Bug 1654801 - Part 2 - Update search results when one-offs are being alt-tabbed. r=adw
I noticed when when working on browser_oneOffs_searchSuggestions > test_selectOneOffThenSuggestion.

Differential Revision: https://phabricator.services.mozilla.com/D86766
2020-08-12 03:39:55 +00:00
Drew Willcoxon
fdbb3db966 Bug 1658330 - Start a new query to show top sites when the input is empty and search mode is exited by backspacing. r=harry
We just need to start a new query on backspace, even when the input is empty.

I noticed that unlike backspace, clicking the close button will always start a
new query except when the view is closed. That means the close button was
already doing the right thing. It also means that the close button will not open
the view and show top sites when the view is already closed; however, with this
patch, backspace *will* open the view and show top sites if the view is closed.
That seems right to me despite the inconsistency since inputs in the urlbar
(including backspace) always cause the view to open.

Other changes:

* Make the `click_close` test task more similar to the `backspace` task: Open
  the view both with and without a string instead of only with a string
* Some calls in the test didn't have an `await` like they should (maybe the
  source of reported intermittent failures?)

Differential Revision: https://phabricator.services.mozilla.com/D86686
2020-08-11 16:05:03 +00:00
Drew Willcoxon
3434a9df60 Bug 1658395 - Replace engine aliases with engine names in the search mode indicator. r=harry
This removes `alternateLabel` as mentioned in the bug since I had the same
thought.

Depends on D86664

Differential Revision: https://phabricator.services.mozilla.com/D86687
2020-08-12 00:39:21 +00:00
Drew Willcoxon
075c66c124 Bug 1647889 - Show different Urlbar placeholder while visual indicator is showing. r=harry,fluent-reviewers,flod
This is the simplest possible way to fix this bug in the interest of landing
ASAP. It keeps a hardcoded list of engines that search the web.

Differential Revision: https://phabricator.services.mozilla.com/D86664
2020-08-12 00:25:58 +00:00
Harry Twyford
72560dd5f9 Bug 1647890 - Replace token alias with indicator when the token alias is confirmed or fully typed. r=adw
This patch changes the paramters to setSearchMode. The original patch to introduce search mode passed engineName to setSearchMode instead of the entire engine object. It was suggested in review that the nsISearchEngine be passed so we could run instanceof to distinguish it from a RESULT_TYPE. This patch reverses this and passes engineName instead through a destructured parameter.

In pickResult, we need to enter search mode synchronously based on the information in a result payload. Result payloads can't/shouldn't pass around complex objects like an nsISearchEngine, so we just pass engineName and the alias as strings. Since pickResult is synchronous, we can't use UrlbarSearchUtils to look up the engine based on the engineName. Besides, setSearchMode only uses engineName, so looking up the engine only to just use its name seems like a waste of resources.

This patch also disables autofill in search mode queries. Autofill was interfering with alias replacement. We were already half doing this (https://searchfox.org/mozilla-central/rev/26b13464c2beb26e0d864d561c30e817a85c348a/browser/components/urlbar/UrlbarController.jsm#391) but adding the searchMode check to UrlbarInput._maybeAutofillOnInput should resolve bug 1655473.

There's still one more bug I'm working through where the placeholder disappears after alias replacement. I though I'd get this out to start review regardless since we want to get the three patches discussed in Thursday's meeting out ASAP.

Differential Revision: https://phabricator.services.mozilla.com/D86389
2020-08-10 15:16:40 +00:00
Dorel Luca
25b814837c Backed out changeset 527908cfaa56 (bug 1647890) for Browser-chrome failures on browser/browser_searchModeIndicator.js. CLOSED TREE 2020-08-10 08:02:29 +03:00
Harry Twyford
198a38cfc4 Bug 1647890 - Replace token alias with indicator when the token alias is confirmed or fully typed. r=adw
This patch changes the paramters to setSearchMode. The original patch to introduce search mode passed engineName to setSearchMode instead of the entire engine object. It was suggested in review that the nsISearchEngine be passed so we could run instanceof to distinguish it from a RESULT_TYPE. This patch reverses this and passes engineName instead through a destructured parameter.

In pickResult, we need to enter search mode synchronously based on the information in a result payload. Result payloads can't/shouldn't pass around complex objects like an nsISearchEngine, so we just pass engineName and the alias as strings. Since pickResult is synchronous, we can't use UrlbarSearchUtils to look up the engine based on the engineName. Besides, setSearchMode only uses engineName, so looking up the engine only to just use its name seems like a waste of resources.

This patch also disables autofill in search mode queries. Autofill was interfering with alias replacement. We were already half doing this (https://searchfox.org/mozilla-central/rev/26b13464c2beb26e0d864d561c30e817a85c348a/browser/components/urlbar/UrlbarController.jsm#391) but adding the searchMode check to UrlbarInput._maybeAutofillOnInput should resolve bug 1655473.

There's still one more bug I'm working through where the placeholder disappears after alias replacement. I though I'd get this out to start review regardless since we want to get the three patches discussed in Thursday's meeting out ASAP.

Differential Revision: https://phabricator.services.mozilla.com/D86389
2020-08-10 02:21:24 +00:00
Marco Bonardo
24ad033dab Bug 1654862 - Tests. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D86386
2020-08-08 21:07:39 +00:00
Marco Bonardo
5484266b3d Bug 1654862 - Show suggestions for the empty query when in search mode. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D86355
2020-08-08 21:33:12 +00:00
Marco Bonardo
6fb175caeb Bug 1657572 - Store form history source from search access points. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D86170
2020-08-08 12:49:24 +00:00
Drew Willcoxon
a0375c98e1 Bug 1647899 - Retain or remove search mode across tabs. r=harry
This is very simple, but it gets the job done. It keeps a map in `UrlbarInput`
from browsers to search mode objects. The map is updated in `setSearchMode`, and
it's used to set the search mode in `_afterTabSelectAndFocusChange`.

Differential Revision: https://phabricator.services.mozilla.com/D86296
2020-08-08 02:45:42 +00:00
Drew Willcoxon
be6777746d Bug 1657633 - Make the up/down arrow keys avoid moving the selection through the one-offs when they are not shown. r=harry
This is a narrow fix to the bug, which happens because I removed this
conditional in bug 1654439: https://hg.mozilla.org/mozilla-central/rev/f561eb606ad3#l1.251

That conditional kept the selection out of the one-offs when the urlbar hid
them. This patch replaces that conditional with a version that can be overridden
by the urlbar subclass. It adds a `hasView` getter that is equivalent, but note
that `this._view` can't be used because the urlbar subclass sets `this.view` in
its constructor and never nulls it out, unlike the original implementation. So
instead the subclass `hasView` checks whether the one-offs are hidden. This is
effectively the same thing because in the old implementation the urlbar one-offs
were hidden at the same time `this._view` was nulled out.

Differential Revision: https://phabricator.services.mozilla.com/D86293
2020-08-08 00:57:20 +00:00
Harry Twyford
c090486c48 Bug 1655485 - Exit search mode if update2 pref is flipped. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D85904
2020-08-06 14:37:19 +00:00
Dale Harvey
ff9dc1c764 Bug 1650883 - Remove hardcoded aliases, replace with webextension keywords r=Standard8,thecount
Differential Revision: https://phabricator.services.mozilla.com/D85345
2020-08-06 12:10:53 +00:00
Marco Bonardo
f3fa511bd6 Bug 1657211 - Search history is not saved when one-off buttons are picked in the Address Bar. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D86004
2020-08-06 12:51:30 +00:00
Butkovits Atila
bb41ad63da Backed out changeset 6faa35a6346f (bug 1655485) browser_searchModeIndicator.js. CLOSED TREE 2020-08-06 00:27:11 +03:00
Harry Twyford
52146366d5 Bug 1655485 - Exit search mode if update2 pref is flipped. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D85904
2020-08-05 18:10:49 +00:00
Harry Twyford
649526b7fe Bug 1647893 - Enter search mode with default engine on Accel+K. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D85914
2020-08-05 19:17:54 +00:00
Harry Twyford
8a1aa7048d Bug 1656005 - Clear input and invalidate pageproxystate if search mode is entered with a valid pageproxystate. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D85892
2020-08-05 15:29:35 +00:00
Gijs Kruitbosch
2783349ab6 Bug 1645619 - stop using the default URL bar placeholder string after customize mode by using fluent all the time, r=Standard8,fluent-reviewers,flod
The original issue this patch addresses is what happens when exiting customize
mode: the reinsertion of the urlbar (customize mode wraps it in a container)
causes fluent to re-run as there's a DOM mutation, which causes the default
placeholder to be re-translated. This caused issues because we were using
.properties to translate the string that included the engine name, and
fluent for the "default" placeholder string.

This patch fixes the issue by always using fluent, and using a hardcoded
'unknown' placeholder to deal with the case where there is no known engine.

Differential Revision: https://phabricator.services.mozilla.com/D85769
2020-08-05 13:33:17 +00:00
Tom Schuster
4711a353c1 Bug 1547595 - Work around brokeness in GTK with CRLF copying. r=stransky,jhorak
This makes us put the copied string as-is into the clipboard, exclusively for the type:
text/plain;charset=utf-8

When pasting strings into Firefox, `\r` might still be converted to `\n`. So disable
part of the test in browser_removeUnsafeProtocolsFromURLBarPaste.js.

Differential Revision: https://phabricator.services.mozilla.com/D82224
2020-08-05 09:26:03 +00:00
Drew Willcoxon
591e526c82 Bug 1657140 - Don't show one-offs under Search Tips when update 2 is enabled. r=harry
Differential Revision: https://phabricator.services.mozilla.com/D85942
2020-08-05 06:08:21 +00:00
Sebastian Streich
bf58055b03 Bug 1633710 - Move uri.spec calls to nsIPrincipal r=necko-reviewers,geckoview-reviewers,preferences-reviewers,ckerschb,ntim,snorp,valentin
Differential Revision: https://phabricator.services.mozilla.com/D82911
2020-08-04 11:10:41 +00:00
Drew Willcoxon
b7916828ff Bug 1647896 - Add local search mode one-offs for history, bookmarks, and tabs. r=harry,fluent-reviewers,flod
Differential Revision: https://phabricator.services.mozilla.com/D85237
2020-07-30 16:12:46 +00:00
Mark Banner
7b5f150a6a Bug 1656007 - Move URLBAR_SELECTED_RESULT_METHODS to UrlbarTestUtils as it is only used in tests. r=mak
Differential Revision: https://phabricator.services.mozilla.com/D85301
2020-07-30 15:04:20 +00:00
Csoregi Natalia
46ae0786e4 Backed out changeset f00da8ba6160 (bug 1647896) for urlbar failures. CLOSED TREE 2020-07-30 02:19:20 +03:00
Drew Willcoxon
33b61e1ce5 Bug 1647896 - Add local search mode one-offs for history, bookmarks, and tabs. r=harry,fluent-reviewers,flod
Differential Revision: https://phabricator.services.mozilla.com/D85237
2020-07-29 22:11:21 +00:00
Noemi Erli
5cebe61c77 Backed out changeset 4ed7b13fb7a5 (bug 1633710) for causing failures in browser_amosigned_url.js CLOSED TREE 2020-07-29 22:34:42 +03:00
Sebastian Streich
ea482d8e73 Bug 1633710 - Move uri.spec calls to nsIPrincipal r=necko-reviewers,geckoview-reviewers,preferences-reviewers,ckerschb,ntim,snorp,valentin
Differential Revision: https://phabricator.services.mozilla.com/D82911
2020-07-29 17:33:10 +00:00
Marco Bonardo
44646a6eb5 Bug 1655693 - In case of score match, autofill should prefer https. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D85183
2020-07-29 08:56:11 +00:00
Marco Bonardo
4326222700 Bug 1655363 - Autofill is wrongly fixing up origins in certain cases. r=adw
A poorly thought fixup SQL condition was stripping "www." from the origin in any
case, but when the search string contained "www.".
This ended up stripping too often, for example when typing "w" and matching
against "www.mozilla.org".
Instead, the query should strip "www." from the origin only if it doesn't start
with the search string.

Differential Revision: https://phabricator.services.mozilla.com/D85006
2020-07-27 23:16:00 +00:00
Marco Bonardo
48d23c80d5 Bug 1654316 - Autofill is not properly considering bookmarked status of origins. r=adw
The old query was picking a random bookmarked status out of the pages in an origin,
depending on the physical position of the origin rows in the table.
The new query uses window functions to partition the data by origin, so it can
query origins just once and sum www and non-www origin's frecency scores before
comparing to the autofill threshold.

Differential Revision: https://phabricator.services.mozilla.com/D84657
2020-07-24 12:01:15 +00:00
Harry Twyford
bc3ea4aef4 Bug 1647915 - Restrict queryContext to search mode when visual indicator is visible. r=mak
Differential Revision: https://phabricator.services.mozilla.com/D83855
2020-07-23 20:01:32 +00:00
Harry Twyford
458e073f03 Bug 1647888 - Implement visual indicator in the Urlbar for aliased engine. r=dao,mak
Differential Revision: https://phabricator.services.mozilla.com/D83854
2020-07-23 18:41:32 +00:00
Harry Twyford
282d11dfbe Bug 1653436 - Cancel heuristic timer on cancelQuery. r=mak
Differential Revision: https://phabricator.services.mozilla.com/D84091
2020-07-20 19:45:18 +00:00
Marco Bonardo
9cba702385 Bug 1653611 - Make UrlbarProvider.cancelQuery optional. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D83974
2020-07-17 19:55:30 +00:00
Drew Willcoxon
5978ac01c9 Bug 1647897 - [Quantumbar update 2] Show one-offs when input is empty. r=harry
Differential Revision: https://phabricator.services.mozilla.com/D83892
2020-07-17 15:23:15 +00:00
Marco Bonardo
1b0740623c Bug 1652592 - Unify the query pending checks across urlbar providers. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D83473
2020-07-15 10:16:50 +00:00
Marco Bonardo
7e76f843c7 Bug 1641467 - Remove temporary browser.fixup.defaultToSearch feature pref and its code. r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D83554
2020-07-15 09:53:04 +00:00
Marco Bonardo
19f7160153 Bug 1652040 - Make UrlbarProviderOpenTabs instantiable with static methods. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D83121
2020-07-13 21:43:37 +00:00
Harry Twyford
2ac85191d6 Bug 1648468 - Part 7 - Temporarily disable test_keywords.js on Linux to resolve bug 1474616. r=mak
Differential Revision: https://phabricator.services.mozilla.com/D83272
2020-07-12 21:55:25 +00:00
Harry Twyford
370555942c Bug 1648468 - Part 5 - Move some deduping code from UnifiedComplete to the UrlbarMuxer. r=adw,mak
Differential Revision: https://phabricator.services.mozilla.com/D82800
2020-07-12 21:55:25 +00:00
Harry Twyford
2e97219404 Bug 1648468 - Part 4 - Port autofill unit tests to browser/components/urlbar. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D82237
2020-07-12 21:55:24 +00:00
Harry Twyford
e0287bb730 Bug 1645521 - Part 3 - Port unifiedcomplete tests. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D80294
2020-07-12 17:35:02 +00:00
Harry Twyford
12102e198f Bug 1645521 - Part 2 - Allow for multiple heuristic providers and enable ProviderHeuristicFallback. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D80293
2020-07-12 17:35:01 +00:00
Csoregi Natalia
b74c685d0f Backed out 6 changesets (bug 1650099, bug 1647881, bug 1645521, bug 1645324) for causing Bug 1652024.
Backed out changeset f66c5cce9088 (bug 1650099)
Backed out changeset bf67c2159244 (bug 1645324)
Backed out changeset 76d81e1e728b (bug 1645521)
Backed out changeset ab3766fa81f9 (bug 1645521)
Backed out changeset ff56bb6cbfb7 (bug 1645521)
Backed out changeset aceb6f9acf3b (bug 1647881)
2020-07-12 17:58:28 +03:00
Csoregi Natalia
af5cff556a Backed out 6 changesets (bug 1648468) for failures on test_keywords.js. CLOSED TREE
Backed out changeset 918db5010acb (bug 1648468)
Backed out changeset 91a4b5b593bf (bug 1648468)
Backed out changeset 3bded27be98e (bug 1648468)
Backed out changeset 60a36d4424df (bug 1648468)
Backed out changeset 1edf02398318 (bug 1648468)
Backed out changeset ebac9fb9da0d (bug 1648468)
2020-07-12 09:03:53 +03:00
Harry Twyford
d7e9c8e70f Bug 1648468 - Part 5 - Move some deduping code from UnifiedComplete to the UrlbarMuxer. r=adw,mak
Differential Revision: https://phabricator.services.mozilla.com/D82800
2020-07-11 22:53:07 +00:00