Bug 388185 LABELLED_BY, LABEL_FOR relations shoudl be set for labels in panels

r=aaronleventhal,mano a=dsicore
This commit is contained in:
ginn.chen%sun.com 2007-09-29 07:04:27 +00:00
Родитель 8ecc99a272
Коммит 01814e4e85
4 изменённых файлов: 33 добавлений и 9 удалений

Просмотреть файл

@ -91,6 +91,7 @@ ACCESSIBILITY_ATOM(area, "area")
ACCESSIBILITY_ATOM(blockquote, "blockquote")
ACCESSIBILITY_ATOM(br, "br")
ACCESSIBILITY_ATOM(body, "body")
ACCESSIBILITY_ATOM(caption, "caption") // XUL
ACCESSIBILITY_ATOM(choices, "choices") // XForms
ACCESSIBILITY_ATOM(description, "description") // XUL
ACCESSIBILITY_ATOM(dd, "dd")

Просмотреть файл

@ -82,6 +82,36 @@ nsXULTextAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
return NS_OK;
}
NS_IMETHODIMP
nsXULTextAccessible::GetAccessibleRelated(PRUint32 aRelationType,
nsIAccessible **aRelated)
{
nsresult rv =
nsHyperTextAccessibleWrap::GetAccessibleRelated(aRelationType, aRelated);
NS_ENSURE_SUCCESS(rv, rv);
if (*aRelated) {
return NS_OK;
}
nsIContent *content = GetRoleContent(mDOMNode);
if (!content)
return NS_ERROR_FAILURE;
if (aRelationType == nsIAccessibleRelation::RELATION_LABEL_FOR) {
// Caption is the label for groupbox
nsIContent *parent = content->GetParent();
if (parent && parent->Tag() == nsAccessibilityAtoms::caption) {
nsCOMPtr<nsIAccessible> parentAccessible;
GetParent(getter_AddRefs(parentAccessible));
if (Role(parentAccessible) == nsIAccessibleRole::ROLE_GROUPING) {
parentAccessible.swap(*aRelated);
}
}
}
return NS_OK;
}
/**
* For XUL tooltip
*/

Просмотреть файл

@ -54,6 +54,8 @@ public:
NS_IMETHOD GetName(nsAString& _retval);
NS_IMETHOD GetState(PRUint32 *aState, PRUint32 *aExtraState);
NS_IMETHOD GetRole(PRUint32 *aRole) { *aRole = nsIAccessibleRole::ROLE_LABEL; return NS_OK; }
NS_IMETHOD GetAccessibleRelated(PRUint32 aRelationType,
nsIAccessible **aRelated);
};
class nsXULTooltipAccessible : public nsLeafAccessible

Просмотреть файл

@ -44,15 +44,6 @@
xbl:inherits="default,value=label,crop,accesskey"/>
</children>
</content>
<implementation>
<constructor>
if (this.parentNode.id) {
document.getAnonymousNodes(this)[1]
.setAttribute("control", this.parentNode.id);
}
</constructor>
</implementation>
</binding>
</bindings>