Commit graph

238 commits

Author SHA1 Message Date
Drew Willcoxon
c901619704 Bug 1545742 - Quantumbar: Remove the proper nsIController on uninit and customize start so that left/right arrow and home/end keys work after exiting customize mode. r=mak
When UrlbarInput.uninit is called after customize mode ends, uninit calls this.inputField.controllers.removeControllerAt(0), which is supposed to remove the input's CopyCutController inserted in the constructor. But the controller at index 0 at that point is not the CopyCutController. Instead it's some built-in controller that supports these commands (at least these): cmd_charPrevious, cmd_charPrevious, cmd_beginLine, cmd_endLine. (Verified by adding logging to nsXULControllers::GetControllerForCommand.) That's why arrow left/right and home/end don't work after ending customize mode.

The problem is that this.inputField.controllers in the constructor and this.inputField.controllers in uninit (when customize mode ends) are not the same. I wasn't able to track down why, but I'm guessing that the textbox or something in its state is being reset or cloned when customized mode ends or maybe right after it starts. The CopyCutController isn't in the controllers array at all on uninit. (Verified by adding support for cmd_adw and iterating through the controllers array, looking for a controller supporting cmd_adw.)

Note that urlbarBindings.xml has a try-catch around removeController(), I'm guessing for what turns out to be this reason: https://searchfox.org/mozilla-central/rev/7944190ad1668a94223b950a19f1fffe8662d6b8/browser/base/content/urlbarBindings.xml#190

However, CopyCutController *is* in the controllers array when customize mode starts. So I added a new gURLBarHandler.customizeStart method that calls a new UrlbarInput.removeCopyCutController method.

Other things I tried or thought of doing:

Call gURLBarHandler._reset on customize start instead of end. Problem with that is that the UrlbarInput ends up getting immediately recreated because some other parts of the browser access gURLBar at that time. (Of course I replaced the `gURLBar = this.urlbar` assignment in _reset with another lazy getter definition.)

Just don't worry about removing CopyCutController at all. That seems bad because then we'd leak it, unless the controller is removed or the controllers array is emptied at some point by XUL, and I'm not at all certain about that. (Although I guess this is effectively what awesomebar does, given the link above!)

Differential Revision: https://phabricator.services.mozilla.com/D29613

--HG--
extra : moz-landing-system : lando
2019-05-03 16:03:00 +00:00
Mark Banner
5dd6faf49b Bug 1545706 - Avoid displaying an extra dash for keyword searches in QuantumBar. r=dao
Differential Revision: https://phabricator.services.mozilla.com/D29418

--HG--
extra : moz-landing-system : lando
2019-05-02 13:00:16 +00:00
Drew Willcoxon
70e0b1acf5 Bug 1539804 - Quantumbar: Re-enable browser_urlbarStopSearchOnSelection.js and fix a couple of related problems. r=mak
This test uncovered a couple of problems:

(1) UrlbarController.handleKeyNavigation relies on event.defaultPrevented to tell whether the one-offs handled the key event. That's a problem when combined with deferring the down arrow key.

handleKeyNavigation is called twice in that case. The first time, the event is deferred (so executeAction = false), and handleKeyNavigation calls event.preventDefault. The second time, the event is being replayed, but defaultPrevented is true from the previous call regardless of whether the one-offs actually handled the event.

So handleKeyNavigation always returns early because it thinks the one-offs always handled the event, so it never properly replays down arrow keys.

(2) UrlbarProviderUnifiedComplete's query promise is never resolved when the query is canceled. That's a problem in general of course but I tripped over it in this test because I need to check results after the query is canceled, and the test ended up hanging since UrlbarTestUtils waits for the query to finish in order to get its results.

It's not a problem in UnifiedComplete itself per se because of course awesomebar uses UnifiedComplete too, and it doesn't have this problem. The difference is that nsAutoCompleteController::StopSearch calls input->OnSearchComplete() (via PostSearchCleanup): https://searchfox.org/mozilla-central/rev/b756e6d00728dda4121f8278a744381d8643317a/toolkit/components/autocomplete/nsAutoCompleteController.cpp#1433

Quantumbar's UnifiedComplete provider is missing that behavior, so this patch adds it by resolving its query promise when the query is canceled.

Differential Revision: https://phabricator.services.mozilla.com/D29300

