Bug 476404 - [SeaMonkey] New a11y test_relations.xul fails, r=marcoz, davidb, sr=neil
authorAlexander Surkov <surkov.alexander@gmail.com>
Fri, 27 Feb 2009 18:47:15 +0800
changeset 25589 ef19ac0459fda504f27593f8e13d9d7780360020
parent 25588 abc181937ef2620a7d03bafefc7e517363d26229
child 25590 0e13ae11c939426448981dcbee422d7d019774a8
push id5631
push usersurkov.alexander@gmail.com
push dateFri, 27 Feb 2009 10:47:41 +0000
treeherdermozilla-central@ef19ac0459fd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmarcoz, davidb, neil
bugs476404
milestone1.9.2a1pre
Bug 476404 - [SeaMonkey] New a11y test_relations.xul fails, r=marcoz, davidb, sr=neil
accessible/src/base/nsRootAccessible.cpp
--- a/accessible/src/base/nsRootAccessible.cpp
+++ b/accessible/src/base/nsRootAccessible.cpp
@@ -987,17 +987,24 @@ nsRootAccessible::GetContentDocShell(nsI
     return nsnull;
   }
 
   PRInt32 itemType;
   aStart->GetItemType(&itemType);
   if (itemType == nsIDocShellTreeItem::typeContent) {
     nsCOMPtr<nsIAccessibleDocument> accDoc =
       GetDocAccessibleFor(aStart, PR_TRUE);
+
+    // Hidden documents don't have accessibles (like SeaMonkey's sidebar),
+    // they are of no interest for a11y.
+    if (!accDoc)
+      return nsnull;
+
     nsCOMPtr<nsIAccessible> accessible = do_QueryInterface(accDoc);
+
     // If ancestor chain of accessibles is not completely visible,
     // don't use this one. This happens for example if it's inside
     // a background tab (tabbed browsing)
     while (accessible) {
       if (nsAccUtils::State(accessible) & nsIAccessibleStates::STATE_INVISIBLE)
         return nsnull;
 
       nsCOMPtr<nsIAccessible> ancestor;