Closed Bug 1539804 Opened 3 years ago Closed 3 years ago

re-enable browser_urlbarStopSearchOnSelection.js for Quantumbar


(Firefox :: Address Bar, task, P2)




Firefox 68
68.4 - Apr 29 - May 12
Tracking Status
firefox68 --- fixed


(Reporter: dao, Assigned: adw)




(1 file)

No description provided.
Points: --- → 2
Priority: P3 → P2
Type: enhancement → task
Assignee: nobody → adw
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):

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
Quantumbar: Re-enable browser_urlbarStopSearchOnSelection.js and fix a couple of related problems. r=mak
Regressions: 1548236
Backout by
Backed out changeset 9242458b79d5 for high frequency browser/browser_urlbarStopSearchOnSelection.js failures CLOSED TREE
Pushed by
Quantumbar: Re-enable browser_urlbarStopSearchOnSelection.js and fix a couple of related problems. r=mak
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 68
You need to log in before you can comment on or make changes to this bug.