Closed Bug 1575650 Opened 4 months ago Closed 4 months ago

Megabar should be regular width when a new window is opened

Categories

(Firefox :: Address Bar, defect, P1)

defect
Points:
3

Tracking

()

RESOLVED FIXED
Firefox 70
Iteration:
70.4 - Aug 19 - Sep 1
Tracking Status
firefox70 --- fixed

People

(Reporter: harry, Assigned: dao)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

Currently, the Megabar is very narrow on first run and when new windows are opened. It should be the same width it is on any other page.

Blocks: megabar

I think this issue stems from some circular logic when it comes to setting width. startLayoutBreakout sets the width of the expanded megabar based on the width of the textbox. The width of the selected textbox is based on --urlbar-width.

The issue is that the Urlbar is already selected by the time startLayoutBreakout is called, leading to the circle. The CSS first can't find --urlbar-width so it sets width to some minimum width (on my machine, it's 235px). Then startLayoutBreakout sets --urlbar-width to that minimum width, since that's how big the textbox is in its current selected state. Sure enough, modifying this line to

width: calc(var(--urlbar-width, 700px) + 2 * @urlbarBreakoutExtend@);

means the focused Urlbar is 700px on new window opens instead of 235px.

Dao, do you know of some way we can defer the focus-on-new-window behaviour until after startLayoutBreakout can be called? That way, --urlbar-width will be correctly set to the width of the full (unfocused) Urlbar. Alternatively, do you know where the call to focus the Urlbar on a new window is, so we could set --urlbar-width just before?

Flags: needinfo?(dao+bmo)
Attached video screencast showing bug

I ran into this myself (with browser.urlbar.megabar = true), and was about to file a dupe. Here's a screencast I recorded, showing the bug.

Assignee: nobody → dao+bmo
Status: NEW → ASSIGNED
Flags: needinfo?(dao+bmo)
Pushed by dgottwald@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/7ddf38b4b44c
Fix initial megabar size in new windows. r=harry
Status: ASSIGNED → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 70
Priority: -- → P1
You need to log in before you can comment on or make changes to this bug.