Bug 571184 - remove nsIAccessNode traversal methods, r=davidb, marcoz
authorAlexander Surkov <surkov.alexander@gmail.com>
Sat, 12 Jun 2010 13:04:35 +0900
changeset 43538 6768f98d8cea22e04a15be22c62509c872c2dba9
parent 43537 28a9850ae772dce475fd81c6c9436ad569a2b2f7
child 43539 85a2ebbd0ddf5f8120deb2f6e658a9c62af7ac81
push idunknown
push userunknown
push dateunknown
reviewersdavidb, marcoz
bugs571184
milestone1.9.3a6pre
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 571184 - remove nsIAccessNode traversal methods, r=davidb, marcoz
accessible/public/nsIAccessNode.idl
accessible/src/atk/nsAccessibleWrap.cpp
accessible/src/atk/nsAccessibleWrap.h
accessible/src/atk/nsApplicationAccessibleWrap.cpp
accessible/src/atk/nsApplicationAccessibleWrap.h
accessible/src/base/nsAccCache.h
accessible/src/base/nsAccDocManager.cpp
accessible/src/base/nsAccDocManager.h
accessible/src/base/nsAccUtils.cpp
accessible/src/base/nsAccessNode.cpp
accessible/src/base/nsAccessNode.h
accessible/src/base/nsAccessibilityService.cpp
accessible/src/base/nsAccessibilityService.h
accessible/src/base/nsAccessible.cpp
accessible/src/base/nsAccessible.h
accessible/src/base/nsApplicationAccessible.cpp
accessible/src/base/nsApplicationAccessible.h
accessible/src/base/nsBaseWidgetAccessible.cpp
accessible/src/base/nsBaseWidgetAccessible.h
accessible/src/base/nsDocAccessible.cpp
accessible/src/base/nsDocAccessible.h
accessible/src/base/nsOuterDocAccessible.cpp
accessible/src/base/nsOuterDocAccessible.h
accessible/src/base/nsRootAccessible.cpp
accessible/src/base/nsRootAccessible.h
accessible/src/html/nsHTMLImageMapAccessible.cpp
accessible/src/html/nsHTMLSelectAccessible.cpp
accessible/src/html/nsHTMLSelectAccessible.h
accessible/src/html/nsHTMLTextAccessible.cpp
accessible/src/html/nsHTMLTextAccessible.h
accessible/src/mac/nsAccessibleWrap.h
accessible/src/mac/nsAccessibleWrap.mm
accessible/src/mac/nsDocAccessibleWrap.h
accessible/src/mac/nsDocAccessibleWrap.mm
accessible/src/msaa/nsAccessibleWrap.cpp
accessible/src/msaa/nsHTMLWin32ObjectAccessible.cpp
accessible/src/msaa/nsHTMLWin32ObjectAccessible.h
accessible/src/xul/nsXULColorPickerAccessible.cpp
accessible/src/xul/nsXULColorPickerAccessible.h
accessible/src/xul/nsXULComboboxAccessible.cpp
accessible/src/xul/nsXULComboboxAccessible.h
accessible/src/xul/nsXULFormControlAccessible.cpp
accessible/src/xul/nsXULFormControlAccessible.h
accessible/src/xul/nsXULMenuAccessible.cpp
accessible/src/xul/nsXULMenuAccessible.h
accessible/src/xul/nsXULTreeAccessible.cpp
accessible/src/xul/nsXULTreeAccessible.h
accessible/src/xul/nsXULTreeGridAccessible.cpp
accessible/src/xul/nsXULTreeGridAccessible.h
accessible/tests/mochitest/Makefile.in
accessible/tests/mochitest/test_invalidate_accessnode.html
--- a/accessible/public/nsIAccessNode.idl
+++ b/accessible/public/nsIAccessNode.idl
@@ -51,64 +51,25 @@ interface nsIDOMCSSPrimitiveValue;
  * The nsIAccessNode implementations are instantiated lazily.
  * The nsIAccessNode tree for a given dom window
  * has a one to one relationship to the DOM tree.
  * If the DOM node for this access node is "accessible",
  * then a QueryInterface to nsIAccessible will succeed.
  *
  * @status UNDER_REVIEW
  */
-[scriptable, uuid(bd458843-1895-42c6-b7f9-f0ca88eeab6b)]
+[scriptable, uuid(ef16ff42-0256-4b48-ae87-b18a95b7f7d6)]
 interface nsIAccessNode : nsISupports
 {
   /**
    * The DOM node this nsIAccessNode is associated with.
    */
   readonly attribute nsIDOMNode DOMNode;
 
   /**
-   * The number of DOM children for the DOM node, which
-   * matches the number of nsIAccessNode children for this
-   * nsIAccessNode.
-   */
-  readonly attribute long numChildren;
-  
-  /**
-   * Get the nth child of this node
-   * @param childNum Zero-based child index
-   * @return The nth nsIAccessNode child
-   */
-  nsIAccessNode getChildNodeAt(in long childNum);
-  
-  /**
-   * The parent nsIAccessNode
-   */
-  readonly attribute nsIAccessNode parentNode;
-
-  /**
-   * The first nsIAccessNode child
-   */
-  readonly attribute nsIAccessNode firstChildNode;
-
-  /**
-   * The last nsIAccessNode child
-   */
-  readonly attribute nsIAccessNode lastChildNode;
-  
-  /**
-   * The previous nsIAccessNode sibling
-   */
-  readonly attribute nsIAccessNode previousSiblingNode;
-
-  /**
-   * The next nsIAccessNode sibling
-   */
-  readonly attribute nsIAccessNode nextSiblingNode;
-
-  /**
    * The document accessible that this access node resides in.
    */
   readonly attribute nsIAccessibleDocument document;
 
   /**
    * The root document accessible that this access node resides in.
    */
   readonly attribute nsIAccessibleDocument rootDocument;
--- a/accessible/src/atk/nsAccessibleWrap.cpp
+++ b/accessible/src/atk/nsAccessibleWrap.cpp
@@ -301,21 +301,21 @@ void nsAccessibleWrap::ShutdownAtkObject
             MAI_ATK_OBJECT(mAtkObject)->accWrap = nsnull;
         }
         SetMaiHyperlink(nsnull);
         g_object_unref(mAtkObject);
         mAtkObject = nsnull;
     }
 }
 
-nsresult
+void
 nsAccessibleWrap::Shutdown()
 {
     ShutdownAtkObject();
-    return nsAccessible::Shutdown();
+    nsAccessible::Shutdown();
 }
 
 MaiHyperlink* nsAccessibleWrap::GetMaiHyperlink(PRBool aCreate /* = PR_TRUE */)
 {
     // make sure mAtkObject is created
     GetAtkObject();
 
     NS_ASSERTION(quark_mai_hyperlink, "quark_mai_hyperlink not initialized");
--- a/accessible/src/atk/nsAccessibleWrap.h
+++ b/accessible/src/atk/nsAccessibleWrap.h
@@ -85,17 +85,17 @@ class MaiHyperlink;
 class nsAccessibleWrap: public nsAccessible
 {
 public:
     nsAccessibleWrap(nsIContent *aContent, nsIWeakReference *aShell);
     virtual ~nsAccessibleWrap();
     void ShutdownAtkObject();
 
     // nsAccessNode
-    virtual nsresult Shutdown();
+    virtual void Shutdown();
 
 #ifdef MAI_LOGGING
     virtual void DumpnsAccessibleWrapInfo(int aDepth) {}
     static PRInt32 mAccWrapCreated;
     static PRInt32 mAccWrapDeleted;
 #endif
 
     // return the atk object for this nsAccessibleWrap
--- a/accessible/src/atk/nsApplicationAccessibleWrap.cpp
+++ b/accessible/src/atk/nsApplicationAccessibleWrap.cpp
@@ -527,17 +527,17 @@ nsApplicationAccessibleWrap::nsApplicati
 }
 
 nsApplicationAccessibleWrap::~nsApplicationAccessibleWrap()
 {
     MAI_LOG_DEBUG(("======Destory AppRootAcc=%p\n", (void*)this));
     nsAccessibleWrap::ShutdownAtkObject();
 }
 
-nsresult
+PRBool
 nsApplicationAccessibleWrap::Init()
 {
     // XXX following code is copied from widget/src/gtk2/nsWindow.cpp
     // we should put it to somewhere that can be used from both modules
     // see bug 390761
 
     // check if accessibility enabled/disabled by environment variable
     PRBool isGnomeATEnabled = PR_FALSE;
--- a/accessible/src/atk/nsApplicationAccessibleWrap.h
+++ b/accessible/src/atk/nsApplicationAccessibleWrap.h
@@ -50,17 +50,17 @@ public:
     static void Unload();
     static void PreCreate();
 
 public:
     nsApplicationAccessibleWrap();
     virtual ~nsApplicationAccessibleWrap();
 
     // nsAccessNode
-    virtual nsresult Init();
+    virtual PRBool Init();
 
     // return the atk object for app root accessible
     NS_IMETHOD GetNativeInterface(void **aOutAccessible);
 
     // nsApplicationAccessible
     virtual nsresult AddRootAccessible(nsIAccessible *aRootAccWrap);
     virtual nsresult RemoveRootAccessible(nsIAccessible *aRootAccWrap);
 };
--- a/accessible/src/base/nsAccCache.h
+++ b/accessible/src/base/nsAccCache.h
@@ -37,32 +37,32 @@
  * ***** END LICENSE BLOCK ***** */
 
 #ifndef _nsAccCache_H_
 #define _nsAccCache_H_
 
 #include "nsRefPtrHashtable.h"
 #include "nsCycleCollectionParticipant.h"
 
-class nsIAccessNode;
+class nsIAccessible;
 
 ////////////////////////////////////////////////////////////////////////////////
 // Accessible cache utils
 ////////////////////////////////////////////////////////////////////////////////
 
 /**
  * Shutdown and removes the accessible from cache.
  */
 template <class T>
 static PLDHashOperator
-ClearCacheEntry(const void* aKey, nsRefPtr<T>& aAccessNode, void* aUserArg)
+ClearCacheEntry(const void* aKey, nsRefPtr<T>& aAccessible, void* aUserArg)
 {
-  NS_ASSERTION(aAccessNode, "Calling ClearCacheEntry with a NULL pointer!");
-  if (aAccessNode)
-    aAccessNode->Shutdown();
+  NS_ASSERTION(aAccessible, "Calling ClearCacheEntry with a NULL pointer!");
+  if (aAccessible)
+    aAccessible->Shutdown();
 
   return PL_DHASH_REMOVE;
 }
 
 /**
  * Clear the cache and shutdown the accessibles.
  */
 template <class T>
@@ -72,25 +72,25 @@ ClearCache(nsRefPtrHashtable<nsVoidPtrHa
   aCache.Enumerate(ClearCacheEntry<T>, nsnull);
 }
 
 /**
  * Traverse the accessible cache entry for cycle collector.
  */
 template <class T>
 static PLDHashOperator
-CycleCollectorTraverseCacheEntry(const void *aKey, T *aAccessNode,
+CycleCollectorTraverseCacheEntry(const void *aKey, T *aAccessible,
                                  void *aUserArg)
 {
   nsCycleCollectionTraversalCallback *cb =
     static_cast<nsCycleCollectionTraversalCallback*>(aUserArg);
 
   NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(*cb, "accessible cache entry");
 
-  nsISupports *supports = static_cast<nsIAccessNode*>(aAccessNode);
+  nsISupports *supports = static_cast<nsIAccessible*>(aAccessible);
   cb->NoteXPCOMChild(supports);
   return PL_DHASH_NEXT;
 }
 
 /**
  * Traverse the accessible cache for cycle collector.
  */
 template <class T>
--- a/accessible/src/base/nsAccDocManager.cpp
+++ b/accessible/src/base/nsAccDocManager.cpp
@@ -590,18 +590,15 @@ nsAccDocManager::SearchAccessibleInDocCa
                                             void* aUserArg)
 {
   NS_ASSERTION(aDocAccessible,
                "No doc accessible for the object in doc accessible cache!");
 
   if (aDocAccessible) {
     nsSearchAccessibleInCacheArg* arg =
       static_cast<nsSearchAccessibleInCacheArg*>(aUserArg);
-    nsAccessNode* accessNode =
-      aDocAccessible->GetCachedAccessNode(arg->mUniqueID);
-    if (accessNode) {
-      arg->mAccessible = do_QueryObject(accessNode);
+    arg->mAccessible = aDocAccessible->GetCachedAccessible(arg->mUniqueID);
+    if (arg->mAccessible)
       return PL_DHASH_STOP;
-    }
   }
 
   return PL_DHASH_NEXT;
 }
--- a/accessible/src/base/nsAccDocManager.h
+++ b/accessible/src/base/nsAccDocManager.h
@@ -169,17 +169,17 @@ private:
    */
   void ClearDocCache()
   {
     mDocAccessibleCache.Enumerate(ClearDocCacheEntry, static_cast<void*>(this));
   }
 
   struct nsSearchAccessibleInCacheArg
   {
-    nsRefPtr<nsAccessible> mAccessible;
+    nsAccessible *mAccessible;
     void *mUniqueID;
   };
 
   static PLDHashOperator
     SearchAccessibleInDocCache(const void* aKey,
                                nsDocAccessible* aDocAccessible,
                                void* aUserArg);
 
--- a/accessible/src/base/nsAccUtils.cpp
+++ b/accessible/src/base/nsAccUtils.cpp
@@ -646,26 +646,18 @@ nsIntPoint
 nsAccUtils::GetScreenCoordsForWindow(nsAccessNode *aAccessNode)
 {
   return nsCoreUtils::GetScreenCoordsForWindow(aAccessNode->GetNode());
 }
 
 nsIntPoint
 nsAccUtils::GetScreenCoordsForParent(nsAccessNode *aAccessNode)
 {
-  nsRefPtr<nsAccessNode> parent;
-  nsRefPtr<nsAccessible> accessible(do_QueryObject(aAccessNode));
-  if (accessible) {
-    parent = do_QueryObject(accessible->GetParent());
-  } else {
-    nsCOMPtr<nsIAccessNode> parentAccessNode;
-    aAccessNode->GetParentNode(getter_AddRefs(parentAccessNode));
-    parent = do_QueryObject(parentAccessNode);
-  }
-
+  nsAccessible *parent =
+    GetAccService()->GetContainerAccessible(aAccessNode->GetNode(), PR_TRUE);
   if (!parent)
     return nsIntPoint(0, 0);
 
   nsIFrame *parentFrame = parent->GetFrame();
   if (!parentFrame)
     return nsIntPoint(0, 0);
 
   nsIntRect parentRect = parentFrame->GetScreenRectExternal();
--- a/accessible/src/base/nsAccessNode.cpp
+++ b/accessible/src/base/nsAccessNode.cpp
@@ -132,71 +132,28 @@ void nsAccessNode::LastRelease()
   }
   // ... then die.
   NS_DELETEXPCOM(this);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsAccessNode public
 
-nsresult
+PRBool
 nsAccessNode::Init()
 {
-  // We have to put this here, instead of constructor, otherwise
-  // we don't have the virtual GetUniqueID() method for the hash key.
-  // We need that for accessibles that don't have DOM nodes
-
-#ifdef DEBUG_A11Y
-  NS_ASSERTION(!mIsInitialized, "Initialized twice!");
-#endif
-  nsDocAccessible *docAcc = nsnull;
-  nsCOMPtr<nsIPresShell> presShell(do_QueryReferent(mWeakShell));
-  if (presShell)
-    docAcc = GetAccService()->GetDocAccessible(presShell->GetDocument());
-
-  NS_ASSERTION(docAcc, "Cannot cache new nsAccessNode");
-  if (!docAcc) {
-#ifdef DEBUG
-    docAcc = GetAccService()->GetDocAccessible(presShell->GetDocument());
-#endif
-    return NS_ERROR_FAILURE;
-  }
-
-  void* uniqueID;
-  GetUniqueID(&uniqueID);
-
-  if (!docAcc->CacheAccessNode(uniqueID, this))
-    return NS_ERROR_OUT_OF_MEMORY;
-
-  // Make sure an ancestor in real content is cached
-  // so that nsDocAccessible::RefreshNodes() can find the anonymous subtree to release when
-  // the root node goes away
-  if (mContent && mContent->IsInAnonymousSubtree()) {
-    // Specific examples of where this is used: <input type="file"> and <xul:findbar>
-    nsAccessible *parent = GetAccService()->GetContainerAccessible(mContent,
-                                                                   PR_TRUE);
-    if (parent)
-      parent->EnsureChildren();
-  }
-
-#ifdef DEBUG_A11Y
-  mIsInitialized = PR_TRUE;
-#endif
-
-  return NS_OK;
+  return PR_TRUE;
 }
 
 
-nsresult
+void
 nsAccessNode::Shutdown()
 {
   mContent = nsnull;
   mWeakShell = nsnull;
-
-  return NS_OK;
 }
 
 // nsIAccessNode
 NS_IMETHODIMP nsAccessNode::GetUniqueID(void **aUniqueID)
 {
   *aUniqueID = static_cast<void*>(GetNode());
   return NS_OK;
 }
@@ -356,30 +313,16 @@ already_AddRefed<nsRootAccessible> nsAcc
 }
 
 nsIFrame*
 nsAccessNode::GetFrame()
 {
   return mContent ? mContent->GetPrimaryFrame() : nsnull;
 }
 
