Bug 808596 - Introduce key role. r=surkov

This commit is contained in:
Eitan Isaacson 2013-04-29 14:07:39 -07:00
parent 34ddc52c77
commit 4f54ad6ad9
4 changed files with 30 additions and 2 deletions

View File

@ -773,5 +773,9 @@ interface nsIAccessibleRole : nsISupports
* An HTML definition <dd>
*/
const unsigned long ROLE_DEFINITION = 128;
};
/**
* A keyboard or keypad key.
*/
const unsigned long ROLE_KEY = 129;
};

View File

@ -222,6 +222,17 @@ static nsRoleMapEntry sWAIRoleMaps[] =
kGenericAccType,
kNoReqStates
},
{ // key
&nsGkAtoms::key,
roles::KEY,
kUseMapRole,
eNoValue,
ePressAction,
eNoLiveAttr,
kGenericAccType,
kNoReqStates,
eARIAPressed
},
{ // link
&nsGkAtoms::link,
roles::LINK,

View File

@ -778,7 +778,12 @@ enum Role {
/**
* Represent a definition in a definition list (dd in HTML)
*/
DEFINITION = 128
DEFINITION = 128,
/**
* Represent a keyboard or keypad key (ARIA role "key").
*/
KEY = 129
};
} // namespace role

View File

@ -1047,3 +1047,11 @@ ROLE(DEFINITION,
USE_ROLE_STRING,
IA2_ROLE_PARAGRAPH,
eNameFromSubtreeRule)
ROLE(KEY,
"key",
ATK_ROLE_PUSH_BUTTON,
NSAccessibilityButtonRole,
ROLE_SYSTEM_PUSHBUTTON,
ROLE_SYSTEM_PUSHBUTTON,
eNameFromSubtreeRule)