From 329b31b121ce5f0d9c0c05854d380e2dc78a74d5 Mon Sep 17 00:00:00 2001 From: "ginn.chen%sun.com" Date: Wed, 16 May 2007 08:21:12 +0000 Subject: [PATCH] Bug 380706 Labels will not be reported while browsing the list item with arrow keys. r=surkov.alexander --- accessible/src/base/nsRootAccessible.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/accessible/src/base/nsRootAccessible.cpp b/accessible/src/base/nsRootAccessible.cpp index 0ed67042b5d..ec12acbcba4 100644 --- a/accessible/src/base/nsRootAccessible.cpp +++ b/accessible/src/base/nsRootAccessible.cpp @@ -650,7 +650,13 @@ nsresult nsRootAccessible::HandleEventWithTarget(nsIDOMEvent* aEvent, if (eventType.EqualsLiteral("RadioStateChange")) { PRUint32 state = State(accessible); - PRBool isEnabled = state & nsIAccessibleStates::STATE_CHECKED; + + // radiogroup in prefWindow is exposed as a list, + // and panebutton is exposed as XULListitem in A11y. + // nsXULListitemAccessible::GetState uses STATE_SELECTED in this case, + // so we need to check nsIAccessibleStates::STATE_SELECTED also. + PRBool isEnabled = (state & (nsIAccessibleStates::STATE_CHECKED | + nsIAccessibleStates::STATE_SELECTED)) != 0; nsCOMPtr accEvent = new nsAccStateChangeEvent(accessible, nsIAccessibleStates::STATE_CHECKED, @@ -666,10 +672,7 @@ nsresult nsRootAccessible::HandleEventWithTarget(nsIDOMEvent* aEvent, if (eventType.EqualsLiteral("CheckboxStateChange")) { PRUint32 state = State(accessible); - // prefPane tab is implemented as list items in A11y, so we need to - // check nsIAccessibleStates::STATE_SELECTED also. - PRBool isEnabled = (state & (nsIAccessibleStates::STATE_CHECKED | - nsIAccessibleStates::STATE_SELECTED)) != 0; + PRBool isEnabled = state & nsIAccessibleStates::STATE_CHECKED; nsCOMPtr accEvent = new nsAccStateChangeEvent(accessible,