зеркало из https://github.com/mozilla/gecko-dev.git
bug278036 nsXULTextField should have "activate" action
r = pkwarren sr = Henry.Jia
This commit is contained in:
Родитель
531fe3b634
Коммит
ebf0088df4
|
@ -666,4 +666,40 @@ NS_IMETHODIMP nsXULTextFieldAccessible::GetState(PRUint32 *aState)
|
|||
return rv;
|
||||
}
|
||||
|
||||
/**
|
||||
* Only one actions available
|
||||
*/
|
||||
NS_IMETHODIMP nsXULTextFieldAccessible::GetNumActions(PRUint8 *_retval)
|
||||
{
|
||||
*_retval = eSingle_Action;
|
||||
return NS_OK;;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the name of our only action
|
||||
*/
|
||||
NS_IMETHODIMP nsXULTextFieldAccessible::GetActionName(PRUint8 index, nsAString& _retval)
|
||||
{
|
||||
if (index == eAction_Click) {
|
||||
nsAccessible::GetTranslatedString(NS_LITERAL_STRING("activate"), _retval);
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tell the button to do it's action
|
||||
*/
|
||||
NS_IMETHODIMP nsXULTextFieldAccessible::DoAction(PRUint8 index)
|
||||
{
|
||||
if (index == 0) {
|
||||
nsCOMPtr<nsIDOMXULElement> element(do_QueryInterface(mDOMNode));
|
||||
if (element)
|
||||
{
|
||||
element->Focus();
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
|
|
@ -155,6 +155,9 @@ public:
|
|||
NS_IMETHOD GetState(PRUint32 *aState);
|
||||
NS_IMETHOD GetExtState(PRUint32 *aExtState);
|
||||
NS_IMETHOD GetRole(PRUint32 *aRole) { *aRole = ROLE_TEXT; return NS_OK; }
|
||||
NS_IMETHOD GetNumActions(PRUint8 *_retval);
|
||||
NS_IMETHOD GetActionName(PRUint8 index, nsAString& _retval);
|
||||
NS_IMETHOD DoAction(PRUint8 index);
|
||||
};
|
||||
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче