Bug 1975696 - Revert suppression of AXTitle introduced in bug 1901324. r=Jamie a=RyanVM
Original Revision: https://phabricator.services.mozilla.com/D261165 Differential Revision: https://phabricator.services.mozilla.com/D261203
This commit is contained in:
committed by
rvandermeulen@mozilla.com
parent
7c81a53f68
commit
a5ebf1856c
@@ -496,9 +496,8 @@ struct RoleDescrComparator {
|
||||
}
|
||||
|
||||
if (![self providesLabelNotTitle]) {
|
||||
Relation rel = mGeckoAccessible->RelationByType(RelationType::LABELLED_BY);
|
||||
if (rel.Next() && !rel.Next()) {
|
||||
// A single label relation.
|
||||
NSArray* relations = [self getRelationsByType:RelationType::LABELLED_BY];
|
||||
if ([relations count] == 1) {
|
||||
return nil;
|
||||
}
|
||||
}
|
||||
@@ -514,12 +513,6 @@ struct RoleDescrComparator {
|
||||
return nil;
|
||||
}
|
||||
|
||||
Relation rel = mGeckoAccessible->RelationByType(RelationType::LABELLED_BY);
|
||||
if (rel.Next() && !rel.Next()) {
|
||||
// A single label relation. Use AXUITitleElement instead of AXTitle
|
||||
return nil;
|
||||
}
|
||||
|
||||
nsAutoString title;
|
||||
mGeckoAccessible->Name(title);
|
||||
if (nsCoreUtils::IsWhitespaceString(title)) {
|
||||
|
||||
@@ -18,16 +18,9 @@ function getChildRoles(parent) {
|
||||
}
|
||||
|
||||
function getLinkedTitles(element) {
|
||||
return element.getAttributeValue("AXLinkedUIElements").map(linkedElem => {
|
||||
let labelElem = linkedElem.getAttributeValue("AXTitleUIElement");
|
||||
let labelText = labelElem
|
||||
? labelElem
|
||||
.getAttributeValue("AXChildren")
|
||||
.map(c => c.getAttributeValue("AXValue"))
|
||||
.join("")
|
||||
: null;
|
||||
return labelText ? labelText : linkedElem.getAttributeValue("AXTitle");
|
||||
});
|
||||
return element
|
||||
.getAttributeValue("AXLinkedUIElements")
|
||||
.map(c => c.getAttributeValue("AXTitle"));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -159,6 +152,12 @@ addAccessibleTask(
|
||||
let catdog = getNativeInterface(accDoc, "catdog");
|
||||
let titleList = ["Cat", "Dog", "CatDog"];
|
||||
|
||||
Assert.deepEqual(
|
||||
titleList,
|
||||
[cat, dog, catdog].map(x => x.getAttributeValue("AXTitle")),
|
||||
"Title list matches"
|
||||
);
|
||||
|
||||
let linkedElems = cat.getAttributeValue("AXLinkedUIElements");
|
||||
is(linkedElems.length, 3, "Cat has three linked UI elems");
|
||||
Assert.deepEqual(
|
||||
@@ -237,6 +236,12 @@ addAccessibleTask(
|
||||
let catdog = getNativeInterface(accDoc, "catdog");
|
||||
let titleList = ["Cat", "Dog", "CatDog"];
|
||||
|
||||
Assert.deepEqual(
|
||||
titleList,
|
||||
[cat, dog, catdog].map(x => x.getAttributeValue("AXTitle")),
|
||||
"Title list matches"
|
||||
);
|
||||
|
||||
let linkedElems = cat.getAttributeValue("AXLinkedUIElements");
|
||||
is(linkedElems.length, 3, "Cat has three linked UI elems");
|
||||
Assert.deepEqual(
|
||||
|
||||
Reference in New Issue
Block a user