зеркало из https://github.com/mozilla/pjs.git
Make all buttons (also those that are not by definition popupmenus) that have a menu expose the ShowMenu action (by making them mozPopupButtonAccessible instances under the hood). r=surkov, b=363082
This commit is contained in:
Родитель
721dbc9472
Коммит
6161bc1ada
|
@ -95,6 +95,12 @@ class nsAccessibleWrap : public nsAccessible
|
||||||
|
|
||||||
PRInt32 GetUnignoredChildCount(PRBool aDeepCount);
|
PRInt32 GetUnignoredChildCount(PRBool aDeepCount);
|
||||||
|
|
||||||
|
PRBool HasPopup () {
|
||||||
|
PRUint32 state = 0;
|
||||||
|
GetState(&state);
|
||||||
|
return (state & nsIAccessible::STATE_HASPOPUP);
|
||||||
|
}
|
||||||
|
|
||||||
// return this accessible's all children, adhering to "flat" accessibles by not returning their children.
|
// return this accessible's all children, adhering to "flat" accessibles by not returning their children.
|
||||||
void GetUnignoredChildren(nsTArray<nsRefPtr<nsAccessibleWrap> > &aChildrenArray);
|
void GetUnignoredChildren(nsTArray<nsRefPtr<nsAccessibleWrap> > &aChildrenArray);
|
||||||
virtual already_AddRefed<nsIAccessible> GetUnignoredParent();
|
virtual already_AddRefed<nsIAccessible> GetUnignoredParent();
|
||||||
|
|
|
@ -105,7 +105,14 @@ nsAccessibleWrap::GetNativeType ()
|
||||||
case ROLE_PUSHBUTTON:
|
case ROLE_PUSHBUTTON:
|
||||||
case ROLE_SPLITBUTTON:
|
case ROLE_SPLITBUTTON:
|
||||||
case ROLE_TOGGLE_BUTTON:
|
case ROLE_TOGGLE_BUTTON:
|
||||||
|
{
|
||||||
|
// if this button may show a popup, let's make it of the popupbutton type.
|
||||||
|
if (HasPopup())
|
||||||
|
return [mozPopupButtonAccessible class];
|
||||||
|
|
||||||
|
// regular button
|
||||||
return [mozButtonAccessible class];
|
return [mozButtonAccessible class];
|
||||||
|
}
|
||||||
|
|
||||||
case ROLE_CHECKBUTTON:
|
case ROLE_CHECKBUTTON:
|
||||||
return [mozCheckboxAccessible class];
|
return [mozCheckboxAccessible class];
|
||||||
|
|
|
@ -208,7 +208,7 @@ nsFormControlAccessible(aNode, aShell)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Only one actions available
|
* Only one action available
|
||||||
*/
|
*/
|
||||||
NS_IMETHODIMP nsXULDropmarkerAccessible::GetNumActions(PRUint8 *aResult)
|
NS_IMETHODIMP nsXULDropmarkerAccessible::GetNumActions(PRUint8 *aResult)
|
||||||
{
|
{
|
||||||
|
|
Загрузка…
Ссылка в новой задаче