Bug 1527254 - Don't rely on tabpanels xul element in Android for offcreen state. r=MarcoZ
authorEitan Isaacson <eitan@monotonous.org>
Thu, 14 Feb 2019 08:01:36 +0000
changeset 459008 01bc5a0dc801885894b7ce17e0bdbaf73b87c020
parent 459007 a4e958b1a97c302b0760478ef34cd909608c2731
child 459009 194d4681c00cde28b3a3213dcbcda5fa17159c68
push id35554
push userrgurzau@mozilla.com
push dateThu, 14 Feb 2019 17:00:27 +0000
treeherdermozilla-central@db6bcdbe4040 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMarcoZ
bugs1527254
milestone67.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 1527254 - Don't rely on tabpanels xul element in Android for offcreen state. r=MarcoZ Differential Revision: https://phabricator.services.mozilla.com/D19710
accessible/generic/Accessible.cpp
--- a/accessible/generic/Accessible.cpp
+++ b/accessible/generic/Accessible.cpp
@@ -330,18 +330,25 @@ uint64_t Accessible::VisibilityState() c
 
     if (nsLayoutUtils::IsPopup(curFrame)) return 0;
 
     // Offscreen state for background tab content and invisible for not selected
     // deck panel.
     nsIFrame* parentFrame = curFrame->GetParent();
     nsDeckFrame* deckFrame = do_QueryFrame(parentFrame);
     if (deckFrame && deckFrame->GetSelectedBox() != curFrame) {
+#if defined(ANDROID)
+      // In Fennec instead of a <tabpanels> container there is a <deck>
+      // with direct <browser> children.
+      if (curFrame->GetContent()->IsXULElement(nsGkAtoms::browser))
+        return states::OFFSCREEN;
+#else
       if (deckFrame->GetContent()->IsXULElement(nsGkAtoms::tabpanels))
         return states::OFFSCREEN;
+#endif
 
       MOZ_ASSERT_UNREACHABLE(
           "Children of not selected deck panel are not accessible.");
       return states::INVISIBLE;
     }
 
     // If contained by scrollable frame then check that at least 12 pixels
     // around the object is visible, otherwise the object is offscreen.