Bug 339661 Location bar dropdown does not disappear on second click r=mconnor

This commit is contained in:
masayuki%d-toybox.com 2006-05-31 17:55:19 +00:00
parent 86d9f381b7
commit 9ebd103ee6
4 changed files with 22 additions and 7 deletions

View File

@ -40,7 +40,7 @@
interface nsIAutoCompletePopup;
[scriptable, uuid(e312267f-8f57-43e8-a904-ff9b5d3f5aef)]
[scriptable, uuid(AC029254-06DD-4dff-878C-A292117DE2D3)]
interface nsIAutoCompleteInput : nsISupports
{
/*
@ -156,4 +156,10 @@ interface nsIAutoCompleteInput : nsISupports
* @return True if the user wishes to prevent the revert
*/
boolean onTextReverted();
/*
* This popup should consume or dispatch the rollup event.
* TRUE: should consume; FALSE: should dispatch.
*/
readonly attribute boolean consumeRollupEvent;
};

View File

@ -592,8 +592,11 @@ nsAutoCompleteController::AttachRollupListener()
{
nsIWidget* widget = GetPopupWidget();
NS_ENSURE_TRUE(widget, NS_ERROR_FAILURE);
NS_ASSERTION(mInput, "mInput must not be null.");
PRBool consumeRollupEvent = PR_FALSE;
mInput->GetConsumeRollupEvent(&consumeRollupEvent);
return widget->CaptureRollupEvents((nsIRollupListener*)this,
PR_TRUE, PR_FALSE);
PR_TRUE, consumeRollupEvent);
}
NS_IMETHODIMP

View File

@ -456,6 +456,13 @@ nsFormFillController::OnTextReverted(PRBool *_retval)
return NS_OK;
}
NS_IMETHODIMP
nsFormFillController::GetConsumeRollupEvent(PRBool *aConsumeRollupEvent)
{
*aConsumeRollupEvent = PR_FALSE;
return NS_OK;
}
////////////////////////////////////////////////////////////////////////
//// nsIAutoCompleteSearch

View File

@ -164,7 +164,10 @@
<property name="searchCount" readonly="true"
onget="this.initSearchNames(); return this.mSearchNames.length;"/>
<property name="consumeRollupEvent" readonly="true"
onget="return true;"/>
<method name="getSearchAt">
<parameter name="aIndex"/>
<body><![CDATA[
@ -334,10 +337,6 @@
<method name="showHistoryPopup">
<body><![CDATA[
// This is an autocomplete widget, but we want the rollup event
// to be consumed, as if we were a menulist.
this.popup.popupBoxObject.setConsumeRollupEvent(Components.interfaces.nsIPopupBoxObject.ROLLUP_CONSUME);
this.maxRows = 14;
// Eusure this having focus.
if (!this.focused)