--HG--
extra : moz-landing-system : lando
2019-05-01 17:42:19 +00:00
Ciure Andrei
9b79007ae8 Backed out changeset 9242458b79d5 (bug 1539804) for high frequency browser/browser_urlbarStopSearchOnSelection.js failures CLOSED TREE 2019-05-01 14:45:59 +03:00
Joel Maher
6611f95ab0 Bug 1546459 - remove subsuite=clipboard from manifests. r=ahal
remove subsuite=clipboard from manifests

Differential Revision: https://phabricator.services.mozilla.com/D28521

--HG--
extra : moz-landing-system : lando
2019-05-01 08:16:44 +00:00
Drew Willcoxon
539ae1ed8f Bug 1539804 - Quantumbar: Re-enable browser_urlbarStopSearchOnSelection.js and fix a couple of related problems. r=mak
This test uncovered a couple of problems:

(1) UrlbarController.handleKeyNavigation relies on event.defaultPrevented to tell whether the one-offs handled the key event. That's a problem when combined with deferring the down arrow key.

handleKeyNavigation is called twice in that case. The first time, the event is deferred (so executeAction = false), and handleKeyNavigation calls event.preventDefault. The second time, the event is being replayed, but defaultPrevented is true from the previous call regardless of whether the one-offs actually handled the event.

So handleKeyNavigation always returns early because it thinks the one-offs always handled the event, so it never properly replays down arrow keys.

(2) UrlbarProviderUnifiedComplete's query promise is never resolved when the query is canceled. That's a problem in general of course but I tripped over it in this test because I need to check results after the query is canceled, and the test ended up hanging since UrlbarTestUtils waits for the query to finish in order to get its results.

It's not a problem in UnifiedComplete itself per se because of course awesomebar uses UnifiedComplete too, and it doesn't have this problem. The difference is that nsAutoCompleteController::StopSearch calls input->OnSearchComplete() (via PostSearchCleanup): https://searchfox.org/mozilla-central/rev/b756e6d00728dda4121f8278a744381d8643317a/toolkit/components/autocomplete/nsAutoCompleteController.cpp#1433

Quantumbar's UnifiedComplete provider is missing that behavior, so this patch adds it by resolving its query promise when the query is canceled.

Differential Revision: https://phabricator.services.mozilla.com/D29300

--HG--
extra : moz-landing-system : lando
2019-05-01 02:30:47 +00:00
Drew Willcoxon
aa16935357 Bug 1545916 - Make quantumbar match highlighting case insensitive. r=dao
Differential Revision: https://phabricator.services.mozilla.com/D28751

--HG--
extra : moz-landing-system : lando
2019-04-25 18:12:06 +00:00
Bogdan Tara
769a1f0d22 Backed out changeset 2fb18533192e (bug 1545916) for test_tokenizer.js failures CLOSED TREE 2019-04-25 19:57:27 +03:00
Drew Willcoxon
441baf366e Bug 1545916 - Make quantumbar match highlighting case insensitive. r=dao
Differential Revision: https://phabricator.services.mozilla.com/D28751

--HG--
extra : moz-landing-system : lando
2019-04-25 08:56:47 +00:00
Drew Willcoxon
5d3e10fe23 Bug 1541921 - Remove duplicate-search bailout from quantumbar. r=dao
Differential Revision: https://phabricator.services.mozilla.com/D27859

--HG--
extra : moz-landing-system : lando
2019-04-25 05:54:44 +00:00
Brindusan Cristian
3704a79e13 Backed out changeset b97df75c9365 (bug 1541921) for bc mochitest asan failures. 2019-04-20 01:35:37 +03:00
Drew Willcoxon
8f9a1d4ab3 Bug 1541921 - Remove duplicate-search bailout from quantumbar. r=dao
Differential Revision: https://phabricator.services.mozilla.com/D27859

--HG--
extra : moz-landing-system : lando
2019-04-19 20:57:56 +00:00
Marco Bonardo
ce793a562d Bug 776408 - Do not autofill after a paste. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D28051

--HG--
extra : moz-landing-system : lando
2019-04-19 09:10:40 +00:00
Mark Banner
0cd1778285 Bug 1545124 - Disable add-on manager logging for some tests. r=aswan
Differential Revision: https://phabricator.services.mozilla.com/D27917

--HG--
extra : moz-landing-system : lando
2019-04-17 15:48:07 +00:00
Drew Willcoxon
607920f718 Bug 1524550 - Remove UrlbarQueryContext's lastKey property. r=mak
This assumes that the current direction in bug 1522278 is the one we want, which it's looking like it is.

