Closed Bug 1668389 Opened 4 years ago Closed 4 years ago

Outline of address bar focus ring obscured when in search mode with no engines or results

Categories

(Firefox :: Address Bar, defect, P2)

defect
Points:
3

Tracking

()

RESOLVED FIXED
83 Branch
Iteration:
83.2 - Oct 5 - Oct 18
Tracking Status
firefox-esr78 --- unaffected
firefox82 --- wontfix
firefox83 --- fixed

People

(Reporter: heycam, Assigned: bugzilla)

References

(Regression)

Details

(Keywords: regression)

Attachments

(2 files)

Attached image screen shot

See the attached screen shot. When I press Ctrl+K, the orange (here on Linux) focus ring around the address bar is not painted on the bottom edge, which looks a bit weird.

Component: Search → Address Bar

I can't reproduce on macOS. Cameron, it seems like you don't have any one-offs or search history in your screenshot, which is unexpected. Have you unchecked most/all of the engines under about:preferences#search > Search Shortcuts? Also what is the value of the pref browser.urlbar.maxHistoricalSearchSuggestions?

Flags: needinfo?(cam)

Yes, that is exactly what I've done. I have removed all but DuckDuckGo from the Search Shortcuts list. I also have unchecked "Provide search suggestions". My browser.urlbar.maxHistoricalSearchSuggestions value is 2, which looks like the default.

Flags: needinfo?(cam)

Ah, now I can reproduce. Thank you.

Severity: -- → S4
Points: --- → 2
Priority: -- → P2
Summary: outline of address bar focus ring obscured when Ctrl+K is pressed → Outline of address bar focus ring obscured when in search mode with no engines or results

Hm, I can no longer reproduce this, including with a fresh profile and by rolling back to a Nightly from a few days ago. Cameron, can you still reproduce on the latest Nightly? If so, could you please post the values of browser.urlbar.update2 and all the browser.urlbar.update2.* prefs?

Flags: needinfo?(cam)

I can still reproduce on current Nightly.

browser.urlbar.update2 true
browser.urlbar.update2.disableOneOffsHorizontalKeyNavigation true
browser.urlbar.update2.emptySearchBehavior 2
browser.urlbar.update2.localOneOffs true
browser.urlbar.update2.oneOffsRefresh true
browser.urlbar.update2.restyleBrowsingHistoryAsSearch true
browser.urlbar.update2.tabToComplete true

Flags: needinfo?(cam)

Thanks, Marco.

Assignee: nobody → htwyford
Status: NEW → ASSIGNED
Iteration: --- → 83.2 - Oct 5 - Oct 18

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.

Points: 2 → 3
Keywords: regression
Regressed by: 1657918
Has Regression Range: --- → yes
Pushed by htwyford@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/5be393d34bbd Only set #urlbar[open] if we are sure there will be either results or one-offs. r=mak
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 83 Branch
Flags: in-testsuite+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: