Bug 1325695 - Handle Overflow and OverUnderflow cases when adjusting the height of autocomplete popup.; r=adw

MozReview-Commit-ID: 2U0di120coT

--HG--
extra : rebase_source : 676170871316fc84119d884e74a48fb95e97429f
This commit is contained in:
Sean Lee 2016-12-24 06:14:41 +08:00
Родитель 2a730ce5e0
Коммит 857b7ed220
1 изменённых файлов: 12 добавлений и 2 удалений

Просмотреть файл

@ -1250,6 +1250,15 @@ extends="chrome://global/content/bindings/popup.xml#popup">
visibleHeight + this._rlbPadding + "px";
}
// The class `forceHandleUnderflow` is for the item might need to
// handle OverUnderflow or Overflow when the height of an item will
// be changed dynamically.
for (let i = 0; i < numRows; i++) {
if (rows[i].classList.contains("forceHandleUnderflow")) {
rows[i].handleOverUnderflow();
}
}
let lastRowRect = rows[numRows - 1].getBoundingClientRect();
// Calculate the height to have the first row to last row shown
height = lastRowRect.bottom - firstRowRect.top +
@ -1511,8 +1520,9 @@ extends="chrome://global/content/bindings/popup.xml#popup">
<implementation>
<constructor><![CDATA[
// Unlike other autocomplete items, the height of the insecure warning
// increases by wrapping.
this._handleOverflow();
// increases by wrapping. So "forceHandleUnderflow" is for container to
// recalculate an item's height and width.
this.classList.add("forceHandleUnderflow");
]]></constructor>
</implementation>
</binding>