Bug 96065. Active Accessibility text nodes should not be focusable. r=jgaunt, sr=brendan\

This commit is contained in:
aaronl%netscape.com 2001-08-21 00:47:07 +00:00
parent 4e3dd44ec7
commit ac2ec34b5d
4 changed files with 22 additions and 14 deletions

View File

@ -612,11 +612,15 @@ NS_IMETHODIMP nsAccessible::GetAccState(PRUint32 *aAccState)
nsresult rv = NS_OK;
*aAccState = 0;
if (NS_SUCCEEDED(rv) && mFocusController) {
nsCOMPtr<nsIDOMElement> focusedElement, currElement(do_QueryInterface(mDOMNode));
mFocusController->GetFocusedElement(getter_AddRefs(focusedElement));
if (focusedElement == currElement)
*aAccState |= STATE_FOCUSED;
nsCOMPtr<nsIDOMElement> currElement(do_QueryInterface(mDOMNode));
if (currElement) {
*aAccState |= STATE_FOCUSABLE;
if (mFocusController) {
nsCOMPtr<nsIDOMElement> focusedElement;
rv = mFocusController->GetFocusedElement(getter_AddRefs(focusedElement));
if (NS_SUCCEEDED(rv) && focusedElement == currElement)
*aAccState |= STATE_FOCUSED;
}
}
return rv;
@ -1469,7 +1473,7 @@ NS_IMETHODIMP nsLinkableAccessible::GetAccState(PRUint32 *_retval)
nsAccessible::GetAccState(_retval);
*_retval |= STATE_READONLY | STATE_SELECTABLE;
if (IsALink()) {
*_retval |= STATE_FOCUSABLE | STATE_LINKED;
*_retval |= STATE_LINKED;
if (mIsLinkVisited)
*_retval |= STATE_TRAVERSED;
}

View File

@ -47,7 +47,7 @@ NS_IMETHODIMP nsHTMLTextAccessible::GetAccName(nsAWritableString& _retval)
/* unsigned long getAccRole (); */
NS_IMETHODIMP nsHTMLTextAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_STATICTEXT;
*_retval = ROLE_TEXT;
return NS_OK;
}

View File

@ -612,11 +612,15 @@ NS_IMETHODIMP nsAccessible::GetAccState(PRUint32 *aAccState)
nsresult rv = NS_OK;
*aAccState = 0;
if (NS_SUCCEEDED(rv) && mFocusController) {
nsCOMPtr<nsIDOMElement> focusedElement, currElement(do_QueryInterface(mDOMNode));
mFocusController->GetFocusedElement(getter_AddRefs(focusedElement));
if (focusedElement == currElement)
*aAccState |= STATE_FOCUSED;
nsCOMPtr<nsIDOMElement> currElement(do_QueryInterface(mDOMNode));
if (currElement) {
*aAccState |= STATE_FOCUSABLE;
if (mFocusController) {
nsCOMPtr<nsIDOMElement> focusedElement;
rv = mFocusController->GetFocusedElement(getter_AddRefs(focusedElement));
if (NS_SUCCEEDED(rv) && focusedElement == currElement)
*aAccState |= STATE_FOCUSED;
}
}
return rv;
@ -1469,7 +1473,7 @@ NS_IMETHODIMP nsLinkableAccessible::GetAccState(PRUint32 *_retval)
nsAccessible::GetAccState(_retval);
*_retval |= STATE_READONLY | STATE_SELECTABLE;
if (IsALink()) {
*_retval |= STATE_FOCUSABLE | STATE_LINKED;
*_retval |= STATE_LINKED;
if (mIsLinkVisited)
*_retval |= STATE_TRAVERSED;
}

View File

@ -47,7 +47,7 @@ NS_IMETHODIMP nsHTMLTextAccessible::GetAccName(nsAWritableString& _retval)
/* unsigned long getAccRole (); */
NS_IMETHODIMP nsHTMLTextAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_STATICTEXT;
*_retval = ROLE_TEXT;
return NS_OK;
}