diff --git a/toolkit/components/autocomplete/public/nsIAutoCompleteInput.idl b/toolkit/components/autocomplete/public/nsIAutoCompleteInput.idl index 93e690e8280..7307cf592dd 100644 --- a/toolkit/components/autocomplete/public/nsIAutoCompleteInput.idl +++ b/toolkit/components/autocomplete/public/nsIAutoCompleteInput.idl @@ -81,6 +81,11 @@ interface nsIAutoCompleteInput : nsISupports */ attribute unsigned long minResultsForPopup; + /* + * The maximum number of rows to show in the autocomplete popup. + */ + attribute unsigned long maxRows; + /* * Option to show a second column in the popup which contains * the comment for each autocomplete result diff --git a/toolkit/components/satchel/src/nsFormFillController.cpp b/toolkit/components/satchel/src/nsFormFillController.cpp index 47139beb8e7..f33cb7fca1d 100644 --- a/toolkit/components/satchel/src/nsFormFillController.cpp +++ b/toolkit/components/satchel/src/nsFormFillController.cpp @@ -78,6 +78,7 @@ NS_IMPL_RELEASE(nsFormFillController); nsFormFillController::nsFormFillController() : mTimeout(50), mMinResultsForPopup(1), + mMaxRows(0), mDisableAutoComplete(PR_FALSE), mCompleteDefaultIndex(PR_FALSE), mForceComplete(PR_FALSE) @@ -290,6 +291,20 @@ NS_IMETHODIMP nsFormFillController::SetMinResultsForPopup(PRUint32 aMinResultsFo return NS_OK; } +NS_IMETHODIMP +nsFormFillController::GetMaxRows(PRUint32 *aMaxRows) +{ + *aMaxRows = mMaxRows; + return NS_OK; +} + +NS_IMETHODIMP +nsFormFillController::SetMaxRows(PRUint32 aMaxRows) +{ + mMaxRows = aMaxRows; + return NS_OK; +} + NS_IMETHODIMP nsFormFillController::GetShowCommentColumn(PRUint32 *aShowCommentColumn) { diff --git a/toolkit/components/satchel/src/nsFormFillController.h b/toolkit/components/satchel/src/nsFormFillController.h index 505c424add9..033fa3e358c 100644 --- a/toolkit/components/satchel/src/nsFormFillController.h +++ b/toolkit/components/satchel/src/nsFormFillController.h @@ -106,6 +106,7 @@ protected: PRUint32 mTimeout; PRUint32 mMinResultsForPopup; + PRUint32 mMaxRows; PRPackedBool mDisableAutoComplete; PRPackedBool mCompleteDefaultIndex; PRPackedBool mForceComplete; diff --git a/toolkit/content/widgets/autocomplete.xml b/toolkit/content/widgets/autocomplete.xml index ec8290c9a77..5362048f0d7 100644 --- a/toolkit/content/widgets/autocomplete.xml +++ b/toolkit/content/widgets/autocomplete.xml @@ -102,7 +102,7 @@ + onget="return parseInt(this.getAttribute('minresultsforpopup')) || 0;"/> + onget="return parseInt(this.getAttribute('timeout')) || 50;"/> + onget="return parseInt(this.getAttribute('maxrows')) || 0;"/> @@ -504,8 +504,11 @@ ]]> - + + +