diff --git a/accessible/src/base/nsRootAccessible.cpp b/accessible/src/base/nsRootAccessible.cpp index 07d6d4a17be..bc3515cdbf9 100644 --- a/accessible/src/base/nsRootAccessible.cpp +++ b/accessible/src/base/nsRootAccessible.cpp @@ -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); diff --git a/accessible/src/xul/nsXULSelectAccessible.cpp b/accessible/src/xul/nsXULSelectAccessible.cpp index ea47d261ac1..f64fb45a3c6 100644 --- a/accessible/src/xul/nsXULSelectAccessible.cpp +++ b/accessible/src/xul/nsXULSelectAccessible.cpp @@ -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 listItem (do_QueryInterface(mDOMNode)); if (listItem) { PRBool isSelected; @@ -467,21 +466,11 @@ NS_IMETHODIMP nsXULListitemAccessible::GetState(PRUint32 *_retval) if (isSelected) *_retval |= STATE_SELECTED; - nsCOMPtr domParent; - mDOMNode->GetParentNode(getter_AddRefs(domParent)); - nsCOMPtr parent(do_QueryInterface(domParent)); - if (parent) { - nsCOMPtr current; - parent->GetCurrentItem(getter_AddRefs(current)); - if (listItem == current) - *_retval |= STATE_FOCUSED; + if (gLastFocusedNode == mDOMNode) { + *_retval |= STATE_FOCUSED; } - - *_retval |= STATE_FOCUSABLE | STATE_SELECTABLE; - } - return NS_OK; }