Bug 1453555: Fix accessibility group info for <select size="1"> options. r?surkov
In the e10s implementation, Accessible::NativeState for the options doesn't include the invisible state. (It does with e10s disabled.)
In HTMLSelectOptionAccessible::NativeState, rather than just flipping (xor) the invisible state, absolutely ensure it gets removed. We don't want to *add* the invisible state if it isn't there.
This allows group position info to be calculated correctly.
MozReview-Commit-ID: LPEVhOOm2NT
--- a/accessible/html/HTMLSelectAccessible.cpp
+++ b/accessible/html/HTMLSelectAccessible.cpp
@@ -193,17 +193,20 @@ HTMLSelectOptionAccessible::NativeState(
if (selectState & states::OFFSCREEN) {
state |= states::OFFSCREEN;
} else if (selectState & states::COLLAPSED) {
// <select> is COLLAPSED: add OFFSCREEN, if not the currently
// visible option
if (!selected) {
state |= states::OFFSCREEN;
- state ^= states::INVISIBLE;
+ // Ensure the invisible state is removed. Otherwise, group info will skip
+ // this option. Furthermore, this gets cached and this doesn't get
+ // invalidated even once the select is expanded.
+ state &= ~states::INVISIBLE;
} else {
// Clear offscreen and invisible for currently showing option
state &= ~(states::OFFSCREEN | states::INVISIBLE);
state |= selectState & states::OPAQUE1;
}
} else {
// XXX list frames are weird, don't rely on Accessible's general
// visibility implementation unless they get reimplemented in layout