Bug 1575651 Comment 3 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

When `ui.popup.disable_autohide` is enabled, the view can be open but unfocused. This means that the return check in `startLayoutBreakout` fails since both conditions are not true:
```
      !(
        (this.focused && !this.textbox.classList.contains("hidden-focus")) ||
        this.view.isOpen
      )
```
`startLayoutBreakout` runs and sets `inputRect` to be the `#urlbar` element, which includes the panel. Then on this line:
```
this._layoutBreakoutPlaceholder.style.height = px(inputRect.height);
```
height is very tall— as tall as the entire urlbar input+panel. The breakout becomes very tall, breaking layout.

This patch sets `inputRect` to be the input instead, so the width and height are consistent regardless of whether the input is open or not.
When `ui.popup.disable_autohide` is enabled, the view can be open but unfocused. This means that the return check in `startLayoutBreakout` fails since both conditions are not true:
```
!(
  (this.focused && !this.textbox.classList.contains("hidden-focus")) ||
    this.view.isOpen
)
```
`startLayoutBreakout` runs and sets `inputRect` to be the `#urlbar` element, which includes the panel. Then on this line:
```
this._layoutBreakoutPlaceholder.style.height = px(inputRect.height);
```
height is very tall— as tall as the entire urlbar input+panel. The breakout becomes very tall, breaking layout.

This patch sets `inputRect` to be the input instead, so the width and height are consistent regardless of whether the input is open or not.

**EDIT:** The above is not accurate! The issue is actually that the return check in `endLayoutBreakout` [calls `this.isOpen`](https://searchfox.org/mozilla-central/rev/26f3378b01017ece02e4e4acf1dfd26dd6254020/browser/components/urlbar/UrlbarInput.jsm#882) instead of `this.view.isOpen`. Shows me right for making late-night Bugzilla comments :)

Back to Bug 1575651 Comment 3