Bug 1453555: Fix accessibility group info for <select size="1"> options. r=surkov
authorJames Teh <jteh@mozilla.com>
Thu, 12 Apr 2018 16:32:19 +1000
changeset 413102 f52a56dc215cfd8ea7310c168632d33531fc8c90
parent 413101 8d1d10c984852a381cadf2fbf9f7c79fd5d31258
child 413103 2852286117d3415763691f042c71db595d77c8d7
push id33833
push useraiakab@mozilla.com
push dateFri, 13 Apr 2018 09:41:15 +0000
treeherdermozilla-central@260e4c83c8a9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssurkov
bugs1453555
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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
accessible/html/HTMLSelectAccessible.cpp
--- 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