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:
hwaara%gmail.com 2006-12-11 09:37:01 +00:00
parent d90417e60a
commit 4ed7e4f019
3 changed files with 14 additions and 1 deletions

View File

@ -95,6 +95,12 @@ class nsAccessibleWrap : public nsAccessible
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.
void GetUnignoredChildren(nsTArray<nsRefPtr<nsAccessibleWrap> > &aChildrenArray);
virtual already_AddRefed<nsIAccessible> GetUnignoredParent();

View File

@ -105,7 +105,14 @@ nsAccessibleWrap::GetNativeType ()
case ROLE_PUSHBUTTON:
case ROLE_SPLITBUTTON:
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];
}
case ROLE_CHECKBUTTON:
return [mozCheckboxAccessible class];

View File

@ -208,7 +208,7 @@ nsFormControlAccessible(aNode, aShell)
}
/**
* Only one actions available
* Only one action available
*/
NS_IMETHODIMP nsXULDropmarkerAccessible::GetNumActions(PRUint8 *aResult)
{