Differential Revision: https://phabricator.services.mozilla.com/D27854

--HG--
extra : moz-landing-system : lando
2019-04-17 15:19:23 +00:00
Drew Willcoxon
c1f323bbe7 Bug 1541929 - Don't autofill the first result in some cases. r=mak
We need to handle autofilling the first result separately from autofilling results in general (which happens in UrlbarInput.setValueFromResult), so add a new UrlbarInput.autofillFirstResult method. The controller calls it instead of setValueFromResult. I ported the logic from nsAutoCompleteController, as described in the bug.

Other changes are related to the new test for this.

As part of this work, I was interested in learning how awesomebar handles browser_autoFill_typed.js, so I added it to the legacy tests, with a small tweak in the test for awesomebar.

Differential Revision: https://phabricator.services.mozilla.com/D26852

--HG--
extra : moz-landing-system : lando
2019-04-15 13:15:30 +00:00
Mark Banner
385ad0d913 Bug 1525548 - Centralise closing the address bar popup into the head file for urlbar tests. r=mak
Differential Revision: https://phabricator.services.mozilla.com/D26759

--HG--
extra : moz-landing-system : lando
2019-04-12 12:52:50 +00:00
Dale Harvey
9bdc33dd43 Bug 1496075 - Part 3: Use webextensions in SearchServices. r=mikedeboer,mixedpuppy
Differential Revision: https://phabricator.services.mozilla.com/D25246

--HG--
rename : browser/components/search/searchplugins/list.json => browser/components/search/extensions/list.json
rename : browser/components/search/searchplugins/images/wikipedia.ico => toolkit/components/search/tests/xpcshell/data/test-extensions/multilocale/favicon.ico
rename : browser/components/search/searchplugins/images/google.ico => toolkit/components/search/tests/xpcshell/data/test-extensions/special-engine/favicon.ico
extra : moz-landing-system : lando
2019-04-11 20:49:31 +00:00
Drew Willcoxon
2c2bb13ce7 Bug 1540710 - Down arrow key on the current URL/text should search for the URL/text, and clicking on the history dropmarker should keep the input's current value. r=dao
Differential Revision: https://phabricator.services.mozilla.com/D25906

--HG--
extra : moz-landing-system : lando
2019-04-11 21:09:50 +00:00
Syeda Asra Arshia Qadri
be84237367 Bug 1541432: Move browser_keyword* tests from browser/base/content/test/general to browser/components/urlbar. r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D26895

--HG--
rename : browser/base/content/test/general/POSTSearchEngine.xml => browser/components/urlbar/tests/browser/POSTSearchEngine.xml
rename : browser/base/content/test/general/browser_keywordBookmarklets.js => browser/components/urlbar/tests/browser/browser_keywordBookmarklets.js
rename : browser/base/content/test/general/browser_keywordSearch.js => browser/components/urlbar/tests/browser/browser_keywordSearch.js
rename : browser/base/content/test/general/browser_keywordSearch_postData.js => browser/components/urlbar/tests/browser/browser_keywordSearch_postData.js
extra : moz-landing-system : lando
2019-04-11 13:37:48 +00:00
Marco Bonardo
f11e7c7e92 Bug 1540861 - Limit the length of titles and URLs we display so layout doesn't spend too much time building text runs. r=dao
Differential Revision: https://phabricator.services.mozilla.com/D26709

--HG--
extra : moz-landing-system : lando
2019-04-10 18:53:13 +00:00
Marco Bonardo
b69efcad09 Bug 1532738 - Fix the expected outcome of browser_caret_navigation.js. r=dao
Differential Revision: https://phabricator.services.mozilla.com/D25978

--HG--
extra : moz-landing-system : lando
2019-04-10 09:07:55 +00:00
shindli
bab5ff2626 Backed out changeset d389f6f9743e (bug 1540861) for causing perma failing bc7 failures in browser/components/urlbar/tests/browser/browser_UrlbarInput_tooltip.js 2019-04-09 21:40:51 +03:00
Marco Bonardo
957c300083 Bug 1540861 - Limit the length of titles and URLs we display so layout doesn't spend too much time building text runs. r=dao
Differential Revision: https://phabricator.services.mozilla.com/D26709

