Bug 1639623 - Support AXPress on radio buttons and remove action description. r=morgan

Differential Revision: https://phabricator.services.mozilla.com/D76175
This commit is contained in:
Eitan Isaacson 2020-05-20 23:48:30 +00:00
Родитель 0d5684a3a8
Коммит 1a6f602dff
3 изменённых файлов: 5 добавлений и 27 удалений

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

@ -602,18 +602,10 @@ static const uint64_t kCacheInitialized = ((uint64_t)0x1) << 63;
// Check if the accessible has an existing gecko
// action, and add the corresponding Mac action to
// the actions array. `count` is guaranteed to be 0 or 1
// If an action exists, add a "AXPress" action
// to our native object.
if (count) {
nsAutoString name;
if (accWrap) {
accWrap->ActionNameAt(0, name);
} else if (proxy) {
proxy->ActionNameAt(0, name);
}
if (name.EqualsLiteral("select")) {
[actions addObject:NSAccessibilityPickAction];
} else {
[actions addObject:NSAccessibilityPressAction];
}
[actions addObject:NSAccessibilityPressAction];
}
// Regardless of `count`, add actions that should be

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

@ -157,20 +157,6 @@ enum CheckboxValue {
@implementation mozCheckboxAccessible
- (NSString*)accessibilityActionDescription:(NSString*)action {
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
if ([action isEqualToString:NSAccessibilityPressAction]) {
if ([self isChecked] != kUnchecked) return @"uncheck checkbox"; // XXX: localize this later?
return @"check checkbox"; // XXX: localize this later?
}
return nil;
NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
}
- (int)isChecked {
// check if we're checked or in a mixed state
uint64_t state = [self stateWithMask:(states::CHECKED | states::PRESSED | states::MIXED)];

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

@ -110,10 +110,10 @@ addAccessibleTask(
);
let actions = dewey.actionNames;
ok(actions.includes("AXPick"), "Has pick action");
ok(actions.includes("AXPress"), "Has press action");
let stateChanged = waitForEvent(EVENT_STATE_CHANGE, "huey");
dewey.performAction("AXPick");
dewey.performAction("AXPress");
await stateChanged;
is(
dewey.getAttributeValue("AXValue"),