Bug 336292. ROLE_AUTOCOMPLETE not exposed for URL bar. r=parente, sr=neil

This commit is contained in:
aaronleventhal%moonset.net 2006-05-03 13:36:46 +00:00
parent 9bfd13e9f1
commit 03b6aab7ad

View File

@ -48,6 +48,7 @@
#include "nsIDOMXULTextboxElement.h"
#include "nsIPresShell.h"
#include "nsIServiceManager.h"
#include "nsCaseTreatment.h"
/**
* Selects, Listboxes and Comboboxes, are made up of a number of different
@ -519,10 +520,13 @@ nsXULSelectableAccessible(aDOMNode, aShell)
/** We are a combobox */
NS_IMETHODIMP nsXULComboboxAccessible::GetRole(PRUint32 *aRole)
{
nsAutoString boxName;
mDOMNode->GetNodeName(boxName);
*aRole = boxName.EqualsLiteral("autocomplete") ?
ROLE_AUTOCOMPLETE : ROLE_COMBOBOX;
nsCOMPtr<nsIContent> content = do_QueryInterface(mDOMNode);
if (!content) {
return NS_ERROR_FAILURE;
}
*aRole = content->AttrValueIs(kNameSpaceID_None, nsAccessibilityAtoms::type,
NS_LITERAL_STRING("autocomplete"), eIgnoreCase) ?
ROLE_AUTOCOMPLETE : ROLE_COMBOBOX;
return NS_OK;
}