Closed Bug 1438511 Opened 2 years ago Closed 2 years ago

gUIDensity.update is causing initialization of the sidebar browser at startup

Categories

(Firefox :: General, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
Firefox 60
Tracking Status
firefox60 --- fixed

People

(Reporter: nhnt11, Assigned: nhnt11)

References

Details

Attachments

(2 files)

From my investigation, this is happening even before SidebarUI.init() which is bad. Patch coming soon.
Assignee: nobody → nhnt11
Status: NEW → ASSIGNED
Comment on attachment 8951247 [details]
Bug 1438511 - Don't update sidebar UI density before SidebarUI is initialized, or if the sidebar is not open.

https://reviewboard.mozilla.org/r/220512/#review226486

Works well, thanks!

::: browser/base/content/browser-sidebar.js:51
(Diff revision 1)
>    _icon: null,
>    _reversePositionButton: null,
>    _switcherPanel: null,
>    _switcherTarget: null,
>    _switcherArrow: null,
> +  _inited: null,

This should just be initialized to false

::: browser/base/content/browser-sidebar.js:54
(Diff revision 1)
>    _switcherTarget: null,
>    _switcherArrow: null,
> +  _inited: null,
> +
> +  get initialized() {
> +    return !!this._inited;

and then you don't need the !! here.

::: browser/base/content/browser.js:5639
(Diff revision 1)
>    update(mode) {
>      if (mode == null) {
>        mode = this.getCurrentDensity().mode;
>      }
>  
> -    let docs = [
> +    let docs = [ document.documentElement ];

nit: there's usually no space between '[', ']' and the array content when the initialization is on a single line.
Attachment #8951247 - Flags: review?(florian) → review+
Comment on attachment 8951250 [details]
Bug 1438511 - Copy top window's uidensity attribute in sidebarUtils.js instead of forcing gUIDensity.update().

https://reviewboard.mozilla.org/r/220514/#review226488
Attachment #8951250 - Flags: review?(florian) → review+
Pushed by nhnt11@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/be58311261fc
Don't update sidebar UI density before SidebarUI is initialized, or if the sidebar is not open. r=florian
https://hg.mozilla.org/integration/autoland/rev/3ae4195fba97
Copy top window's uidensity attribute in sidebarUtils.js instead of forcing gUIDensity.update(). r=florian
https://hg.mozilla.org/mozilla-central/rev/be58311261fc
https://hg.mozilla.org/mozilla-central/rev/3ae4195fba97
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 60
You need to log in before you can comment on or make changes to this bug.