Closed Bug 1539804 Opened 1 year ago Closed 1 year ago

re-enable browser_urlbarStopSearchOnSelection.js for Quantumbar

Categories

(Firefox :: Address Bar, task, P2)

task
Points:
2

Tracking

()

RESOLVED FIXED
Firefox 68
Iteration:
68.4 - Apr 29 - May 12
Tracking Status
firefox68 --- fixed

People

(Reporter: dao, Assigned: adw)

References

Details

Attachments

(1 file)

No description provided.
Points: --- → 2
Priority: P3 → P2
Type: enhancement → task
Assignee: nobody → adw
Status: NEW → ASSIGNED
Iteration: --- → 68.4 - Apr 29 - May 12

The event buffering in quantumbar seems to be different enough from awesomebar that porting this isn't quite as simple as I first thought.

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.

No longer depends on: 1535656
Pushed by dwillcoxon@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/9242458b79d5
Quantumbar: Re-enable browser_urlbarStopSearchOnSelection.js and fix a couple of related problems. r=mak
Regressions: 1548236
Backout by aciure@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/99548c52b81f
Backed out changeset 9242458b79d5 for high frequency browser/browser_urlbarStopSearchOnSelection.js failures CLOSED TREE
Pushed by dwillcoxon@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/a7ad04ab4ba4
Quantumbar: Re-enable browser_urlbarStopSearchOnSelection.js and fix a couple of related problems. r=mak
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 68
You need to log in before you can comment on or make changes to this bug.