Bug 629000 - the text leaf accessible bound to the tree shouldn't be checked for relations, r=davidb, a=davidb
authorAlexander Surkov <surkov.alexander@gmail.com>
Fri, 28 Jan 2011 12:38:26 +0800
changeset 61465 7749a10c82320eb596c7d97b9011e6d5017a396a
parent 61464 cb3fcbce2ef47d71d607e7b5b413ebcfeda492cf
child 61466 307d7ab0729f241377094ceaf46978fb5a5f40fa
push idunknown
push userunknown
push dateunknown
reviewersdavidb, davidb
bugs629000
milestone2.0b11pre
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 629000 - the text leaf accessible bound to the tree shouldn't be checked for relations, r=davidb, a=davidb
accessible/src/base/nsAccessNode.h
accessible/src/base/nsDocAccessible.cpp
--- a/accessible/src/base/nsAccessNode.h
+++ b/accessible/src/base/nsAccessNode.h
@@ -161,16 +161,21 @@ public:
 
   /**
    * Return node type information of DOM node associated with the accessible.
    */
   PRBool IsContent() const
   {
     return GetNode() && GetNode()->IsNodeOfType(nsINode::eCONTENT);
   }
+  bool IsElement() const
+  {
+    nsINode* node = GetNode();
+    return node && node->IsElement();
+  }
   PRBool IsDocument() const
   {
     return GetNode() && GetNode()->IsNodeOfType(nsINode::eDOCUMENT);
   }
 
   /**
    * Return the corresponding press shell for this accessible.
    */
--- a/accessible/src/base/nsDocAccessible.cpp
+++ b/accessible/src/base/nsDocAccessible.cpp
@@ -1363,17 +1363,19 @@ nsDocAccessible::BindToDocument(nsAccess
   if (!aAccessible->Init()) {
     NS_ERROR("Failed to initialize an accessible!");
 
     UnbindFromDocument(aAccessible);
     return false;
   }
 
   aAccessible->SetRoleMapEntry(aRoleMapEntry);
-  AddDependentIDsFor(aAccessible);
+  if (aAccessible->IsElement())
+    AddDependentIDsFor(aAccessible);
+
   return true;
 }
 
 void
 nsDocAccessible::UnbindFromDocument(nsAccessible* aAccessible)
 {
   NS_ASSERTION(mAccessibleCache.GetWeak(aAccessible->UniqueID()),
                "Unbinding the unbound accessible!");