зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1687480 - Fire NSAccessibility notifications for expanding and collapsing rows, r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D102308
This commit is contained in:
Родитель
0b7a4682e5
Коммит
eede5be7ec
|
@ -159,4 +159,7 @@
|
|||
// override
|
||||
- (NSString*)moxLabel;
|
||||
|
||||
// override
|
||||
- (void)stateChanged:(uint64_t)state isEnabled:(BOOL)enabled;
|
||||
|
||||
@end
|
||||
|
|
|
@ -576,4 +576,16 @@ using namespace mozilla::a11y;
|
|||
return nsCocoaUtils::ToNSString(title);
|
||||
}
|
||||
|
||||
- (void)stateChanged:(uint64_t)state isEnabled:(BOOL)enabled {
|
||||
[super stateChanged:state isEnabled:enabled];
|
||||
|
||||
if (state == states::EXPANDED) {
|
||||
// If the EXPANDED state is updated, fire appropriate events on the
|
||||
// outline row.
|
||||
[self moxPostNotification:(enabled
|
||||
? NSAccessibilityRowExpandedNotification
|
||||
: NSAccessibilityRowCollapsedNotification)];
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -30,7 +30,7 @@ addAccessibleTask(
|
|||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li role="treeitem" aria-expanded="false">
|
||||
<li id="vegetables" role="treeitem" aria-expanded="false">
|
||||
<span>
|
||||
Vegetables
|
||||
</span>
|
||||
|
@ -140,6 +140,32 @@ addAccessibleTask(
|
|||
1,
|
||||
"Row is level one"
|
||||
);
|
||||
|
||||
let evt = waitForMacEvent("AXRowExpanded", "vegetables");
|
||||
await SpecialPowers.spawn(browser, [], () => {
|
||||
content.document
|
||||
.getElementById("vegetables")
|
||||
.setAttribute("aria-expanded", "true");
|
||||
});
|
||||
await evt;
|
||||
is(
|
||||
outRows[2].getAttributeValue("AXDisclosing"),
|
||||
1,
|
||||
"Row is disclosing after being expanded"
|
||||
);
|
||||
|
||||
evt = waitForMacEvent("AXRowCollapsed", "vegetables");
|
||||
await SpecialPowers.spawn(browser, [], () => {
|
||||
content.document
|
||||
.getElementById("vegetables")
|
||||
.setAttribute("aria-expanded", "false");
|
||||
});
|
||||
await evt;
|
||||
is(
|
||||
outRows[2].getAttributeValue("AXDisclosing"),
|
||||
0,
|
||||
"Row is not disclosing after being collapsed again"
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче