diff --git a/accessible/src/generic/Accessible.cpp b/accessible/src/generic/Accessible.cpp index db84c76f1a1..e1531c64c6b 100644 --- a/accessible/src/generic/Accessible.cpp +++ b/accessible/src/generic/Accessible.cpp @@ -621,11 +621,17 @@ Accessible::VisibilityState() if (view && view->GetVisibility() == nsViewVisibility_kHide) return states::INVISIBLE; - // Offscreen state for background tab content. + // 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) - return states::OFFSCREEN; + if (deckFrame && deckFrame->GetSelectedBox() != curFrame) { + if (deckFrame->GetContent()->IsXUL() && + deckFrame->GetContent()->Tag() == nsGkAtoms::tabpanels) + return states::OFFSCREEN; + + 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. diff --git a/accessible/tests/mochitest/states/Makefile.in b/accessible/tests/mochitest/states/Makefile.in index 14f3b2e4bff..48e6083ac6e 100644 --- a/accessible/tests/mochitest/states/Makefile.in +++ b/accessible/tests/mochitest/states/Makefile.in @@ -31,6 +31,7 @@ MOCHITEST_A11Y_FILES =\ test_textbox.xul \ test_tree.xul \ test_visibility.html \ + test_visibility.xul \ z_frames.html \ z_frames_article.html \ z_frames_checkbox.html \ diff --git a/accessible/tests/mochitest/states/test_visibility.xul b/accessible/tests/mochitest/states/test_visibility.xul new file mode 100644 index 00000000000..5978ddb9b7f --- /dev/null +++ b/accessible/tests/mochitest/states/test_visibility.xul @@ -0,0 +1,73 @@ + + + + + + + + + + + + Mozilla Bug 810260 + + +

+ +
+      
+ + + + + + +