зеркало из https://github.com/mozilla/pjs.git
Bug 252955. List items returning strange accessible states. r=pkw, sr=darin
This commit is contained in:
Родитель
09cfab5872
Коммит
d3f7dc89f5
|
@ -289,7 +289,7 @@ void nsRootAccessible::FireAccessibleFocusEvent(nsIAccessible *focusAccessible,
|
|||
gLastFocusedNode = nsnull;
|
||||
PRUint32 role = ROLE_NOTHING;
|
||||
focusAccessible->GetRole(&role);
|
||||
if (role != ROLE_MENUITEM && role != ROLE_LISTITEM) {
|
||||
if (role != ROLE_MENUITEM) {
|
||||
// It must report all focus events on menu and list items
|
||||
gLastFocusedNode = focusNode;
|
||||
NS_ADDREF(gLastFocusedNode);
|
||||
|
|
|
@ -453,13 +453,12 @@ NS_IMETHODIMP nsXULListitemAccessible::GetRole(PRUint32 *_retval)
|
|||
*/
|
||||
NS_IMETHODIMP nsXULListitemAccessible::GetState(PRUint32 *_retval)
|
||||
{
|
||||
// nsAccessible::GetState(_retval); // get focused state
|
||||
|
||||
if (mIsCheckbox) {
|
||||
nsXULMenuitemAccessible::GetState(_retval);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
*_retval = STATE_FOCUSABLE | STATE_SELECTABLE;
|
||||
nsCOMPtr<nsIDOMXULSelectControlItemElement> listItem (do_QueryInterface(mDOMNode));
|
||||
if (listItem) {
|
||||
PRBool isSelected;
|
||||
|
@ -467,21 +466,11 @@ NS_IMETHODIMP nsXULListitemAccessible::GetState(PRUint32 *_retval)
|
|||
if (isSelected)
|
||||
*_retval |= STATE_SELECTED;
|
||||
|
||||
nsCOMPtr<nsIDOMNode> domParent;
|
||||
mDOMNode->GetParentNode(getter_AddRefs(domParent));
|
||||
nsCOMPtr<nsIDOMXULMultiSelectControlElement> parent(do_QueryInterface(domParent));
|
||||
if (parent) {
|
||||
nsCOMPtr<nsIDOMXULSelectControlItemElement> current;
|
||||
parent->GetCurrentItem(getter_AddRefs(current));
|
||||
if (listItem == current)
|
||||
if (gLastFocusedNode == mDOMNode) {
|
||||
*_retval |= STATE_FOCUSED;
|
||||
}
|
||||
|
||||
*_retval |= STATE_FOCUSABLE | STATE_SELECTABLE;
|
||||
|
||||
}
|
||||
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче