зеркало из https://github.com/mozilla/pjs.git
Bug 388185 LABELLED_BY, LABEL_FOR relations shoudl be set for labels in panels
r=aaronleventhal,mano a=dsicore
This commit is contained in:
Родитель
8ecc99a272
Коммит
01814e4e85
|
@ -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>
|
||||
|
|
Загрузка…
Ссылка в новой задаче