-#ifdef DEBUG
-PRBool
-nsAccessNode::IsInCache()
-{
-  nsDocAccessible *docAccessible = nsAccUtils::GetDocAccessibleFor(mWeakShell);
-  if (!docAccessible)
-    return nsnull;
-
-  void* uniqueID = nsnull;
-  GetUniqueID(&uniqueID);
-
-  return docAccessible->GetCachedAccessNode(uniqueID) ? PR_TRUE : PR_FALSE;
-}
-#endif
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsIAccessNode
 
 NS_IMETHODIMP
 nsAccessNode::GetDOMNode(nsIDOMNode **aDOMNode)
 {
   NS_ENSURE_ARG_POINTER(aDOMNode);
@@ -388,29 +331,16 @@ nsAccessNode::GetDOMNode(nsIDOMNode **aD
   nsINode *node = GetNode();
   if (node)
     CallQueryInterface(node, aDOMNode);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsAccessNode::GetNumChildren(PRInt32 *aNumChildren)
-{
-  NS_ENSURE_ARG_POINTER(aNumChildren);
-  *aNumChildren = 0;
-
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
-  *aNumChildren = GetNode()->GetChildCount();
-  return NS_OK;
-}
-
-NS_IMETHODIMP
 nsAccessNode::GetDocument(nsIAccessibleDocument **aDocument)
 {
   NS_ENSURE_ARG_POINTER(aDocument);
 
   NS_IF_ADDREF(*aDocument = nsAccUtils::GetDocAccessibleFor(mWeakShell));
   return NS_OK;
 }
 
@@ -469,154 +399,16 @@ nsAccessNode::ScrollToPoint(PRUint32 aCo
 
   nsIFrame *parentFrame = frame;
   while ((parentFrame = parentFrame->GetParent()))
     nsCoreUtils::ScrollFrameToPoint(parentFrame, frame, coords);
 
   return NS_OK;
 }
 
-// nsAccessNode protected
-nsAccessNode *
-nsAccessNode::MakeAccessNode(nsINode *aNode)
-{
-  nsAccessNode *accessNode = GetAccService()->GetCachedAccessNode(aNode,
-                                                                  mWeakShell);
-
-  if (!accessNode)
-    accessNode = GetAccService()->GetAccessibleInWeakShell(aNode, mWeakShell);
-
-  if (accessNode)
-    return accessNode;
-
-  nsCOMPtr<nsIContent> content(do_QueryInterface(aNode));
-  if (!content)
-    return nsnull;
-
-  nsAccessNode *newAccessNode = new nsAccessNode(content, mWeakShell);
-  if (!newAccessNode)
-    return nsnull;
-
-  // Initialize and cache it.
-  if (NS_FAILED(newAccessNode->Init())) {
-    newAccessNode->Shutdown();
-    delete newAccessNode;
-    return nsnull;
-  }
-
-  return newAccessNode;
-}
-
-NS_IMETHODIMP
-nsAccessNode::GetFirstChildNode(nsIAccessNode **aAccessNode)
-{
-  NS_ENSURE_ARG_POINTER(aAccessNode);
-  *aAccessNode = nsnull;
-
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
-  nsIContent* childNode = GetNode()->GetChildAt(0);
-  if (childNode)
-    NS_IF_ADDREF(*aAccessNode = MakeAccessNode(childNode));
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsAccessNode::GetLastChildNode(nsIAccessNode **aAccessNode)
-{
-  NS_ENSURE_ARG_POINTER(aAccessNode);
-  *aAccessNode = nsnull;
-
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
-  PRUint32 childCount = GetNode()->GetChildCount();
-  nsIContent* childNode = GetNode()->GetChildAt(childCount - 1);
-  if (childNode)
-    NS_IF_ADDREF(*aAccessNode = MakeAccessNode(childNode));
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsAccessNode::GetParentNode(nsIAccessNode **aAccessNode)
-{
-  NS_ENSURE_ARG_POINTER(aAccessNode);
-  *aAccessNode = nsnull;
-
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
-  nsINode* parentNode = GetNode()->GetNodeParent();
-  if (parentNode)
-    NS_IF_ADDREF(*aAccessNode = MakeAccessNode(parentNode));
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsAccessNode::GetPreviousSiblingNode(nsIAccessNode **aAccessNode)
-{
-  NS_ENSURE_ARG_POINTER(aAccessNode);
-  *aAccessNode = nsnull;
-
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
-  nsINode* parentNode = GetNode()->GetNodeParent();
-  PRInt32 indexOf = parentNode->IndexOf(GetNode());
-  if (indexOf == -1)
-    return NS_OK;
-
-  nsIContent *siblingNode = parentNode->GetChildAt(indexOf - 1);
-  if (siblingNode)
-    NS_IF_ADDREF(*aAccessNode = MakeAccessNode(siblingNode));
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsAccessNode::GetNextSiblingNode(nsIAccessNode **aAccessNode)
-{
-  NS_ENSURE_ARG_POINTER(aAccessNode);
-  *aAccessNode = nsnull;
-
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
-  nsINode* parentNode = GetNode()->GetNodeParent();
-  PRInt32 indexOf = parentNode->IndexOf(GetNode());
-  if (indexOf == -1)
-    return NS_OK;
-
-  nsIContent *siblingNode = parentNode->GetChildAt(indexOf + 1);
-  if (siblingNode)
-    NS_IF_ADDREF(*aAccessNode = MakeAccessNode(siblingNode));
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsAccessNode::GetChildNodeAt(PRInt32 aChildNum, nsIAccessNode **aAccessNode)
-{
-  NS_ENSURE_ARG_POINTER(aAccessNode);
-  *aAccessNode = nsnull;
-
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
-  nsIContent* childNode = GetNode()->GetChildAt(aChildNum);
-  if (childNode)
-    NS_IF_ADDREF(*aAccessNode = MakeAccessNode(childNode));
-
-  return NS_OK;
-}
-
 NS_IMETHODIMP
 nsAccessNode::GetComputedStyleValue(const nsAString& aPseudoElt,
                                     const nsAString& aPropertyName,
                                     nsAString& aValue)
 {
   if (IsDefunct())
     return NS_ERROR_FAILURE;
 
--- a/accessible/src/base/nsAccessNode.h
+++ b/accessible/src/base/nsAccessNode.h
@@ -61,19 +61,16 @@ class nsDocAccessible;
 class nsIAccessibleDocument;
 class nsRootAccessible;
 
 class nsIPresShell;
 class nsPresContext;
 class nsIFrame;
 class nsIDocShellTreeItem;
 
-typedef nsRefPtrHashtable<nsVoidPtrHashKey, nsAccessNode>
-  nsAccessNodeHashtable;
-
 #define ACCESSIBLE_BUNDLE_URL "chrome://global-platform/locale/accessible.properties"
 #define PLATFORM_KEYS_BUNDLE_URL "chrome://global-platform/locale/platformKeys.properties"
 
 #define NS_ACCESSNODE_IMPL_CID                          \
 {  /* 2b07e3d7-00b3-4379-aa0b-ea22e2c8ffda */           \
   0x2b07e3d7,                                           \
   0x00b3,                                               \
   0x4379,                                               \
@@ -124,25 +121,25 @@ public:
    */
   already_AddRefed<nsINode> GetCurrentFocus();
 
     /**
      * Returns true when the accessible is defunct.
      */
     virtual PRBool IsDefunct();
 
-    /**
-     * Initialize the access node object, add it to the cache.
-     */
-    virtual nsresult Init();
+  /**
+   * Initialize the access node object, add it to the cache.
+   */
+  virtual PRBool Init();
 
-    /**
-     * Shutdown the access node object.
-     */
-    virtual nsresult Shutdown();
+  /**
+   * Shutdown the access node object.
+   */
+  virtual void Shutdown();
 
     /**
      * Return frame for the given access node object.
      */
     virtual nsIFrame* GetFrame();
 
   /**
    * Return DOM node associated with this accessible.
@@ -179,40 +176,24 @@ public:
   already_AddRefed<nsIPresShell> GetPresShell();
 
   /**
    * Return true if the accessible still has presentation shell. Light-weight
    * version of IsDefunct() method.
    */
   PRBool HasWeakShell() const { return !!mWeakShell; }
 
-#ifdef DEBUG
-  /**
-   * Return true if the access node is cached.
-   */
-  PRBool IsInCache();
-#endif
-
 protected:
-  /**
-   * Return the access node for the given DOM node.
-   */
-  nsAccessNode *MakeAccessNode(nsINode *aNode);
-
     nsPresContext* GetPresContext();
 
     void LastRelease();
 
   nsCOMPtr<nsIContent> mContent;
   nsCOMPtr<nsIWeakReference> mWeakShell;
 
-#ifdef DEBUG_A11Y
-    PRBool mIsInitialized;
-#endif
-
     /**
      * Notify global nsIObserver's that a11y is getting init'd or shutdown
      */
     static void NotifyA11yInitOrShutdown(PRBool aIsInit);
 
     // Static data, we do our own refcounting for our static data
     static nsIStringBundle *gStringBundle;
     static nsIStringBundle *gKeyStringBundle;
--- a/accessible/src/base/nsAccessibilityService.cpp
+++ b/accessible/src/base/nsAccessibilityService.cpp
@@ -775,24 +775,24 @@ nsAccessibilityService::CreateHTMLCaptio
   *aAccessible = new nsHTMLCaptionAccessible(content, weakShell);
   if (!*aAccessible)
     return NS_ERROR_OUT_OF_MEMORY;
 
   NS_ADDREF(*aAccessible);
   return NS_OK;
 }
 
-// nsAccessibilityService public
-nsAccessNode*
-nsAccessibilityService::GetCachedAccessNode(nsINode *aNode,
+// nsAccessibilityService protected
+nsAccessible *
+nsAccessibilityService::GetCachedAccessible(nsINode *aNode,
                                             nsIWeakReference *aWeakShell)
 {
-  nsDocAccessible *docAccessible = nsAccUtils::GetDocAccessibleFor(aWeakShell);
+  nsDocAccessible *docAccessible = GetDocAccessible(aNode->GetOwnerDoc());
   return docAccessible ?
-    docAccessible->GetCachedAccessNode(static_cast<void*>(aNode)) : nsnull;
+    docAccessible->GetCachedAccessible(static_cast<void*>(aNode)) : nsnull;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsIAccessibleRetrieval
 
 NS_IMETHODIMP
 nsAccessibilityService::GetApplicationAccessible(nsIAccessible **aAccessibleApplication)
 {
@@ -1067,20 +1067,17 @@ nsAccessibilityService::GetContainerAcce
     currNode = GetAccService()->GetRelevantContentNodeFor(currNode);
 
     if (aCanCreate) {
       accessible = GetAccService()->GetAccessibleInWeakShell(currNode,
                                                              weakShell);
 
     } else {
       // Only return cached accessible, don't create anything.
-      nsRefPtr<nsAccessible> cachedAcc =
-        do_QueryObject(GetCachedAccessNode(currNode, weakShell));
-
-      accessible = cachedAcc;
+      accessible = GetCachedAccessible(currNode, weakShell);
     }
   }
 
   return accessible;
 }
 
 nsAccessible *
 nsAccessibilityService::GetAttachedAccessibleFor(nsINode *aNode)
@@ -1094,18 +1091,18 @@ nsAccessibilityService::GetAttachedAcces
 
 PRBool
 nsAccessibilityService::InitAccessible(nsAccessible *aAccessible,
                                        nsRoleMapEntry *aRoleMapEntry)
 {
   if (!aAccessible)
     return PR_FALSE;
 
-  nsresult rv = aAccessible->Init(); // Add to cache, etc.
-  if (NS_FAILED(rv)) {
+  // Add to cache an accessible, etc.
+  if (!aAccessible->Init()) {
     NS_ERROR("Failed to initialize an accessible!");
 
     aAccessible->Shutdown();
     return PR_FALSE;
   }
 
   NS_ASSERTION(aAccessible->IsInCache(),
                "Initialized accessible not in the cache!");
@@ -1143,34 +1140,27 @@ static PRBool HasRelatedContent(nsIConte
 }
 
 already_AddRefed<nsAccessible>
 nsAccessibilityService::GetAccessible(nsINode *aNode,
                                       nsIPresShell *aPresShell,
                                       nsIWeakReference *aWeakShell,
                                       PRBool *aIsHidden)
 {
-  if (!aPresShell || !aWeakShell || gIsShutdown)
+  if (!aPresShell || !aWeakShell || !aNode || gIsShutdown)
     return nsnull;
 
-  NS_ASSERTION(aNode, "GetAccessible() called with no node.");
-
   if (aIsHidden)
     *aIsHidden = PR_FALSE;
 
   // Check to see if we already have an accessible for this node in the cache.
-  nsAccessNode* cachedAccessNode = GetCachedAccessNode(aNode, aWeakShell);
-  if (cachedAccessNode) {
-    // XXX: the cache might contain the access node for the DOM node that is not
-    // accessible because of wrong cache update. In this case try to create new
-    // accessible.
-    nsRefPtr<nsAccessible> cachedAccessible = do_QueryObject(cachedAccessNode);
-
-    if (cachedAccessible)
-      return cachedAccessible.forget();
+  nsAccessible *cachedAccessible = GetCachedAccessible(aNode, aWeakShell);
+  if (cachedAccessible) {
+    NS_ADDREF(cachedAccessible);
+    return cachedAccessible;
   }
 
   // No cache entry, so we must create the accessible.
 
   if (aNode->IsNodeOfType(nsINode::eDOCUMENT)) {
     // If it's document node then ask accessible document loader for
     // document accessible, otherwise return null.
     nsCOMPtr<nsIDocument> document(do_QueryInterface(aNode));
@@ -1606,43 +1596,35 @@ nsAccessibilityService::GetAreaAccessibl
     return nsnull;
 
   nsCOMPtr<nsIDOMHTMLAreaElement> areaElmt = do_QueryInterface(aAreaNode);
   if (!areaElmt)
     return nsnull;
 
   // Try to get image map accessible from the global cache or create it
   // if failed.
-  nsRefPtr<nsAccessible> imageAcc;
-
-  nsAccessNode *cachedImgAcc = GetCachedAccessNode(aImageFrame->GetContent(),
-                                                   aWeakShell);
-  if (cachedImgAcc)
-    imageAcc = do_QueryObject(cachedImgAcc);
-
+  nsRefPtr<nsAccessible> imageAcc =
+    GetCachedAccessible(aImageFrame->GetContent(), aWeakShell);
   if (!imageAcc) {
     nsCOMPtr<nsIAccessible> imageAccessible;
     CreateHTMLImageAccessible(aImageFrame,
                               getter_AddRefs(imageAccessible));
 
     imageAcc = do_QueryObject(imageAccessible);
     if (!InitAccessible(imageAcc, nsnull))
       return nsnull;
   }
 
   // Make sure <area> accessible children of the image map are cached so
   // that they should be available in global cache.
   imageAcc->EnsureChildren();
 
-  nsAccessNode *cachedAreaAcc = GetCachedAccessNode(aAreaNode, aWeakShell);
-  if (!cachedAreaAcc)
-    return nsnull;
-
-  nsRefPtr<nsAccessible> areaAcc = do_QueryObject(cachedAreaAcc);
-  return areaAcc.forget();
+  nsAccessible *cachedAreaAcc = GetCachedAccessible(aAreaNode, aWeakShell);
+  NS_IF_ADDREF(cachedAreaAcc);
+  return cachedAreaAcc;
 }
 
 already_AddRefed<nsAccessible>
 nsAccessibilityService::CreateAccessibleByType(nsIContent *aContent,
                                                nsIWeakReference *aWeakShell)
 {
   nsCOMPtr<nsIAccessibleProvider> accessibleProvider(do_QueryInterface(aContent));
   if (!accessibleProvider)
--- a/accessible/src/base/nsAccessibilityService.h
+++ b/accessible/src/base/nsAccessibilityService.h
@@ -191,39 +191,40 @@ public:
    * XXX: this method must go away once we'll implement correct accessible tree.
    *
    * @param  aNode  [in] the DOM node to get relevant content node
    * @return         the DOM node for parent attached accessible
    */
   nsINode *GetRelevantContentNodeFor(nsINode *aNode);
 
   /**
-   * Return an access node for the DOM node in the given presentation shell if
-   * the access node already exists, otherwise null.
-   *
-   * @param  aNode       [in] the DOM node to get an access node for
-   * @param  aPresShell  [in] the presentation shell which contains layout info
-   *                       for the DOM node
-   */
-  nsAccessNode* GetCachedAccessNode(nsINode *aNode,
-                                    nsIWeakReference *aShell);
-
-  /**
    * Initialize an accessible and cache it. The method should be called for
    * every created accessible.
    *
    * @param  aAccessible    [in] accessible to initialize.
    * @param  aRoleMapEntry  [in] the role map entry role the ARIA role or nsnull
    *                          if none
    *
    * @return true if the accessible was initialized, otherwise false
    */
   PRBool InitAccessible(nsAccessible *aAccessible,
                         nsRoleMapEntry *aRoleMapEntry);
 
+protected:
+  /**
+   * Return an accessible for the DOM node in the given presentation shell if
+   * the accessible already exists, otherwise null.
+   *
+   * @param  aNode       [in] the DOM node to get an access node for
+   * @param  aPresShell  [in] the presentation shell which contains layout info
+   *                       for the DOM node
+   */
+  nsAccessible *GetCachedAccessible(nsINode *aNode,
+                                    nsIWeakReference *aShell);
+
 private:
   // nsAccessibilityService creation is controlled by friend
   // NS_GetAccessibilityService, keep constructors private.
   nsAccessibilityService();
   nsAccessibilityService(const nsAccessibilityService&);
   nsAccessibilityService& operator =(const nsAccessibilityService&);
 
 private:
--- a/accessible/src/base/nsAccessible.cpp
+++ b/accessible/src/base/nsAccessible.cpp
@@ -429,30 +429,16 @@ nsAccessible::GetKeyboardShortcut(nsAStr
     propertyKey.AssignLiteral("VK_CONTROL");
     nsAccessible::GetFullKeyName(propertyKey, accesskey, accesskey);
   }
 
   aAccessKey = accesskey;
   return NS_OK;
 }
 
-nsresult
-nsAccessible::Shutdown()
-{
-  // Invalidate the child count and pointers to other accessibles, also make
-  // sure none of its children point to this parent
-  InvalidateChildren();
-  if (mParent) {
-    mParent->InvalidateChildren();
-    mParent = nsnull;
-  }
-
-  return nsAccessNodeWrap::Shutdown();
-}
-
 NS_IMETHODIMP
 nsAccessible::GetParent(nsIAccessible **aParent)
 {
   NS_ENSURE_ARG_POINTER(aParent);
 
   NS_IF_ADDREF(*aParent = GetParent());
   return *aParent ? NS_OK : NS_ERROR_FAILURE;
 }
@@ -2667,16 +2653,66 @@ nsAccessible::AppendTextTo(nsAString& aT
   } else {
     aText += kEmbeddedObjectChar;
   }
 
   return NS_OK;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
+// nsAccessNode public methods
+
+PRBool
+nsAccessible::Init()
+{
+  if (!nsAccessNodeWrap::Init())
+    return PR_FALSE;
+
+  nsDocAccessible *docAcc =
+    GetAccService()->GetDocAccessible(mContent->GetOwnerDoc());
+  NS_ASSERTION(docAcc, "Cannot cache new nsAccessible!");
+  if (!docAcc)
+    return PR_FALSE;
+
+  void *uniqueID = nsnull;
+  GetUniqueID(&uniqueID);
+
+  if (!docAcc->CacheAccessible(uniqueID, this))
+    return PR_FALSE;
+
+  // Make sure an ancestor in real content is cached so that
+  // nsDocAccessible::RefreshNodes() can find the anonymous subtree to release
+  // when the root node goes away. /Specific examples of where this is used:
+  // <input type="file"> and <xul:findbar>.
+  // XXX: remove this once we create correct accessible tree.
+  if (mContent && mContent->IsInAnonymousSubtree()) {
+    nsAccessible *parent = GetAccService()->GetContainerAccessible(mContent,
+                                                                   PR_TRUE);
+    if (parent)
+      parent->EnsureChildren();
+  }
+
+  return PR_TRUE;
+}
+
+void
+nsAccessible::Shutdown()
+{
+  // Invalidate the child count and pointers to other accessibles, also make
+  // sure none of its children point to this parent
+  InvalidateChildren();
+  if (mParent) {
+    mParent->InvalidateChildren();
+    mParent = nsnull;
+  }
+
+  nsAccessNodeWrap::Shutdown();
+}
+
+////////////////////////////////////////////////////////////////////////////////
 // nsAccessible public methods
 
 nsresult
 nsAccessible::GetARIAName(nsAString& aName)
 {
   // First check for label override via aria-label property
   nsAutoString label;
   if (mContent->GetAttr(kNameSpaceID_None, nsAccessibilityAtoms::aria_label,
@@ -2823,16 +2859,33 @@ nsAccessible::GetCachedFirstChild()
 {
   if (IsDefunct())
     return nsnull;
 
   return mChildren.SafeElementAt(0, nsnull);
 }
 
 
+#ifdef DEBUG
+PRBool
+nsAccessible::IsInCache()
+{
+  nsDocAccessible *docAccessible =
+    GetAccService()->GetDocAccessible(mContent->GetOwnerDoc());
+  if (!docAccessible)
+    return nsnull;
+
+  void *uniqueID = nsnull;
+  GetUniqueID(&uniqueID);
+
+  return docAccessible->GetCachedAccessible(uniqueID) ? PR_TRUE : PR_FALSE;
+}
+#endif
+
+
 ////////////////////////////////////////////////////////////////////////////////
 // nsAccessible protected methods
 
 void
 nsAccessible::CacheChildren()
 {
   nsAccTreeWalker walker(mWeakShell, mContent, GetAllowsAnonChildAccessibles());
 
--- a/accessible/src/base/nsAccessible.h
+++ b/accessible/src/base/nsAccessible.h
@@ -102,17 +102,18 @@ public:
   NS_DECL_NSIACCESSIBLEHYPERLINK
   NS_DECL_NSIACCESSIBLESELECTABLE
   NS_DECL_NSIACCESSIBLEVALUE
   NS_DECLARE_STATIC_IID_ACCESSOR(NS_ACCESSIBLE_IMPL_IID)
 
   //////////////////////////////////////////////////////////////////////////////
   // nsAccessNode
 
-  virtual nsresult Shutdown();
+  virtual PRBool Init();
+  virtual void Shutdown();
 
   //////////////////////////////////////////////////////////////////////////////
   // Public methods
 
   /**
    * Returns the accessible name specified by ARIA.
    */
   nsresult GetARIAName(nsAString& aName);
@@ -265,16 +266,23 @@ public:
    */
   nsAccessible* GetCachedParent();
 
   /**
    * Return first child accessible only if cached.
    */
   nsAccessible* GetCachedFirstChild();
 
+#ifdef DEBUG
+  /**
+   * Return true if the access node is cached.
+   */
+  PRBool IsInCache();
+#endif
+
   //////////////////////////////////////////////////////////////////////////////
   // Miscellaneous methods
 
   /**
    * Handle accessible event, i.e. process it, notifies observers and fires
    * platform specific event.
    */
   virtual nsresult HandleAccEvent(nsAccEvent *aAccEvent);
--- a/accessible/src/base/nsApplicationAccessible.cpp
+++ b/accessible/src/base/nsApplicationAccessible.cpp
@@ -352,28 +352,27 @@ nsApplicationAccessible::GetPlatformVers
 // nsAccessNode public methods
 
 PRBool
 nsApplicationAccessible::IsDefunct()
 {
   return nsAccessibilityService::IsShutdown();
 }
 
-nsresult
+PRBool
 nsApplicationAccessible::Init()
 {
   mAppInfo = do_GetService("@mozilla.org/xre/app-info;1");
-  return NS_OK;
+  return PR_TRUE;
 }
 
-nsresult
+void
 nsApplicationAccessible::Shutdown()
 {
   mAppInfo = nsnull;
-  return NS_OK;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsAccessible public methods
 
 nsresult
 nsApplicationAccessible::GetARIAState(PRUint32 *aState, PRUint32 *aExtraState)
 {
@@ -515,73 +514,16 @@ NS_IMETHODIMP
 nsApplicationAccessible::GetDOMNode(nsIDOMNode **aDOMNode)
 {
   NS_ENSURE_ARG_POINTER(aDOMNode);
   *aDOMNode = nsnull;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsApplicationAccessible::GetNumChildren(PRInt32 *aNumChildren)
-{
-  NS_ENSURE_ARG_POINTER(aNumChildren);
-  *aNumChildren = 0;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsApplicationAccessible::GetChildNodeAt(PRInt32 aChildNum,
-                                        nsIAccessNode **aChildNode)
-{
-  NS_ENSURE_ARG_POINTER(aChildNode);
-  *aChildNode = nsnull;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsApplicationAccessible::GetParentNode(nsIAccessNode **aParentNode)
-{
-  NS_ENSURE_ARG_POINTER(aParentNode);
-  *aParentNode = nsnull;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsApplicationAccessible::GetFirstChildNode(nsIAccessNode **aFirstChildNode)
-{
-  NS_ENSURE_ARG_POINTER(aFirstChildNode);
-  *aFirstChildNode = nsnull;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsApplicationAccessible::GetLastChildNode(nsIAccessNode **aLastChildNode)
-{
-  NS_ENSURE_ARG_POINTER(aLastChildNode);
-  *aLastChildNode = nsnull;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsApplicationAccessible::GetPreviousSiblingNode(nsIAccessNode **aPreviousSiblingNode)
-{
-  NS_ENSURE_ARG_POINTER(aPreviousSiblingNode);
-  *aPreviousSiblingNode = nsnull;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsApplicationAccessible::GetNextSiblingNode(nsIAccessNode **aNextSiblingNode)
-{
-  NS_ENSURE_ARG_POINTER(aNextSiblingNode);
-  *aNextSiblingNode = nsnull;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
 nsApplicationAccessible::GetDocument(nsIAccessibleDocument **aDocument)
 {
   NS_ENSURE_ARG_POINTER(aDocument);
   *aDocument = nsnull;
   return NS_OK;
 }
 
 NS_IMETHODIMP
--- a/accessible/src/base/nsApplicationAccessible.h
+++ b/accessible/src/base/nsApplicationAccessible.h
@@ -101,18 +101,18 @@ public:
   NS_IMETHOD GetActionDescription(PRUint8 aIndex, nsAString &aDescription);
   NS_IMETHOD DoAction(PRUint8 aIndex);
 
   // nsIAccessibleApplication
   NS_DECL_NSIACCESSIBLEAPPLICATION
 
   // nsAccessNode
   virtual PRBool IsDefunct();
-  virtual nsresult Init();
-  virtual nsresult Shutdown();
+  virtual PRBool Init();
+  virtual void Shutdown();
 
   // nsAccessible
   virtual nsresult GetARIAState(PRUint32 *aState, PRUint32 *aExtraState);
   virtual nsresult GetRoleInternal(PRUint32 *aRole);
   virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
   virtual nsAccessible* GetParent();
 
   virtual void InvalidateChildren();
--- a/accessible/src/base/nsBaseWidgetAccessible.cpp
+++ b/accessible/src/base/nsBaseWidgetAccessible.cpp
@@ -223,28 +223,28 @@ nsLinkableAccessible::GetURI(PRInt32 aIn
   }
   
   return NS_ERROR_INVALID_ARG;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsLinkableAccessible. nsAccessNode
 
-nsresult
+PRBool
 nsLinkableAccessible::Init()
 {
   CacheActionContent();
   return nsAccessibleWrap::Init();
 }
 
-nsresult
+void
 nsLinkableAccessible::Shutdown()
 {
   mActionContent = nsnull;
-  return nsAccessibleWrap::Shutdown();
+  nsAccessibleWrap::Shutdown();
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsLinkableAccessible
 
 void
 nsLinkableAccessible::CacheActionContent()
 {
--- a/accessible/src/base/nsBaseWidgetAccessible.h
+++ b/accessible/src/base/nsBaseWidgetAccessible.h
@@ -93,18 +93,18 @@ public:
   NS_IMETHOD GetValue(nsAString& _retval);
   NS_IMETHOD TakeFocus();
   NS_IMETHOD GetKeyboardShortcut(nsAString& _retval);
 
   // nsIAccessibleHyperLink
   NS_IMETHOD GetURI(PRInt32 i, nsIURI **aURI);
 
   // nsAccessNode
-  virtual nsresult Init();
-  virtual nsresult Shutdown();
+  virtual PRBool Init();
+  virtual void Shutdown();
 
   // nsAccessible
   virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
 
 protected:
   /**
    * Return an accessible for cached action node.
    */
--- a/accessible/src/base/nsDocAccessible.cpp
+++ b/accessible/src/base/nsDocAccessible.cpp
@@ -88,17 +88,17 @@ nsIAtom *nsDocAccessible::gLastFocusedFr
 
 nsDocAccessible::
   nsDocAccessible(nsIDocument *aDocument, nsIContent *aRootContent,
                   nsIWeakReference *aShell) :
   nsHyperTextAccessibleWrap(aRootContent, aShell), mWnd(nsnull),
   mDocument(aDocument), mIsLoaded(PR_FALSE), mScrollPositionChangedTicks(0)
 {
   // XXX aaronl should we use an algorithm for the initial cache size?
-  mAccessNodeCache.Init(kDefaultCacheSize);
+  mAccessibleCache.Init(kDefaultCacheSize);
 
   // For GTK+ native window, we do nothing here.
   if (!mDocument)
     return;
 
   // Initialize mWnd
   nsCOMPtr<nsIPresShell> shell(do_QueryReferent(mWeakShell));
   nsIViewManager* vm = shell->GetViewManager();
@@ -124,22 +124,22 @@ nsDocAccessible::~nsDocAccessible()
 // nsISupports
 
 NS_IMPL_CYCLE_COLLECTION_CLASS(nsDocAccessible)
 
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsDocAccessible, nsAccessible)
   NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mEventQueue");
   cb.NoteXPCOMChild(tmp->mEventQueue.get());
 
-  CycleCollectorTraverseCache(tmp->mAccessNodeCache, &cb);
+  CycleCollectorTraverseCache(tmp->mAccessibleCache, &cb);
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(nsDocAccessible, nsAccessible)
   NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mEventQueue)
-  ClearCache(tmp->mAccessNodeCache);
+  ClearCache(tmp->mAccessibleCache);
 NS_IMPL_CYCLE_COLLECTION_UNLINK_END
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(nsDocAccessible)
   NS_INTERFACE_MAP_STATIC_AMBIGUOUS(nsDocAccessible)
   NS_INTERFACE_MAP_ENTRY(nsIAccessibleDocument)
   NS_INTERFACE_MAP_ENTRY(nsIDocumentObserver)
   NS_INTERFACE_MAP_ENTRY(nsIMutationObserver)
   NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
@@ -528,102 +528,102 @@ NS_IMETHODIMP nsDocAccessible::GetAssoci
   PRBool isEditable;
   editor->GetIsDocumentEditable(&isEditable);
   if (isEditable) {
     NS_ADDREF(*aEditor = editor);
   }
   return NS_OK;
 }
 
-nsAccessNode*
-nsDocAccessible::GetCachedAccessNode(void *aUniqueID)
+nsAccessible *
+nsDocAccessible::GetCachedAccessible(void *aUniqueID)
 {
-  nsAccessNode* accessNode = mAccessNodeCache.GetWeak(aUniqueID);
+  nsAccessible* accessible = mAccessibleCache.GetWeak(aUniqueID);
 
   // No accessible in the cache, check if the given ID is unique ID of this
-  // document accesible.
-  if (!accessNode) {
+  // document accessible.
+  if (!accessible) {
     void* thisUniqueID = nsnull;
     GetUniqueID(&thisUniqueID);
-    if (thisUniqueID == aUniqueID)
-      accessNode = this;
+    if (thisUniqueID != aUniqueID)
+      return nsnull;
+
+    accessible = this;
   }
 
 #ifdef DEBUG
   // All cached accessible nodes should be in the parent
   // It will assert if not all the children were created
   // when they were first cached, and no invalidation
   // ever corrected parent accessible's child cache.
-  nsRefPtr<nsAccessible> acc = do_QueryObject(accessNode);
-
-  if (acc) {
-    nsAccessible* parent(acc->GetCachedParent());
-    if (parent)
-      parent->TestChildCache(acc);
-  }
+  nsAccessible* parent(accessible->GetCachedParent());
+  if (parent)
+    parent->TestChildCache(accessible);
 #endif
 
-  return accessNode;
+  return accessible;
 }
 
 // nsDocAccessible public method
 PRBool
-nsDocAccessible::CacheAccessNode(void *aUniqueID, nsAccessNode *aAccessNode)
+nsDocAccessible::CacheAccessible(void *aUniqueID, nsAccessible *aAccessible)
 {
-  // If there is already an access node with the given unique ID, shut it down
+  // If there is already an accessible with the given unique ID, shut it down
   // because the DOM node has changed.
-  nsAccessNode* accessNode = mAccessNodeCache.GetWeak(aUniqueID);
-  if (accessNode)
-    accessNode->Shutdown();
+  nsAccessible *accessible = mAccessibleCache.GetWeak(aUniqueID);
+  NS_ASSERTION(!accessible,
+               "Caching new accessible for the DOM node while the old one is alive");
 
-  return mAccessNodeCache.Put(aUniqueID, aAccessNode);
+  if (accessible)
+    accessible->Shutdown();
+
+  return mAccessibleCache.Put(aUniqueID, aAccessible);
 }
 
 // nsDocAccessible public method
 void
-nsDocAccessible::RemoveAccessNodeFromCache(nsIAccessNode *aAccessNode)
+nsDocAccessible::RemoveAccessNodeFromCache(nsAccessible *aAccessible)
 {
-  if (!aAccessNode)
+  if (!aAccessible)
     return;
 
   void *uniqueID = nsnull;
-  aAccessNode->GetUniqueID(&uniqueID);
-  mAccessNodeCache.Remove(uniqueID);
+  aAccessible->GetUniqueID(&uniqueID);
+  mAccessibleCache.Remove(uniqueID);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsAccessNode
 
-nsresult
+PRBool
 nsDocAccessible::Init()
 {
   // Initialize event queue.
   mEventQueue = new nsAccEventQueue(this);
   if (!mEventQueue)
-    return NS_ERROR_OUT_OF_MEMORY;
+    return PR_FALSE;
 
   AddEventListeners();
 
   // Fire reorder event to notify new accessible document has been created and
   // attached to the tree.
   nsRefPtr<nsAccEvent> reorderEvent =
     new nsAccReorderEvent(mParent, PR_FALSE, PR_TRUE, mDocument);
   if (!reorderEvent)
-    return NS_ERROR_OUT_OF_MEMORY;
+    return PR_FALSE;
 
   FireDelayedAccessibleEvent(reorderEvent);
-  return NS_OK;
+  return PR_TRUE;
 }
 
-nsresult
+void
 nsDocAccessible::Shutdown()
 {
-  if (!mWeakShell) {
-    return NS_OK;  // Already shutdown
-  }
+  if (!mWeakShell) // already shutdown
+    return;
 
   NS_LOG_ACCDOCDESTROY_FOR("document shutdown", mDocument, this)
 
   if (mEventQueue) {
     mEventQueue->Shutdown();
     mEventQueue = nsnull;
   }
 
@@ -631,23 +631,22 @@ nsDocAccessible::Shutdown()
 
   if (mParent) {
     NS_LOG_ACCDOCDESTROY_FOR("remove document from outer doc", mDocument, this);
     mParent->RemoveChild(this);
   }
 
   mWeakShell = nsnull;  // Avoid reentrancy
 
-  ClearCache(mAccessNodeCache);
+  ClearCache(mAccessibleCache);
 
   nsCOMPtr<nsIDocument> kungFuDeathGripDoc = mDocument;
   mDocument = nsnull;
 
   nsHyperTextAccessibleWrap::Shutdown();
-  return NS_OK;
 }
 
 nsIFrame*
 nsDocAccessible::GetFrame()
 {
   nsCOMPtr<nsIPresShell> shell(do_QueryReferent(mWeakShell));
 
   nsIFrame* root = nsnull;
@@ -1184,17 +1183,17 @@ nsDocAccessible::ARIAAttributeChanged(ns
   }
 }
 
 void nsDocAccessible::ContentAppended(nsIDocument *aDocument,
                                       nsIContent* aContainer,
                                       nsIContent* aFirstNewContent,
                                       PRInt32 /* unused */)
 {
-  if (!IsContentLoaded() && mAccessNodeCache.Count() <= 1) {
+  if (!IsContentLoaded() && mAccessibleCache.Count() <= 1) {
     // See comments in nsDocAccessible::InvalidateCacheSubtree
     InvalidateChildren();
     return;
   }
 
   // Does this need to be a strong ref?  If so, why?
   for (nsIContent* cur = aFirstNewContent; cur; cur = cur->GetNextSibling()) {
     // InvalidateCacheSubtree will not fire the EVENT_SHOW for the new node
@@ -1610,40 +1609,38 @@ nsDocAccessible::ProcessPendingEvent(nsA
       }
     }
   }
 }
 
 void
 nsDocAccessible::InvalidateChildrenInSubtree(nsINode *aStartNode)
 {
-  nsRefPtr<nsAccessible> acc = do_QueryObject(GetCachedAccessNode(aStartNode));
-  if (acc)
-    acc->InvalidateChildren();
+  nsAccessible *accessible = GetCachedAccessible(aStartNode);
+  if (accessible)
+    accessible->InvalidateChildren();
 
   // Invalidate accessible children in the DOM subtree 
   PRInt32 index, numChildren = aStartNode->GetChildCount();
   for (index = 0; index < numChildren; index ++) {
     nsINode *childNode = aStartNode->GetChildAt(index);
     InvalidateChildrenInSubtree(childNode);
   }
 }
 
 void
 nsDocAccessible::RefreshNodes(nsINode *aStartNode)
 {
-  if (mAccessNodeCache.Count() <= 1) {
+  if (mAccessibleCache.Count() <= 1) {
     return; // All we have is a doc accessible. There is nothing to invalidate, quit early
   }
 
-  nsRefPtr<nsAccessNode> accessNode = GetCachedAccessNode(aStartNode);
-
-  // Shut down accessible subtree, which may have been created for
-  // anonymous content subtree
-  nsRefPtr<nsAccessible> accessible = do_QueryObject(accessNode);
+  // Shut down accessible subtree, which may have been created for anonymous
+  // content subtree.
+  nsAccessible *accessible = GetCachedAccessible(aStartNode);
   if (accessible) {
     // Fire menupopup end if a menu goes away
     PRUint32 role = nsAccUtils::Role(accessible);
     if (role == nsIAccessibleRole::ROLE_MENUPOPUP) {
       nsCOMPtr<nsIDOMXULPopupElement> popup(do_QueryInterface(aStartNode));
       if (!popup) {
         // Popup elements already fire these via DOMMenuInactive
         // handling in nsRootAccessible::HandleEvent
@@ -1682,35 +1679,35 @@ nsDocAccessible::RefreshNodes(nsINode *a
   // Shutdown ordinary content subtree as well -- there may be
   // access node children which are not full accessible objects
   PRUint32 childCount = aStartNode->GetChildCount();
   for (PRUint32 childIdx = 0; childIdx < childCount; childIdx++) {
     nsIContent *childContent = aStartNode->GetChildAt(childIdx);
     RefreshNodes(childContent);
   }
 
-  if (!accessNode)
+  if (!accessible)
     return;
 
-  if (accessNode == this) {
+  if (accessible == this) {
     // Don't shutdown our doc object -- this may just be from the finished loading.
     // We will completely shut it down when the pagehide event is received
     // However, we must invalidate the doc accessible's children in order to be sure
     // all pointers to them are correct
     InvalidateChildren();
     return;
   }
 
   // Shut down the actual accessible or access node
   void *uniqueID;
-  accessNode->GetUniqueID(&uniqueID);
-  accessNode->Shutdown();
+  accessible->GetUniqueID(&uniqueID);
+  accessible->Shutdown();
 
   // Remove from hash table as well
-  mAccessNodeCache.Remove(uniqueID);
+  mAccessibleCache.Remove(uniqueID);
 }
 
 // nsDocAccessible public member
 void
 nsDocAccessible::InvalidateCacheSubtree(nsIContent *aChild,
                                         PRUint32 aChangeType)
 {
   PRBool isHiding =
@@ -1744,17 +1741,17 @@ nsDocAccessible::InvalidateCacheSubtree(
   if (!childNode)
     childNode = mDocument;
 
   nsCOMPtr<nsIPresShell> presShell = GetPresShell();
   NS_ENSURE_TRUE(presShell,);
   
   if (!IsContentLoaded()) {
     // Still loading document
-    if (mAccessNodeCache.Count() <= 1) {
+    if (mAccessibleCache.Count() <= 1) {
       // Still loading and no accessibles has yet been created other than this
       // doc accessible. In this case we optimize
       // by not firing SHOW/HIDE/REORDER events for every document mutation
       // caused by page load, since AT is not going to want to grab the
       // document and listen to these changes until after the page is first loaded
       // Leave early, and ensure mAccChildCount stays uninitialized instead of 0,
       // which it is if anyone asks for its children right now.
       InvalidateChildren();
@@ -1778,18 +1775,17 @@ nsDocAccessible::InvalidateCacheSubtree(
       return;
     }     
     // else: user input, so we must fall through and for full handling,
     // e.g. fire the mutation events. Note: user input could cause DOM_CREATE
     // during page load if user typed into an input field or contentEditable area
   }
 
   // Update last change state information
-  nsRefPtr<nsAccessible> childAccessible =
-    do_QueryObject(GetCachedAccessNode(childNode));
+  nsAccessible *childAccessible = GetCachedAccessible(childNode);
 
 #ifdef DEBUG_A11Y
   nsAutoString localName;
   if (aChild)
     aChild->NodeInfo()->GetName(localName);
   const char *hasAccessible = childAccessible ? " (acc)" : "";
   if (aChangeType == nsIAccessibilityService::FRAME_HIDE)
     printf("[Hide %s %s]\n", NS_ConvertUTF16toUTF8(localName).get(), hasAccessible);
@@ -1939,21 +1935,21 @@ nsDocAccessible::FireShowHideEvents(nsIN
                                     PRBool aAvoidOnThisNode,
                                     PRUint32 aEventType,
                                     EEventFiringType aDelayedOrNormal,
                                     PRBool aIsAsyncChange,
                                     EIsFromUserInput aIsFromUserInput)
 {
   NS_ENSURE_ARG(aNode);
 
-  nsRefPtr<nsAccessible> accessible;
+  nsAccessible *accessible = nsnull;
   if (!aAvoidOnThisNode) {
     if (aEventType == nsIAccessibleEvent::EVENT_HIDE) {
       // Don't allow creation for accessibles when nodes going away
-      accessible = do_QueryObject(GetCachedAccessNode(aNode));
+      accessible = GetCachedAccessible(aNode);
     } else {
       // Allow creation of new accessibles for show events
       accessible = GetAccService()->GetAttachedAccessibleFor(aNode);
     }
   }
 
   if (accessible) {
     // Found an accessible, so fire the show/hide on it and don't look further
--- a/accessible/src/base/nsDocAccessible.h
+++ b/accessible/src/base/nsDocAccessible.h
@@ -96,18 +96,18 @@ public:
   // nsIScrollPositionListener
   virtual void ScrollPositionWillChange(nscoord aX, nscoord aY) {}
   virtual void ScrollPositionDidChange(nscoord aX, nscoord aY);
 
   // nsIDocumentObserver
   NS_DECL_NSIDOCUMENTOBSERVER
 
   // nsAccessNode
-  virtual nsresult Init();
-  virtual nsresult Shutdown();
+  virtual PRBool Init();
+  virtual void Shutdown();
   virtual nsIFrame* GetFrame();
   virtual PRBool IsDefunct();
   virtual nsINode* GetNode() const { return mDocument; }
 
   // nsAccessible
   virtual nsresult GetRoleInternal(PRUint32 *aRole);
   virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
   virtual nsresult GetARIAState(PRUint32 *aState, PRUint32 *aExtraState);
@@ -173,41 +173,41 @@ public:
    *
    * @param aContent  [in] the child that is changing
    * @param aEvent    [in] the event from nsIAccessibleEvent that caused
    *                   the change.
    */
   void InvalidateCacheSubtree(nsIContent *aContent, PRUint32 aEvent);
 
   /**
-   * Return the cached access node by the given unique ID if it's in subtree of
+   * Return the cached accessible by the given unique ID if it's in subtree of
    * this document accessible or the document accessible itself, otherwise null.
    *
    * @note   the unique ID matches with the uniqueID attribute on nsIAccessNode
    *
    * @param  aUniqueID  [in] the unique ID used to cache the node.
    *
-   * @return the access node object
+   * @return the accessible object
    */
-  nsAccessNode* GetCachedAccessNode(void *aUniqueID);
+  nsAccessible* GetCachedAccessible(void *aUniqueID);
 
   /**
-   * Cache the access node.
+   * Cache the accessible.
    *
    * @param  aUniquID     [in] the unique identifier of accessible
-   * @param  aAccessNode  [in] accessible to cache
+   * @param  aAccessible  [in] accessible to cache
    *
-   * @return true if node beign cached, otherwise false
+   * @return true if accessible being cached, otherwise false
    */
-  PRBool CacheAccessNode(void *aUniqueID, nsAccessNode *aAccessNode);
+  PRBool CacheAccessible(void *aUniqueID, nsAccessible *aAccessible);
 
   /**
-   * Remove the given access node from document cache.
+   * Remove the given accessible from document cache.
    */
-  void RemoveAccessNodeFromCache(nsIAccessNode *aAccessNode);
+  void RemoveAccessNodeFromCache(nsAccessible *aAccessible);
 
   /**
    * Process the event when the queue of pending events is untwisted. Fire
    * accessible events as result of the processing.
    */
   void ProcessPendingEvent(nsAccEvent* aEvent);
 
 protected:
@@ -312,17 +312,21 @@ protected:
                               EIsFromUserInput aIsFromUserInput = eAutoDetect);
 
   /**
    * Fire a value change event for the the given accessible if it is a text
    * field (has a ROLE_ENTRY).
    */
   void FireValueChangeForTextFields(nsAccessible *aAccessible);
 
-    nsAccessNodeHashtable mAccessNodeCache;
+  /**
+   * Cache of accessibles within this document accessible.
+   */
+  nsAccessibleHashtable mAccessibleCache;
+
     void *mWnd;
     nsCOMPtr<nsIDocument> mDocument;
     nsCOMPtr<nsITimer> mScrollWatchTimer;
     PRUint16 mScrollPositionChangedTicks; // Used for tracking scroll events
 
 protected:
 
   nsRefPtr<nsAccEventQueue> mEventQueue;
--- a/accessible/src/base/nsOuterDocAccessible.cpp
+++ b/accessible/src/base/nsOuterDocAccessible.cpp
@@ -151,31 +151,31 @@ NS_IMETHODIMP
 nsOuterDocAccessible::DoAction(PRUint8 aIndex)
 {
   return NS_ERROR_INVALID_ARG;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsAccessNode public
 
-nsresult
+void
 nsOuterDocAccessible::Shutdown()
 {
   // Shutdown child document if any.
   nsAccessible *childAcc = mChildren.SafeElementAt(0, nsnull);
   if (childAcc) {
     nsRefPtr<nsDocAccessible> docAcc(do_QueryObject(childAcc));
     NS_LOG_ACCDOCDESTROY_FOR("outerdoc document shutdown",
                              docAcc->GetDOMDocument(), docAcc.get())
     GetAccService()->ShutdownDocAccessiblesInTree(docAcc->GetDOMDocument());
   }
 
   nsAccessible::InvalidateChildren();
 
-  return nsAccessibleWrap::Shutdown();
+  nsAccessibleWrap::Shutdown();
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsAccessible public
 
 void
 nsOuterDocAccessible::InvalidateChildren()
 {
--- a/accessible/src/base/nsOuterDocAccessible.h
+++ b/accessible/src/base/nsOuterDocAccessible.h
@@ -59,17 +59,17 @@ public:
 
   // nsIAccessible
   NS_IMETHOD GetNumActions(PRUint8 *aNumActions);
   NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
   NS_IMETHOD GetActionDescription(PRUint8 aIndex, nsAString& aDescription);
   NS_IMETHOD DoAction(PRUint8 aIndex);
 
   // nsAccessNode
-  virtual nsresult Shutdown();
+  virtual void Shutdown();
 
   // nsAccessible
   virtual nsresult GetRoleInternal(PRUint32 *aRole);
   virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
   virtual nsresult GetAttributesInternal(nsIPersistentProperties *aAttributes);
   virtual nsresult GetChildAtPoint(PRInt32 aX, PRInt32 aY,
                                    PRBool aDeepestChild,
                                    nsIAccessible **aChild);
--- a/accessible/src/base/nsRootAccessible.cpp
+++ b/accessible/src/base/nsRootAccessible.cpp
@@ -812,43 +812,44 @@ void nsRootAccessible::GetTargetNode(nsI
   }
 
   NS_ADDREF(*aTargetNode = eventTarget);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsAccessNode
 
-nsresult
+PRBool
 nsRootAccessible::Init()
 {
   nsApplicationAccessible *applicationAcc = GetApplicationAccessible();
-  NS_ENSURE_STATE(applicationAcc);
+  if (!applicationAcc)
+    return PR_FALSE;
 
   applicationAcc->AddRootAccessible(this);
 
   return nsDocAccessibleWrap::Init();
 }
 
-nsresult
+void
 nsRootAccessible::Shutdown()
 {
   // Called manually or by nsAccessNode::LastRelease()
-  if (!mWeakShell) {
-    return NS_OK;  // Already shutdown
-  }
+  if (!mWeakShell)
+    return;  // Already shutdown
 
   nsApplicationAccessible *applicationAcc = GetApplicationAccessible();
-  NS_ENSURE_STATE(applicationAcc);
+  if (!applicationAcc)
+    return;
 
   applicationAcc->RemoveRootAccessible(this);
 
   mCurrentARIAMenubar = nsnull;
 
-  return nsDocAccessibleWrap::Shutdown();
+  nsDocAccessibleWrap::Shutdown();
 }
 
 // nsRootAccessible protected member
 already_AddRefed<nsIDocShellTreeItem>
 nsRootAccessible::GetContentDocShell(nsIDocShellTreeItem *aStart)
 {
   if (!aStart) {
     return nsnull;
--- a/accessible/src/base/nsRootAccessible.h
+++ b/accessible/src/base/nsRootAccessible.h
@@ -76,18 +76,18 @@ public:
   NS_IMETHOD GetName(nsAString& aName);
   NS_IMETHOD GetRelationByType(PRUint32 aRelationType,
                                nsIAccessibleRelation **aRelation);
 
   // nsIDOMEventListener
   NS_IMETHOD HandleEvent(nsIDOMEvent* aEvent);
 
   // nsAccessNode
-  virtual nsresult Init();
-  virtual nsresult Shutdown();
+  virtual PRBool Init();
+  virtual void Shutdown();
 
   // nsAccessible
   virtual nsresult GetRoleInternal(PRUint32 *aRole);
   virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
   virtual nsAccessible* GetParent();
 
   // nsRootAccessible
   NS_DECLARE_STATIC_IID_ACCESSOR(NS_ROOTACCESSIBLE_IMPL_CID)
--- a/accessible/src/html/nsHTMLImageMapAccessible.cpp
+++ b/accessible/src/html/nsHTMLImageMapAccessible.cpp
@@ -144,18 +144,17 @@ nsHTMLImageMapAccessible::CacheChildren(
       return;
 
     nsCOMPtr<nsIContent> areaContent(do_QueryInterface(areaNode));
     nsRefPtr<nsAccessible> areaAcc =
       new nsHTMLAreaAccessible(areaContent, mWeakShell);
     if (!areaAcc)
       return;
 
-    nsresult rv = areaAcc->Init();
-    if (NS_FAILED(rv)) {
+    if (!areaAcc->Init()) {
       areaAcc->Shutdown();
       return;
     }
 
     // We must respect ARIA on area elements (for the canvas map technique)
     areaAcc->SetRoleMapEntry(nsAccUtils::GetRoleMapEntry(areaContent));
 
     mChildren.AppendElement(areaAcc);
--- a/accessible/src/html/nsHTMLSelectAccessible.cpp
+++ b/accessible/src/html/nsHTMLSelectAccessible.cpp
@@ -920,26 +920,25 @@ nsHTMLComboboxAccessible::CacheChildren(
 
     mListAccessible->Init();
   }
 
   mChildren.AppendElement(mListAccessible);
   mListAccessible->SetParent(this);
 }
 
-nsresult
+void
 nsHTMLComboboxAccessible::Shutdown()
 {
   nsAccessibleWrap::Shutdown();
 
   if (mListAccessible) {
     mListAccessible->Shutdown();
     mListAccessible = nsnull;
   }
-  return NS_OK;
 }
 
 /**
   * As a nsHTMLComboboxAccessible we can have the following states:
   *     STATE_FOCUSED
   *     STATE_FOCUSABLE
   *     STATE_HASPOPUP
   *     STATE_EXPANDED
--- a/accessible/src/html/nsHTMLSelectAccessible.h
+++ b/accessible/src/html/nsHTMLSelectAccessible.h
@@ -227,17 +227,17 @@ public:
   // nsIAccessible
   NS_IMETHOD GetValue(nsAString& _retval);
   NS_IMETHOD GetDescription(nsAString& aDescription);
   NS_IMETHOD DoAction(PRUint8 index);
   NS_IMETHOD GetNumActions(PRUint8 *aNumActions);
   NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
 
   // nsAccessNode
-  virtual nsresult Shutdown();
+  virtual void Shutdown();
 
   // nsAccessible
   virtual nsresult GetRoleInternal(PRUint32 *aRole);
   virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
 
 protected:
   // nsAccessible
   virtual void CacheChildren();
--- a/accessible/src/html/nsHTMLTextAccessible.cpp
+++ b/accessible/src/html/nsHTMLTextAccessible.cpp
@@ -215,27 +215,26 @@ nsHTMLLIAccessible::
                                                        aBulletText);
     if (mBulletAccessible)
       mBulletAccessible->Init();
   }
 }
 
 NS_IMPL_ISUPPORTS_INHERITED0(nsHTMLLIAccessible, nsHyperTextAccessible)
 
-nsresult
+void
 nsHTMLLIAccessible::Shutdown()
 {
   if (mBulletAccessible) {
     // Ensure that pointer to this is nulled out.
     mBulletAccessible->Shutdown();
   }
 
-  nsresult rv = nsHyperTextAccessibleWrap::Shutdown();
+  nsHyperTextAccessibleWrap::Shutdown();
   mBulletAccessible = nsnull;
-  return rv;
 }
 
 nsresult
 nsHTMLLIAccessible::GetRoleInternal(PRUint32 *aRole)
 {
   *aRole = nsIAccessibleRole::ROLE_LISTITEM;
   return NS_OK;
 }
@@ -298,21 +297,21 @@ NS_IMETHODIMP
 nsHTMLListBulletAccessible::GetUniqueID(void **aUniqueID)
 {
   // Since mContent is same as for list item, use |this| pointer as the unique
   // id.
   *aUniqueID = static_cast<void*>(this);
   return NS_OK;
 }
 
-nsresult
+void
 nsHTMLListBulletAccessible::Shutdown()
 {
   mBulletText.Truncate();
-  return nsLeafAccessible::Shutdown();
+  nsLeafAccessible::Shutdown();
 }
 
 NS_IMETHODIMP
 nsHTMLListBulletAccessible::GetName(nsAString &aName)
 {
   // Native anonymous content, ARIA can't be used.
   aName = mBulletText;
   return NS_OK;
--- a/accessible/src/html/nsHTMLTextAccessible.h
+++ b/accessible/src/html/nsHTMLTextAccessible.h
@@ -116,17 +116,17 @@ public:
 
   // nsIAccessNode
   NS_IMETHOD GetUniqueID(void **aUniqueID);
 
   // nsIAccessible
   NS_IMETHOD GetName(nsAString& aName);
 
   // nsAccessNode
-  virtual nsresult Shutdown();
+  virtual void Shutdown();
 
   // nsAccessible
   virtual nsresult GetRoleInternal(PRUint32 *aRole);
   virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
   virtual nsresult AppendTextTo(nsAString& aText, PRUint32 aStartOffset,
                                 PRUint32 aLength);
 
   virtual nsAccessible* GetParent();
@@ -168,17 +168,17 @@ public:
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIAccessible
   NS_IMETHOD GetBounds(PRInt32 *x, PRInt32 *y, PRInt32 *width, PRInt32 *height);
 
   // nsAccessNode
-  virtual nsresult Shutdown();
+  virtual void Shutdown();
 
   // nsAccessible
   virtual nsresult GetRoleInternal(PRUint32 *aRole);
   virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
 
 protected:
   // nsAccessible
   virtual void CacheChildren();
--- a/accessible/src/mac/nsAccessibleWrap.h
+++ b/accessible/src/mac/nsAccessibleWrap.h
@@ -70,17 +70,17 @@ class nsAccessibleWrap : public nsAccess
     // the objective-c |Class| type that this accessible's native object
     // should be instantied with.   used on runtime to determine the
     // right type for this accessible's associated native object.
     virtual objc_class* GetNativeType ();
     
     // returns a pointer to the native window for this accessible tree.
     void GetNativeWindow (void **aOutNativeWindow);
     
-    virtual nsresult Shutdown ();
+    virtual void Shutdown ();
     virtual void InvalidateChildren();
 
     virtual nsresult HandleAccEvent(nsAccEvent *aEvent);
 
     // ignored means that the accessible might still have children, but is not displayed
     // to the user. it also has no native accessible object represented for it.
     PRBool IsIgnored();
     
--- a/accessible/src/mac/nsAccessibleWrap.mm
+++ b/accessible/src/mac/nsAccessibleWrap.mm
@@ -55,29 +55,30 @@ nsAccessibleWrap::
 nsAccessibleWrap::~nsAccessibleWrap()
 {
   if (mNativeWrapper) {
     delete mNativeWrapper;
     mNativeWrapper = nsnull;
   }
 }
 
-nsresult
+PRBool
 nsAccessibleWrap::Init () 
 {
-  // need to pass the call up, so we're cached (which nsAccessNode::Init() takes care of).
-  nsresult rv = nsAccessible::Init();
-  NS_ENSURE_SUCCESS(rv, rv);
-  
+  if (!nsAccessible::Init())
+    return PR_FALSE;
+
   if (!mNativeWrapper && !AncestorIsFlat()) {
     // Create our native object using the class type specified in GetNativeType().
     mNativeWrapper = new AccessibleWrapper (this, GetNativeType());
+    if (!mNativeWrapper)
+      return PR_FALSE;
   }
 
-  return NS_OK;
+  return PR_TRUE;
 }
 
 NS_IMETHODIMP
 nsAccessibleWrap::GetNativeInterface (void **aOutInterface) 
 {
   if (mNativeWrapper) {
     *aOutInterface = (void**)mNativeWrapper->getNativeObject();
     return NS_OK;
@@ -143,25 +144,25 @@ nsAccessibleWrap::GetNativeType ()
   return nil;
 
   NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
 }
 
 // this method is very important. it is fired when an accessible object "dies". after this point
 // the object might still be around (because some 3rd party still has a ref to it), but it is
 // in fact 'dead'.
-nsresult
+void
 nsAccessibleWrap::Shutdown ()
 {
   if (mNativeWrapper) {
     delete mNativeWrapper;
     mNativeWrapper = nsnull;
   }
   
-  return nsAccessible::Shutdown();
+  nsAccessible::Shutdown();
 }
 
 nsresult
 nsAccessibleWrap::HandleAccEvent(nsAccEvent *aEvent)
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
 
   nsresult rv = nsAccessible::HandleAccEvent(aEvent);
--- a/accessible/src/mac/nsDocAccessibleWrap.h
+++ b/accessible/src/mac/nsDocAccessibleWrap.h
@@ -43,17 +43,17 @@
 
 class nsDocAccessibleWrap: public nsDocAccessible
 {
 public:
   nsDocAccessibleWrap(nsIDocument *aDocument, nsIContent *aRootContent,
                       nsIWeakReference *aShell);
   virtual ~nsDocAccessibleWrap();
 
-    // nsIAccessNode
+  // nsIAccessNode
 
-    /**
-     * Creates the native accessible connected to this one.
-     */
-    virtual nsresult Init ();
+  /**
+   * Creates the native accessible connected to this one.
+   */
+  virtual PRBoo Init();
 };
 
 #endif
--- a/accessible/src/mac/nsDocAccessibleWrap.mm
+++ b/accessible/src/mac/nsDocAccessibleWrap.mm
@@ -45,23 +45,25 @@ nsDocAccessibleWrap::
   nsDocAccessible(aDocument, aRootContent, aShell)
 {
 }
 
 nsDocAccessibleWrap::~nsDocAccessibleWrap()
 {
 }
 
-nsresult
+PRBool
 nsDocAccessibleWrap::Init () 
 {
-  nsresult rv = nsDocAccessible::Init();
-  NS_ENSURE_SUCCESS(rv, rv);
+  if (!nsDocAccessible::Init())
+    return PR_FALSE;
 
   NS_ASSERTION(!mNativeWrapper, "nsDocAccessibleWrap::Init() called more than once!");
 
   if (!mNativeWrapper) {
     // Create our native object using the class type specified in GetNativeType().
     mNativeWrapper = new AccessibleWrapper (this, GetNativeType());
+    if (!mNativeWrapper)
+      return PR_FALSE;
   }
 
-  return NS_OK;
+  return PR_TRUE;
 }
--- a/accessible/src/msaa/nsAccessibleWrap.cpp
+++ b/accessible/src/msaa/nsAccessibleWrap.cpp
@@ -319,19 +319,16 @@ STDMETHODIMP nsAccessibleWrap::get_accNa
     // See nsHTMLImageAccessible::GetName()
     return S_OK;
   }
 
   *pszName = ::SysAllocStringLen(name.get(), name.Length());
   if (!*pszName)
     return E_OUTOFMEMORY;
 
-#ifdef DEBUG_A11Y
-  NS_ASSERTION(mIsInitialized, "Access node was not initialized");
-#endif
 } __except(FilterA11yExceptions(::GetExceptionCode(), GetExceptionInformation())) { }
 
   return S_OK;
 }
 
 
 STDMETHODIMP nsAccessibleWrap::get_accValue(
       /* [optional][in] */ VARIANT varChild,
--- a/accessible/src/msaa/nsHTMLWin32ObjectAccessible.cpp
+++ b/accessible/src/msaa/nsHTMLWin32ObjectAccessible.cpp
@@ -49,22 +49,21 @@ nsHTMLWin32ObjectOwnerAccessible::
 {
   // Our only child is a nsHTMLWin32ObjectAccessible object.
   mNativeAccessible = new nsHTMLWin32ObjectAccessible(mHwnd);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsHTMLWin32ObjectOwnerAccessible: nsAccessNode implementation
 
-nsresult
+void
 nsHTMLWin32ObjectOwnerAccessible::Shutdown()
 {
   nsAccessibleWrap::Shutdown();
   mNativeAccessible = nsnull;
-  return NS_OK;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsHTMLWin32ObjectOwnerAccessible: nsAccessible implementation
 
 nsresult
 nsHTMLWin32ObjectOwnerAccessible::GetRoleInternal(PRUint32 *aRole)
 {
--- a/accessible/src/msaa/nsHTMLWin32ObjectAccessible.h
+++ b/accessible/src/msaa/nsHTMLWin32ObjectAccessible.h
@@ -53,17 +53,17 @@ public:
   // because the native plugin accessible doesn't know where it exists in the
   // Mozilla tree, and returns null for previous and next sibling. This would
   // have the effect of cutting off all content after the plugin.
   nsHTMLWin32ObjectOwnerAccessible(nsIContent *aContent,
                                    nsIWeakReference *aShell, void *aHwnd);
   virtual ~nsHTMLWin32ObjectOwnerAccessible() {}
 
   // nsAccessNode
-  virtual nsresult Shutdown();
+  virtual void Shutdown();
 
   // nsAccessible
   virtual nsresult GetRoleInternal(PRUint32 *aRole);
   virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
 
 protected:
 
   // nsAccessible
--- a/accessible/src/xul/nsXULColorPickerAccessible.cpp
+++ b/accessible/src/xul/nsXULColorPickerAccessible.cpp
@@ -115,24 +115,24 @@ nsXULColorPickerAccessible::
   nsXULColorPickerAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
   nsXULColorPickerTileAccessible(aContent, aShell)
 {
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsXULColorPickerAccessible: nsAccessNode
 
-nsresult
+PRBool
 nsXULColorPickerAccessible::Init()
 {
-  nsresult rv = nsXULColorPickerTileAccessible::Init();
-  NS_ENSURE_SUCCESS(rv, rv);
+  if (!nsXULColorPickerTileAccessible::Init())
+    return PR_FALSE;
 
   nsCoreUtils::GeneratePopupTree(mContent, PR_TRUE);
-  return NS_OK;
+  return PR_TRUE;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsXULColorPickerAccessible: nsAccessible
 
 nsresult
 nsXULColorPickerAccessible::GetStateInternal(PRUint32 *aState,
                                              PRUint32 *aExtraState)
--- a/accessible/src/xul/nsXULColorPickerAccessible.h
+++ b/accessible/src/xul/nsXULColorPickerAccessible.h
@@ -64,17 +64,17 @@ public:
  * Used for colorpicker button (xul:colorpicker@type="button").
  */
 class nsXULColorPickerAccessible : public nsXULColorPickerTileAccessible
 {
 public:
   nsXULColorPickerAccessible(nsIContent *aContent, nsIWeakReference *aShell);
 
   // nsAccessNode
-  virtual nsresult Init();
+  virtual PRBool Init();
 
   // nsAccessible
   virtual nsresult GetRoleInternal(PRUint32 *aRole);
   virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
 
 protected:
 
   // nsAccessible
--- a/accessible/src/xul/nsXULComboboxAccessible.cpp
+++ b/accessible/src/xul/nsXULComboboxAccessible.cpp
@@ -51,22 +51,24 @@
 ////////////////////////////////////////////////////////////////////////////////
 
 nsXULComboboxAccessible::
   nsXULComboboxAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
   nsAccessibleWrap(aContent, aShell)
 {
 }
 
-nsresult
+PRBool
 nsXULComboboxAccessible::Init()
 {
-  nsresult rv = nsAccessibleWrap::Init();
+  if (!nsAccessibleWrap::Init())
+    return PR_FALSE;
+
   nsCoreUtils::GeneratePopupTree(mContent);
-  return rv;
+  return PR_TRUE;
 }
 
 nsresult
 nsXULComboboxAccessible::GetRoleInternal(PRUint32 *aRole)
 {
   if (IsDefunct())
     return NS_ERROR_FAILURE;
 
--- a/accessible/src/xul/nsXULComboboxAccessible.h
+++ b/accessible/src/xul/nsXULComboboxAccessible.h
@@ -56,17 +56,17 @@ public:
   // nsIAccessible
   NS_IMETHOD GetValue(nsAString& aValue);
   NS_IMETHOD GetDescription(nsAString& aDescription);
   NS_IMETHOD DoAction(PRUint8 aIndex);
   NS_IMETHOD GetNumActions(PRUint8 *aNumActions);
   NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
 
   // nsAccessNode
-  virtual nsresult Init();
+  virtual PRBool Init();
 
   // nsAccessible
   virtual nsresult GetRoleInternal(PRUint32 *aRole);
   virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
   virtual PRBool GetAllowsAnonChildAccessibles();
 };
 
 #endif
--- a/accessible/src/xul/nsXULFormControlAccessible.cpp
+++ b/accessible/src/xul/nsXULFormControlAccessible.cpp
@@ -105,26 +105,26 @@ nsXULButtonAccessible::DoAction(PRUint8 
 
   DoCommand();
   return NS_OK;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsXULButtonAccessible: nsAccessNode
 
-nsresult
+PRBool
 nsXULButtonAccessible::Init()
 {
-  nsresult rv = nsAccessibleWrap::Init();
-  NS_ENSURE_SUCCESS(rv, rv);
+  if (!nsAccessibleWrap::Init())
+    return PR_FALSE;
 
   if (ContainsMenu())
     nsCoreUtils::GeneratePopupTree(mContent);
 
-  return NS_OK;
+  return PR_TRUE;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsXULButtonAccessible: nsAccessible
 
 nsresult
 nsXULButtonAccessible::GetRoleInternal(PRUint32 *aRole)
 {
--- a/accessible/src/xul/nsXULFormControlAccessible.h
+++ b/accessible/src/xul/nsXULFormControlAccessible.h
@@ -62,17 +62,17 @@ public:
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIAccessible
   NS_IMETHOD GetNumActions(PRUint8 *_retval);
   NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
   NS_IMETHOD DoAction(PRUint8 index);
 
   // nsAccessNode
-  virtual nsresult Init();
+  virtual PRBool Init();
 
   // nsAccessible
   virtual nsresult GetRoleInternal(PRUint32 *aRole);
   virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
 
 protected:
 
   // nsAccessible
--- a/accessible/src/xul/nsXULMenuAccessible.cpp
+++ b/accessible/src/xul/nsXULMenuAccessible.cpp
@@ -70,21 +70,21 @@ nsXULSelectableAccessible::
   nsXULSelectableAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
   nsAccessibleWrap(aContent, aShell)
 {
   mSelectControl = do_QueryInterface(aContent);
 }
 
 NS_IMPL_ISUPPORTS_INHERITED1(nsXULSelectableAccessible, nsAccessible, nsIAccessibleSelectable)
 
-nsresult
+void
 nsXULSelectableAccessible::Shutdown()
 {
   mSelectControl = nsnull;
-  return nsAccessibleWrap::Shutdown();
+  nsAccessibleWrap::Shutdown();
 }
 
 nsresult nsXULSelectableAccessible::ChangeSelection(PRInt32 aIndex, PRUint8 aMethod, PRBool *aSelState)
 {
   *aSelState = PR_FALSE;
 
   if (!mSelectControl) {
     return NS_ERROR_FAILURE;
@@ -266,22 +266,24 @@ NS_IMETHODIMP nsXULSelectableAccessible:
 ////////////////////////////////////////////////////////////////////////////////
 
 nsXULMenuitemAccessible::
   nsXULMenuitemAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
   nsAccessibleWrap(aContent, aShell)
 {
 }
 
-nsresult
+PRBool
 nsXULMenuitemAccessible::Init()
 {
-  nsresult rv = nsAccessibleWrap::Init();
+  if (!nsAccessibleWrap::Init())
+    return PR_FALSE;
+
   nsCoreUtils::GeneratePopupTree(mContent);
-  return rv;
+  return PR_TRUE;
 }
 
 nsresult
 nsXULMenuitemAccessible::GetStateInternal(PRUint32 *aState,
                                           PRUint32 *aExtraState)
 {
   nsresult rv = nsAccessible::GetStateInternal(aState, aExtraState);
   NS_ENSURE_A11Y_SUCCESS(rv, rv);
--- a/accessible/src/xul/nsXULMenuAccessible.h
+++ b/accessible/src/xul/nsXULMenuAccessible.h
@@ -51,17 +51,17 @@ class nsXULSelectableAccessible : public
 public:
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_NSIACCESSIBLESELECTABLE
 
   nsXULSelectableAccessible(nsIContent *aContent, nsIWeakReference *aShell);
   virtual ~nsXULSelectableAccessible() {}
 
   // nsAccessNode
-  virtual nsresult Shutdown();
+  virtual void Shutdown();
 
 protected:
   nsresult ChangeSelection(PRInt32 aIndex, PRUint8 aMethod, PRBool *aSelState);
 
   // nsIDOMXULMultiSelectControlElement inherits from this, so we'll always have
   // one of these if the widget is valid and not defunct
   nsCOMPtr<nsIDOMXULSelectControlElement> mSelectControl;
 };
@@ -80,17 +80,17 @@ public:
   NS_IMETHOD GetDescription(nsAString& aDescription);
   NS_IMETHOD GetKeyboardShortcut(nsAString& _retval);
   NS_IMETHOD GetDefaultKeyBinding(nsAString& aKeyBinding);
   NS_IMETHOD DoAction(PRUint8 index);
   NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
   NS_IMETHOD GetNumActions(PRUint8 *_retval);
 
   // nsAccessNode
-  virtual nsresult Init();
+  virtual PRBool Init();
 
   // nsAccessible
   virtual nsresult GetNameInternal(nsAString& aName);
   virtual nsresult GetRoleInternal(PRUint32 *aRole);
   virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
   virtual PRInt32 GetLevelInternal();
   virtual void GetPositionAndSizeInternal(PRInt32 *aPosInSet,
                                           PRInt32 *aSetSize);
--- a/accessible/src/xul/nsXULTreeAccessible.cpp
+++ b/accessible/src/xul/nsXULTreeAccessible.cpp
@@ -158,30 +158,29 @@ nsXULTreeAccessible::GetValue(nsAString&
 // nsXULTreeAccessible: nsAccessNode implementation
 
 PRBool
 nsXULTreeAccessible::IsDefunct()
 {
   return nsXULSelectableAccessible::IsDefunct() || !mTree || !mTreeView;
 }
 
-nsresult
+void
 nsXULTreeAccessible::Shutdown()
 {
   // XXX: we don't remove accessible from document cache if shutdown wasn't
   // initiated by document destroying. Note, we can't remove accessible from
   // document cache here while document is going to be shutdown. Note, this is
   // not unique place where we have similar problem.
   ClearCache(mAccessibleCache);
 
   mTree = nsnull;
   mTreeView = nsnull;
 
   nsXULSelectableAccessible::Shutdown();
-  return NS_OK;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsXULTreeAccessible: nsAccessible implementation (put methods here)
 
 nsresult
 nsXULTreeAccessible::GetRoleInternal(PRUint32 *aRole)
 {
@@ -504,18 +503,17 @@ nsXULTreeAccessible::GetTreeItemAccessib
   void *key = reinterpret_cast<void*>(aRow);
   nsRefPtr<nsAccessible> accessible = mAccessibleCache.GetWeak(key);
 
   if (!accessible) {
     accessible = CreateTreeItemAccessible(aRow);
     if (!accessible)
       return nsnull;
 
-    nsresult rv = accessible->Init();
-    if (NS_FAILED(rv)) {
+    if (!accessible->Init()) {
       accessible->Shutdown();
       return nsnull;
     }
 
     if (!mAccessibleCache.Put(key, accessible))
       return nsnull;
   }
 
@@ -908,24 +906,24 @@ nsXULTreeItemAccessibleBase::IsDefunct()
   if (nsAccessibleWrap::IsDefunct() || !mTree || !mTreeView || mRow < 0)
     return PR_TRUE;
 
   PRInt32 rowCount = 0;
   nsresult rv = mTreeView->GetRowCount(&rowCount);
   return NS_FAILED(rv) || mRow >= rowCount;
 }
 
-nsresult
+void
 nsXULTreeItemAccessibleBase::Shutdown()
 {
   mTree = nsnull;
   mTreeView = nsnull;
   mRow = -1;
 
-  return nsAccessibleWrap::Shutdown();
+  nsAccessibleWrap::Shutdown();
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsXULTreeItemAccessibleBase: nsAccessible public methods
 
 // nsIAccessible::groupPosition
 nsresult
 nsXULTreeItemAccessibleBase::GroupPosition(PRInt32 *aGroupLevel,
@@ -1181,30 +1179,31 @@ nsXULTreeItemAccessible::GetName(nsAStri
 // nsXULTreeItemAccessible: nsAccessNode implementation
 
 PRBool
 nsXULTreeItemAccessible::IsDefunct()
 {
   return nsXULTreeItemAccessibleBase::IsDefunct() || !mColumn;
 }
 
-nsresult
+PRBool
 nsXULTreeItemAccessible::Init()
 {
-  nsresult rv = nsXULTreeItemAccessibleBase::Init();
-  NS_ENSURE_SUCCESS(rv, rv);
+  if (!nsXULTreeItemAccessibleBase::Init())
+    return PR_FALSE;
 
-  return GetName(mCachedName);
+  GetName(mCachedName);
+  return PR_TRUE;
 }
 
-nsresult
+void
 nsXULTreeItemAccessible::Shutdown()
 {
   mColumn = nsnull;
-  return nsXULTreeItemAccessibleBase::Shutdown();
+  nsXULTreeItemAccessibleBase::Shutdown();
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsXULTreeItemAccessible: nsAccessible implementation
 
 nsresult
 nsXULTreeItemAccessible::GetRoleInternal(PRUint32 *aRole)
 {
--- a/accessible/src/xul/nsXULTreeAccessible.h
+++ b/accessible/src/xul/nsXULTreeAccessible.h
@@ -75,17 +75,17 @@ public:
   NS_IMETHOD GetValue(nsAString& aValue);
   NS_IMETHOD GetFocusedChild(nsIAccessible **aFocusedChild);
 
   // nsIAccessibleSelectable
   NS_DECL_NSIACCESSIBLESELECTABLE
 
   // nsAccessNode
   virtual PRBool IsDefunct();
-  virtual nsresult Shutdown();
+  virtual void Shutdown();
 
   // nsAccessible
   virtual nsresult GetRoleInternal(PRUint32 *aRole);
   virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
   virtual nsresult GetChildAtPoint(PRInt32 aX, PRInt32 aY,
                                    PRBool aDeepestChild,
                                    nsIAccessible **aChild);
 
@@ -190,17 +190,17 @@ public:
                            PRInt32 *aPositionInGroup);
 
   NS_IMETHOD GetNumActions(PRUint8 *aCount);
   NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
   NS_IMETHOD DoAction(PRUint8 aIndex);
 
   // nsAccessNode
   virtual PRBool IsDefunct();
-  virtual nsresult Shutdown();
+  virtual void Shutdown();
 
   // nsAccessible
   virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
   virtual nsAccessible* GetParent();
 
   // nsXULTreeItemAccessibleBase
   NS_DECLARE_STATIC_IID_ACCESSOR(NS_XULTREEITEMBASEACCESSIBLE_IMPL_CID)
 
@@ -254,18 +254,18 @@ public:
   nsXULTreeItemAccessible(nsIContent *aContent, nsIWeakReference *aShell,
                           nsAccessible *aParent, nsITreeBoxObject *aTree,
                           nsITreeView *aTreeView, PRInt32 aRow);
 
   NS_IMETHOD GetName(nsAString& aName);
 
   // nsAccessNode
   virtual PRBool IsDefunct();
-  virtual nsresult Init();
-  virtual nsresult Shutdown();
+  virtual PRBool Init();
+  virtual void Shutdown();
 
   // nsAccessible
   virtual nsresult GetRoleInternal(PRUint32 *aRole);
 
   // nsXULTreeItemAccessibleBase
   virtual void RowInvalidated(PRInt32 aStartColIdx, PRInt32 aEndColIdx);
 
 protected:
--- a/accessible/src/xul/nsXULTreeGridAccessible.cpp
+++ b/accessible/src/xul/nsXULTreeGridAccessible.cpp
@@ -619,21 +619,21 @@ NS_INTERFACE_MAP_END_INHERITING(nsXULTre
 NS_IMPL_ADDREF_INHERITED(nsXULTreeGridRowAccessible,
                          nsXULTreeItemAccessibleBase)
 NS_IMPL_RELEASE_INHERITED(nsXULTreeGridRowAccessible,
                           nsXULTreeItemAccessibleBase)
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsXULTreeGridRowAccessible: nsAccessNode implementation
 
-nsresult
+void
 nsXULTreeGridRowAccessible::Shutdown()
 {
   ClearCache(mAccessibleCache);
-  return nsXULTreeItemAccessibleBase::Shutdown();
+  nsXULTreeItemAccessibleBase::Shutdown();
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsXULTreeGridRowAccessible: nsAccessible implementation
 
 nsresult
 nsXULTreeGridRowAccessible::GetRoleInternal(PRUint32 *aRole)
 {
@@ -722,18 +722,17 @@ nsXULTreeGridRowAccessible::GetCellAcces
 
   if (!accessible) {
     accessible =
       new nsXULTreeGridCellAccessibleWrap(mContent, mWeakShell, this, mTree,
                                           mTreeView, mRow, aColumn);
     if (!accessible)
       return nsnull;
 
-    nsresult rv = accessible->Init();
-    if (NS_FAILED(rv)) {
+    if (!accessible->Init()) {
       accessible->Shutdown();
       return nsnull;
     }
 
     if (!mAccessibleCache.Put(key, accessible))
       return nsnull;
   }
 
@@ -1093,30 +1092,30 @@ nsXULTreeGridCellAccessible::IsSelected(
 
 PRBool
 nsXULTreeGridCellAccessible::IsDefunct()
 {
   return nsLeafAccessible::IsDefunct() || !mParent || !mTree || !mTreeView ||
     !mColumn;
 }
 
-nsresult
+PRBool
 nsXULTreeGridCellAccessible::Init()
 {
-  nsresult rv = nsLeafAccessible::Init();
-  NS_ENSURE_SUCCESS(rv, rv);
+  if (!nsLeafAccessible::Init())
+    return PR_FALSE;
 
   PRInt16 type;
   mColumn->GetType(&type);
   if (type == nsITreeColumn::TYPE_CHECKBOX)
     mTreeView->GetCellValue(mRow, mColumn, mCachedTextEquiv);
   else
     mTreeView->GetCellText(mRow, mColumn, mCachedTextEquiv);
 
-  return NS_OK;
+  return PR_TRUE;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsXULTreeGridCellAccessible: nsAccessible public implementation
 
 nsresult
 nsXULTreeGridCellAccessible::GetAttributesInternal(nsIPersistentProperties *aAttributes)
 {
--- a/accessible/src/xul/nsXULTreeGridAccessible.h
+++ b/accessible/src/xul/nsXULTreeGridAccessible.h
@@ -80,17 +80,17 @@ public:
                              nsITreeView *aTreeView, PRInt32 aRow);
 
   // nsISupports and cycle collection
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsXULTreeGridRowAccessible,
                                            nsAccessible)
 
   // nsAccessNode
-  virtual nsresult Shutdown();
+  virtual void Shutdown();
 
   // nsAccessible
   virtual nsresult GetRoleInternal(PRUint32 *aRole);
   virtual nsresult GetChildAtPoint(PRInt32 aX, PRInt32 aY,
                                    PRBool aDeepestChild,
                                    nsIAccessible **aChild);
 
   virtual nsAccessible* GetChildAt(PRUint32 aIndex);
@@ -150,17 +150,17 @@ public:
   NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
   NS_IMETHOD DoAction(PRUint8 aIndex);
 
   // nsIAccessibleTableCell
   NS_DECL_NSIACCESSIBLETABLECELL
 
   // nsAccessNode
   virtual PRBool IsDefunct();
-  virtual nsresult Init();
+  virtual PRBool Init();
 
   // nsAccessible
   virtual nsresult GetAttributesInternal(nsIPersistentProperties *aAttributes);
   virtual nsresult GetRoleInternal(PRUint32 *aRole);
   virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
 
   virtual nsAccessible* GetParent();
 
--- a/accessible/tests/mochitest/Makefile.in
+++ b/accessible/tests/mochitest/Makefile.in
@@ -83,17 +83,16 @@ include $(topsrcdir)/config/rules.mk
 	$(warning	test_childAtPoint.xul temporarily disabled) \
 		test_descr.html \
 		test_editabletext_1.html \
 		test_editabletext_2.html \
 		test_elm_listbox.xul \
 	$(warning   test_elm_media.html temporarily disabled) \
 		test_elm_nsApplicationAcc.html \
 		test_elm_plugin.html \
-		test_invalidate_accessnode.html \
 		test_name.html \
 		test_name.xul \
 		test_name_button.html \
 		test_name_link.html \
 		test_name_markup.html \
 		test_name_nsRootAcc.xul \
 	$(warning test_nsIAccessible_comboboxes.xul temporarily disabled) \
  		test_nsIAccessible_selects.html \
deleted file mode 100644
--- a/accessible/tests/mochitest/test_invalidate_accessnode.html
+++ /dev/null
@@ -1,82 +0,0 @@
-<!DOCTYPE html>
-<html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=434464
--->
-<head>
-  <title>Test NSIAccessNode cache invalidation</title>
-  <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
-
-  <script type="application/javascript"
-          src="chrome://mochikit/content/MochiKit/packed.js"></script>
-  <script type="application/javascript"
-          src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-
-  <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
-
-  <script type="application/javascript">
-    function doTest()
-    {
-      var parentElm = getNode("parent");
-      if (!parentElm) {
-        SimpleTest.finish();
-        return;
-      }
-
-      var elm = getNode("para");
-      if (!elm) {
-        SimpleTest.finish();
-        return;
-      }
-
-      // It's currently hidden. Ask for its parent's nsIAccessNode.
-      var parentElmAccNode = getAccessible(parentElm, [nsIAccessNode]);
-      if (!parentElmAccNode) {
-        SimpleTest.finish();
-        return;
-      }
-
-      // Get the paragraph's accessNode.
-      var elmAccNode = null;
-      try {
-        elmAccNode = parentElmAccNode.firstChildNode;
-      } catch(e) {}
-
-      if (!elmAccNode) {
-        ok(false, "No accessNode for hidden paragraph!");
-        SimpleTest.finish();
-        return;
-      }
-
-      // Now make the paragraph visible. This invalidates the just-retrieved
-      // AccessNode. An nsIAccessible should then be retrievable.
-      elm.style.display = "block";
-
-      // Now, get an accessible for it. Use a timeout so the layout engine can
-      // catch up.
-      window.setTimeout(
-        function()
-        {
-          var elmAcc = getAccessible(elm);
-          ok(elmAcc, "No accessible for paragraph after it became visible!");
-
-          SimpleTest.finish();
-        },
-      200);
-    }
-
-    SimpleTest.waitForExplicitFinish();
-    addA11yLoadEvent(doTest);
-  </script>
-</head>
-<body>
-
-  <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=434464">Mozilla Bug 434464</a>
-  <p id="display"></p>
-  <div id="content" style="display: none"></div>
-  <pre id="test">
-  </pre>
-  <div id="parent"><p style="display: none;" id="para">I'm hidden initially, but then made visible.</p></div>
-</body>
-</html>