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

git-svn-id: svn://10.0.0.236/branches/MOZILLA_1_8_BRANCH@198780 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
masayuki%d-toybox.com
2006-05-31 23:29:19 +00:00
parent c1f42fadf1
commit cd9ad19a32
5 changed files with 37 additions and 4 deletions

View File

@@ -157,3 +157,13 @@ interface nsIAutoCompleteInput : nsISupports
*/
boolean onTextReverted();
};
[scriptable, uuid(CCD37136-76E8-47a7-B46C-B8FEE8EB0536)]
interface nsIAutoCompleteInput_MOZILLA_1_8_BRANCH : nsIAutoCompleteInput
{
/*
* This popup should consume or dispatch the rollup event.
* TRUE: should consume; FALSE: should dispatch.
*/
readonly attribute boolean consumeRollupEvent;
};

View File

@@ -589,8 +589,14 @@ nsAutoCompleteController::AttachRollupListener()
{
nsIWidget* widget = GetPopupWidget();
NS_ENSURE_TRUE(widget, NS_ERROR_FAILURE);
NS_ASSERTION(mInput, "mInput must not be null.");
PRBool consumeRollupEvent = PR_FALSE;
nsCOMPtr<nsIAutoCompleteInput_MOZILLA_1_8_BRANCH> input =
do_QueryInterface(mInput);
NS_ASSERTION(input, "mInput must have nsIAutoCompleteInput_MOZILLA_1_8_BRANCH interface.");
input->GetConsumeRollupEvent(&consumeRollupEvent);
return widget->CaptureRollupEvents((nsIRollupListener*)this,
PR_TRUE, PR_FALSE);
PR_TRUE, consumeRollupEvent);
}
NS_IMETHODIMP

View File

@@ -80,6 +80,7 @@
NS_INTERFACE_MAP_BEGIN(nsFormFillController)
NS_INTERFACE_MAP_ENTRY(nsIFormFillController)
NS_INTERFACE_MAP_ENTRY(nsIAutoCompleteInput)
NS_INTERFACE_MAP_ENTRY(nsIAutoCompleteInput_MOZILLA_1_8_BRANCH)
NS_INTERFACE_MAP_ENTRY(nsIAutoCompleteSearch)
NS_INTERFACE_MAP_ENTRY(nsIDOMFocusListener)
NS_INTERFACE_MAP_ENTRY(nsIDOMKeyListener)
@@ -482,6 +483,16 @@ nsFormFillController::OnTextReverted(PRBool *_retval)
return NS_OK;
}
////////////////////////////////////////////////////////////////////////
//// nsIAutoCompleteInput_MOZILLA_1_8_BRANCH
NS_IMETHODIMP
nsFormFillController::GetConsumeRollupEvent(PRBool *aConsumeRollupEvent)
{
*aConsumeRollupEvent = PR_FALSE;
return NS_OK;
}
////////////////////////////////////////////////////////////////////////
//// nsIAutoCompleteSearch

View File

@@ -60,7 +60,7 @@
class nsFormHistory;
class nsFormFillController : public nsIFormFillController,
public nsIAutoCompleteInput,
public nsIAutoCompleteInput_MOZILLA_1_8_BRANCH,
public nsIAutoCompleteSearch,
public nsIDOMFocusListener,
public nsIDOMKeyListener,
@@ -74,6 +74,7 @@ public:
NS_DECL_NSIFORMFILLCONTROLLER
NS_DECL_NSIAUTOCOMPLETESEARCH
NS_DECL_NSIAUTOCOMPLETEINPUT
NS_DECL_NSIAUTOCOMPLETEINPUT_MOZILLA_1_8_BRANCH
NS_DECL_NSIDOMEVENTLISTENER
// nsIDOMFocusListener

View File

@@ -74,7 +74,9 @@
<xul:popupset anonid="popupset" class="autocomplete-result-popupset"/>
</content>
<implementation implements="nsIAccessibleProvider, nsIAutoCompleteInput, nsIDOMXULMenuListElement">
<implementation implements="nsIAccessibleProvider,
nsIAutoCompleteInput_MOZILLA_1_8_BRANCH,
nsIDOMXULMenuListElement">
<field name="mController">null</field>
<field name="mSearchNames">null</field>
<field name="mIgnoreInput">false</field>
@@ -164,7 +166,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[