Bug 129606 - Active accessibility: support STATE_DEFAULT. r=jgaunt. sr=alecf. a=asa. Bug 124450 (reopened) - Active Accessibility: support fieldset and legend. r=jgaunt. sr=hewitt. a=asa

git-svn-id: svn://10.0.0.236/trunk@116289 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
aaronl%netscape.com
2002-03-10 05:14:24 +00:00
parent 151899ce0c
commit e88ecf17aa
6 changed files with 40 additions and 8 deletions

View File

@@ -187,6 +187,20 @@ NS_IMETHODIMP nsHTMLButtonAccessible::AccDoAction(PRUint8 index)
return NS_ERROR_INVALID_ARG;
}
NS_IMETHODIMP nsHTMLButtonAccessible::GetAccState(PRUint32 *_retval)
{
nsFormControlAccessible::GetAccState(_retval);
nsCOMPtr<nsIDOMElement> element(do_QueryInterface(mDOMNode));
NS_ASSERTION(element, "No nsIDOMElement for button node!");
nsAutoString buttonType;
element->GetAttribute(NS_LITERAL_STRING("type"), buttonType);
if (buttonType.EqualsIgnoreCase("submit"))
*_retval |= STATE_DEFAULT;
return NS_OK;
}
NS_IMETHODIMP nsHTMLButtonAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_PUSHBUTTON;
@@ -255,6 +269,15 @@ NS_IMETHODIMP nsHTML4ButtonAccessible::GetAccState(PRUint32 *_retval)
{
nsAccessible::GetAccState(_retval);
*_retval |= STATE_FOCUSABLE;
nsCOMPtr<nsIDOMElement> element(do_QueryInterface(mDOMNode));
NS_ASSERTION(element, "No nsIDOMElement for button node!");
nsAutoString buttonType;
element->GetAttribute(NS_LITERAL_STRING("type"), buttonType);
if (buttonType.EqualsIgnoreCase("submit"))
*_retval |= STATE_DEFAULT;
return NS_OK;
}
@@ -402,8 +425,6 @@ NS_IMETHODIMP nsHTMLGroupboxAccessible::GetAccState(PRUint32 *_retval)
NS_IMETHODIMP nsHTMLGroupboxAccessible::GetAccName(nsAWritableString& _retval)
{
_retval.Assign(NS_LITERAL_STRING("")); // Default name is blank
nsCOMPtr<nsIDOMElement> element(do_QueryInterface(mDOMNode));
if (element) {
nsCOMPtr<nsIDOMNodeList> legends;
@@ -412,7 +433,10 @@ NS_IMETHODIMP nsHTMLGroupboxAccessible::GetAccName(nsAWritableString& _retval)
nsCOMPtr<nsIDOMNode> legendNode;
legends->Item(0, getter_AddRefs(legendNode));
nsCOMPtr<nsIContent> legendContent(do_QueryInterface(legendNode));
return AppendFlatStringFromSubtree(legendContent, &_retval);
if (legendContent) {
_retval.Assign(NS_LITERAL_STRING("")); // Default name is blank
return AppendFlatStringFromSubtree(legendContent, &_retval);
}
}
}
return NS_OK;