gecko-dev/browser
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
..
actors Bug 1656741, r=Gijs 2020-10-05 22:38:03 +00:00
app Bug 1668104 - Set doh-rollout.clearModeOnShutdown to false by default on Nightly. r=valentin 2020-10-07 10:23:42 +00:00
base Bug 1668809 - disable test_bug385434.html and browser_new_tab_in_privilegedabout_process_pref.js on fission r=smaug DONTBUILD 2020-10-07 08:31:20 +00:00
branding Bug 1654528 - Update comments for brand names in Fluent files r=Pike 2020-07-23 09:31:52 +00:00
components Bug 1668389 - Only set #urlbar[open] if we are sure there will be either results or one-offs. r=mak 2020-10-07 15:02:16 +00:00
config Bug 1665013 - Support basic symbols (e.g. function names) in GDB for the JS shell r=decoder 2020-09-29 08:18:32 +00:00
docs Bug 1647422 - Collect the profile count to report via telemetry r=chutten,Gijs 2020-08-13 14:51:20 +00:00
extensions Bug 1668884 - Replace -moz-Field/-moz-FieldText with Field/FieldText in browser/ r=dao 2020-10-05 11:13:54 +00:00
fonts Bug 1644346 - Update bundled Twemoji Mozilla font to v0.5.1 to support new emojis. r=lsalzman 2020-06-09 14:45:40 +00:00
fxr Bug 1649221: Update ChromeUtils.generateQI callers to pass strings. r=mccr8,remote-protocol-reviewers,marionette-reviewers,perftest-reviewers,webcompat-reviewers,geckoview-reviewers,preferences-reviewers,agi,whimboo,Bebe,twisniewski 2020-07-10 23:58:28 +00:00
installer Bug 1665195 - Also delete the UpdateLogs directory from the Firefox uninstaller. r=agashlin 2020-09-15 23:41:50 +00:00
locales Bug 1668436 - add aria-label to preferences' category list, r=Jamie,fluent-reviewers,preferences-reviewers,flod,jaws 2020-10-07 14:05:56 +00:00
modules Bug 1665237 - Make managed bookmarks item dynamic. r=Gijs 2020-10-06 20:13:00 +00:00
themes Bug 1668389 - Only set #urlbar[open] if we are sure there will be either results or one-offs. r=mak 2020-10-07 15:02:16 +00:00
tools/mozscreenshots Bug 1643776 - Add Alpenglow theme, r=dmose,rpl,flod 2020-08-21 17:20:07 +00:00
.eslintrc.js
LICENSE
Makefile.in
app.mozbuild
build.mk
confvars.sh Bug 1657954 - Move various branding options from `old-configure` r=geckoview-reviewers,mhentges,nalexander,snorp 2020-08-11 15:58:52 +00:00
defs.mk
l10n-registry.manifest
moz.build Bug 1643811 - [ci] Add a SCHEDULES rule to prevent 'android' builds and tests on pushes that exclusively modify files under /browser, r=gbrown,Gijs 2020-06-09 15:54:10 +00:00
moz.configure