--HG--
extra : moz-landing-system : lando
2019-04-09 14:01:29 +00:00
Mark Banner
a99e0c0dae Bug 1536508 - Generate a mouseover as well as a mouseout to avoid issues in devedition with browser_UrlbarInput_tooltip.js. r=mak
Differential Revision: https://phabricator.services.mozilla.com/D26531

--HG--
extra : moz-landing-system : lando
2019-04-09 07:31:31 +00:00
Marco Bonardo
c91591d293 Bug 1528939. r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D26534

--HG--
extra : moz-landing-system : lando
2019-04-09 07:20:01 +00:00
Marco Bonardo
06d433199e Bug 1541399 - Ensure we don't fetch search suggestions for file urls. r=adw
Fixes the tokenizer to recognize file:/// urls, plus adds a second layer of
protection, so that if URI fixup thinks the typed string may be an url, we don't
fetch suggestions for it.

Differential Revision: https://phabricator.services.mozilla.com/D26282

--HG--
extra : moz-landing-system : lando
2019-04-08 23:50:21 +00:00
Drew Willcoxon
740f437ce0 Bug 1533054 - Add tests for selection key navigation: up/down, page-up/down, tab r=mak
Differential Revision: https://phabricator.services.mozilla.com/D25901

--HG--
extra : moz-landing-system : lando
2019-04-04 12:11:32 +00:00
Cosmin Sabou
60d90c1df7 Backed out changeset 278767179a87 (bug 1532738) for turning bug 1352679 into permafail. 2019-04-04 19:13:27 +03:00
Marco Bonardo
18a897a02f Bug 1532738 - Fix the expected outcome of browser_caret_navigation.js. r=dao
Differential Revision: https://phabricator.services.mozilla.com/D25978

--HG--
extra : moz-landing-system : lando
2019-04-04 09:09:33 +00:00
Marco Bonardo
b0bdfa84fc Bug 1533683 - Port the fix for Bug 1480349. r=dao
Differential Revision: https://phabricator.services.mozilla.com/D25668

--HG--
extra : moz-landing-system : lando
2019-04-03 12:39:13 +00:00
Marco Bonardo
0e5180139a Bug 1533052 - Port IME tests from autocomplete. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D25365

--HG--
extra : moz-landing-system : lando
2019-04-02 14:24:43 +00:00
Mark Banner
f481b075d7 Bug 1540650 - Fix UrlbarTestUtils to correctly get the title separator for QuantumBar following rtl changes (bug 1540650). r=dao
Differential Revision: https://phabricator.services.mozilla.com/D25581

--HG--
extra : moz-landing-system : lando
2019-04-02 09:31:09 +00:00
Noemi Erli
4a99b6924a Backed out changeset e5baf85c4ceb (bug 1533052) for failures in browser_ime_composition.js CLOSED TREE 2019-04-02 01:32:24 +03:00
Marco Bonardo
d8959021e7 Bug 1533052 - Port IME tests from autocomplete. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D25365

--HG--
extra : moz-landing-system : lando
2019-04-01 21:24:42 +00:00
Marco Bonardo
2dd9337727 Bug 1532034 - leak in browser_privateBrowsingWindowChange.js. r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D25609

--HG--
extra : moz-landing-system : lando
2019-04-01 14:25:52 +00:00
Dão Gottwald
e6ae768e15 Bug 1538158 - Clicking the history dropmarker should initiate an empty search instead of searching for the loaded URL. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D25059

--HG--
extra : moz-landing-system : lando
2019-03-28 16:18:50 +00:00
Brindusan Cristian
c6935ffebe Backed out changeset 827a1c12a137 (bug 1538158) for bc failures at browser_action_searchengine.js. 2019-03-28 14:46:16 +02:00
Dão Gottwald
ebf1e6991b Bug 1538158 - Clicking the history dropmarker should initiate an empty search instead of searching for the loaded URL. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D25059

--HG--
extra : moz-landing-system : lando
2019-03-28 10:45:08 +00:00
Mark Banner
dba6983e75 Bug 1415265 - Remove now unnecessary .eslintrc.js files or entries. r=mossop
Differential Revision: https://phabricator.services.mozilla.com/D23850

--HG--
extra : moz-landing-system : lando
2019-03-28 09:38:14 +00:00
Marco Bonardo
20e5ae9990 Bug 1538050 - Split restriction characters only if they are at the beginning or end of the search string. r=adw
The new tokenizer, to make more natural typing restrictions like "?search terms", "search terms?" or "%my tab",
splits out restriction characters if they appear at the beginning or end of the search string. This means
keywords and aliases can't in general begin or end with a restriction character, but we don't have an input
check to prevent those.
For now the tokenizer can't recognize keywords or aliases, because it can't be made asynchronous until the
Quantum Bar is the default implementation, and anyway the complexity must be considered at that point.

