зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 54aff812a50b (bug 1650462) as requested by jya.
This commit is contained in:
Родитель
f1e4e6aed0
Коммит
7c20974c02
|
@ -193,7 +193,10 @@ nsresult nsTextEquivUtils::AppendFromAccessible(Accessible* aAccessible,
|
|||
// into subtree if accessible allows "text equivalent from subtree rule" or
|
||||
// it's not root and not control.
|
||||
if (isEmptyTextEquiv) {
|
||||
if (ShouldIncludeInSubtreeCalculation(aAccessible)) {
|
||||
uint32_t nameRule = GetRoleRule(aAccessible->Role());
|
||||
if (nameRule == eNameFromSubtreeRule ||
|
||||
(nameRule & eNameFromSubtreeIfReqRule &&
|
||||
aAccessible != sInitiatorAcc)) {
|
||||
rv = AppendFromAccessibleChildren(aAccessible, aString);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
|
@ -323,31 +326,3 @@ uint32_t nsTextEquivUtils::GetRoleRule(role aRole) {
|
|||
|
||||
#undef ROLE
|
||||
}
|
||||
|
||||
bool nsTextEquivUtils::ShouldIncludeInSubtreeCalculation(
|
||||
Accessible* aAccessible) {
|
||||
uint32_t nameRule = GetRoleRule(aAccessible->Role());
|
||||
if (nameRule == eNameFromSubtreeRule) {
|
||||
return true;
|
||||
}
|
||||
if (!(nameRule & eNameFromSubtreeIfReqRule)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (aAccessible == sInitiatorAcc) {
|
||||
// We're calculating the text equivalent for this accessible, but this
|
||||
// accessible should only be included when calculating the text equivalent
|
||||
// for something else.
|
||||
return false;
|
||||
}
|
||||
|
||||
role initiatorRole = sInitiatorAcc->Role();
|
||||
if (initiatorRole == roles::OUTLINEITEM &&
|
||||
aAccessible->Role() == roles::GROUPING) {
|
||||
// Child treeitems are contained in a group. We don't want to include those
|
||||
// in the parent treeitem's text equivalent.
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -153,12 +153,6 @@ class nsTextEquivUtils {
|
|||
* Returns the rule (constant of ETextEquivRule) for a given role.
|
||||
*/
|
||||
static uint32_t GetRoleRule(mozilla::a11y::roles::Role aRole);
|
||||
|
||||
/**
|
||||
* Returns true if a given accessible should be included when calculating
|
||||
* the text equivalent for the initiator's subtree.
|
||||
*/
|
||||
static bool ShouldIncludeInSubtreeCalculation(Accessible* aAccessible);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -243,9 +243,6 @@
|
|||
testName("grouping", null);
|
||||
testName("requested_name_from_grouping", "label");
|
||||
testName("listitem_containing_block_tbody", "label");
|
||||
// Groupings shouldn't be included when calculating from the subtree of
|
||||
// a treeitem.
|
||||
testName("treeitem_containing_grouping", "root");
|
||||
|
||||
// Name from subtree of grouping labelled by an ancestor.
|
||||
testName("grouping_labelledby_ancestor", "label");
|
||||
|
@ -689,12 +686,6 @@
|
|||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- Name from subtree of treeitem containing grouping -->
|
||||
<div id="treeitem_containing_grouping" role="treeitem" aria-level="1" aria-expanded="true">root
|
||||
<div role="group">
|
||||
<div role="treeitem" aria-level="2">sub</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Name from subtree of grouping labelled by an ancestor. -->
|
||||
<div id="grouping_ancestor_label">label
|
||||
|
|
Загрузка…
Ссылка в новой задаче