зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1368940 - Avoid potential race condition in adjustTabstrip. r=mconley
The early this.getAttribute("overflow") == "true" check + requestAnimationFrame + _closeButtonsUpdatePending can make us skip an adjustTabstrip call from the overflow event that would remove the overflow attribute. MozReview-Commit-ID: 4cCdotvWmIa --HG-- extra : rebase_source : b59fb10778e01d5856e52366eeb461a2faba3697
This commit is contained in:
Родитель
93714d3413
Коммит
421284b7d3
|
@ -6041,20 +6041,17 @@
|
|||
<field name="_closeButtonsUpdatePending">false</field>
|
||||
<method name="adjustTabstrip">
|
||||
<body><![CDATA[
|
||||
// If we're overflowing, tabs are at their minimum widths.
|
||||
if (this.getAttribute("overflow") == "true") {
|
||||
this.setAttribute("closebuttons", "activetab");
|
||||
return;
|
||||
}
|
||||
|
||||
if (this._closeButtonsUpdatePending) {
|
||||
return;
|
||||
}
|
||||
this._closeButtonsUpdatePending = true;
|
||||
|
||||
// If we're overflowing, tabs are at their minimum widths.
|
||||
if (this.getAttribute("overflow") == "true") {
|
||||
window.requestAnimationFrame(() => {
|
||||
this._closeButtonsUpdatePending = false;
|
||||
this.setAttribute("closebuttons", "activetab");
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
// Wait until after the next paint to get current layout data from
|
||||
// getBoundsWithoutFlushing.
|
||||
window.requestAnimationFrame(() => {
|
||||
|
|
Загрузка…
Ссылка в новой задаче