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
Родитель 721dbc9472
Коммит 6161bc1ada
3 изменённых файлов: 14 добавлений и 1 удалений

Просмотреть файл

@ -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();

Просмотреть файл

@ -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];

Просмотреть файл

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