The best we can do is to stop splitting out restriction character in the middle of the search string.
This will allow a part of the old interaction like searching for "keyword? something".

This patch also prevents us from splitting a %encoded string, fixing bug 1538715.

Differential Revision: https://phabricator.services.mozilla.com/D24929

--HG--
extra : moz-landing-system : lando
2019-03-27 10:40:54 +00:00
Mark Banner
08ba3e8c7e Bug 1539284 - Remove some redundant functions from urlbar's head-common.js. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D24986

--HG--
extra : moz-landing-system : lando
2019-03-27 00:16:32 +00:00
Drew Willcoxon
c707227057 Bug 1538293 - Make autofilling the placeholder allow changes in case. r=mak
Differential Revision: https://phabricator.services.mozilla.com/D24593

--HG--
extra : moz-landing-system : lando
2019-03-26 22:59:14 +00:00
Marco Bonardo
6b5b1c40cd Bug 1533038 - Test that userContextId is properly added to the queryContext. r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D24357

--HG--
extra : moz-landing-system : lando
2019-03-26 15:15:54 +00:00
Mark Banner
74d9178878 Bug 1538771 - Fix highlighting of matches within URLs in QuantumBar results. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D24762

--HG--
extra : moz-landing-system : lando
2019-03-26 09:16:06 +00:00
Mark Banner
1a70ced2d9 Bug 1536776 - Fix display of percent-encoded URLs in QuantumBar. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D24502

--HG--
extra : moz-landing-system : lando
2019-03-26 09:15:15 +00:00
Marco Bonardo
134a6c11a6 Bug 1536751 - Quantum Bar should clear switch-to-tab overrides on blur. r=dao
Differential Revision: https://phabricator.services.mozilla.com/D24492

--HG--
extra : moz-landing-system : lando
2019-03-25 09:04:31 +00:00
Drew Willcoxon
ad4b3ecfcb Bug 1538117 - Fix autofill when typing the last character of an autofilled value. r=mak
_autofillValueOnInput correctly uses the placeholder string as the autofilled value, but it incorrectly uses _lastSearchString as the current input value.  _lastSearchString at that point is -- yes -- the previous search string, not what the user has just typed.  So when _autofillValueOnInput sets selectionStart to _lastSesarchString.length, the length is one char less than what it should be.

But why does that mess up only the last char typed and not every char?  Because when the first result comes in, we correctly autofill it.  It's only when the first result is not an autofill result that the incorrect placeholder autofill sticks around -- e.g., just after you type the last char in an @ alias.

This patch just gets rid of _autofillValueOnInput and inlines the body in _maybeAutofillOnInput.

Differential Revision: https://phabricator.services.mozilla.com/D24551

--HG--
extra : moz-landing-system : lando
2019-03-22 20:34:44 +00:00
Drew Willcoxon
a277e6fa71 Bug 1533039 - Test that down/up from an autofill entry autofills again and other aspects of autofill are preserved. r=mak
We already have browser_autoFill_preserveCase.js, which checks that we preserve case. This patch extends it to check a couple of more things: autofill is restored on up/down, and the user's input is restored when no result is selected.

Differential Revision: https://phabricator.services.mozilla.com/D24273

--HG--
rename : browser/components/urlbar/tests/browser/browser_autoFill_preserveCase.js => browser/components/urlbar/tests/browser/browser_autoFill_preserve.js
extra : moz-landing-system : lando
2019-03-21 21:13:12 +00:00
Ian Moody
67fb55f3b9 Bug 1536653 - browser/ automated ESLint no-throw-literal fixes. r=Gijs
Result of running:
$ mach eslint -funix browser/ | sed -Ee 's/:.+//' - | xargs sed -E \
    -e 's/throw ((["`])[^"]+\2);/throw new Error(\1);/g' \
    -e 's/throw ((["`])[^"]+\2 \+ [^ ";]+);/throw new Error(\1);/g' \
    -e 's/throw \(/throw new Error(/g' -i

Differential Revision: https://phabricator.services.mozilla.com/D24110

--HG--
extra : moz-landing-system : lando
2019-03-20 10:17:42 +00:00