Bug 1383707 - Temporarily increase the maxRows for form autofill results in order not to show scrollbar in the popup. r=MattN

MozReview-Commit-ID: 7Fjt7T90GIJ

--HG--
extra : rebase_source : d1f76b606cef7b2f4132064ebd2e6c7550b68990
This commit is contained in:
Ray Lin 2017-07-26 15:17:02 +08:00
parent a1a6b986fb
commit 7c82a212d6

View File

@ -152,10 +152,11 @@ this.AutoCompletePopup = {
return;
}
let firstResultStyle = results[0].style;
this.weakBrowser = Cu.getWeakReference(browser);
this.openedPopup = browser.autoCompletePopup;
// the layout varies according to different result type
this.openedPopup.setAttribute("firstresultstyle", results[0].style);
this.openedPopup.setAttribute("firstresultstyle", firstResultStyle);
this.openedPopup.hidden = false;
// don't allow the popup to become overly narrow
this.openedPopup.setAttribute("width", Math.max(100, rect.width));
@ -168,6 +169,12 @@ this.AutoCompletePopup = {
if (results.length) {
// Reset fields that were set from the last time the search popup was open
this.openedPopup.mInput = AutoCompleteResultView;
// Temporarily increase the maxRows as we don't want to show
// the scrollbar in form autofill popup.
if (firstResultStyle == "autofill-profile") {
this.openedPopup._normalMaxRows = this.openedPopup.maxRows;
this.openedPopup.mInput.maxRows = 100;
}
this.openedPopup.showCommentColumn = false;
this.openedPopup.showImageColumn = false;
this.openedPopup.addEventListener("popuphidden", this);