Skip to content
Snippets Groups Projects
Commit f2de33cf authored by Gijs Kruitbosch's avatar Gijs Kruitbosch
Browse files

Bug 1269462 - fix race condition in TabsInTitlebar code where it was possible...

Bug 1269462 - fix race condition in TabsInTitlebar code where it was possible we'd only be called before init(), resulting in never updating the titlebar maths, r=MattN,mconley

MozReview-Commit-ID: KM274gGpiuR

--HG--
extra : rebase_source : 06cfc19ce026cfc033fff0a6b0c6a455c78e0cdf
parent eef9767c
No related branches found
No related tags found
No related merge requests found
......@@ -38,6 +38,12 @@ var TabsInTitlebar = {
addEventListener("resolutionchange", this, false);
this._initialized = true;
if (this._updateOnInit) {
// We don't need to call this with 'true', even if original calls
// (before init()) did, because this will be the first call and so
// we will update anyway.
this._update();
}
},
allowedBy: function (condition, allow) {
......@@ -84,6 +90,7 @@ var TabsInTitlebar = {
},
_initialized: false,
_updateOnInit: false,
_disallowed: {},
_prefName: "browser.tabs.drawInTitlebar",
_lastSizeMode: null,
......@@ -98,8 +105,15 @@ var TabsInTitlebar = {
let rect = ele => ele.getBoundingClientRect();
let verticalMargins = cstyle => parseFloat(cstyle.marginBottom) + parseFloat(cstyle.marginTop);
if (!this._initialized || window.fullScreen)
if (window.fullScreen)
return;
// In some edgecases it is possible for this to fire before we've initialized.
// Don't run now, but don't forget to run it when we do initialize.
if (!this._initialized) {
this._updateOnInit = true;
return;
}
let allowed = true;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment