Bug 1527254 - Don't rely on tabpanels xul element in Android for offcreen state. r=MarcoZ

Differential Revision: https://phabricator.services.mozilla.com/D19710

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Eitan Isaacson 2019-02-14 08:01:36 +00:00
parent c5dfc53d7d
commit bb5af5a481

View File

@ -335,8 +335,15 @@ uint64_t Accessible::VisibilityState() const {
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.");