Bug 814569 - get rid nsAccessNode, r=tbsaunde
authorAlexander Surkov <surkov.alexander@gmail.com>
Mon, 28 Oct 2013 23:30:55 -0400
changeset 168133 aa060162229712e536caafd4660d23a228bfd56e
parent 168132 07c53271831052673e04c82bed22254fb8918897
child 168134 340cb402065a747a86d6e7a04ce682dd6300bf52
push id445
push userffxbld
push dateMon, 10 Mar 2014 22:05:19 +0000
treeherdermozilla-release@dc38b741b04e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstbsaunde
bugs814569
milestone28.0a1
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 814569 - get rid nsAccessNode, r=tbsaunde
accessible/public/msaa/ISimpleDOMNode.idl
accessible/src/atk/AccessibleWrap.h
accessible/src/atk/AtkSocketAccessible.h
accessible/src/base/moz.build
accessible/src/base/nsAccessNode.cpp
accessible/src/base/nsAccessNode.h
accessible/src/generic/ARIAGridAccessible.cpp
accessible/src/generic/ARIAGridAccessible.h
accessible/src/generic/Accessible.cpp
accessible/src/generic/Accessible.h
accessible/src/generic/ApplicationAccessible.cpp
accessible/src/generic/ApplicationAccessible.h
accessible/src/generic/BaseAccessibles.cpp
accessible/src/generic/BaseAccessibles.h
accessible/src/generic/DocAccessible.cpp
accessible/src/generic/DocAccessible.h
accessible/src/generic/OuterDocAccessible.cpp
accessible/src/generic/OuterDocAccessible.h
accessible/src/generic/RootAccessible.cpp
accessible/src/generic/RootAccessible.h
accessible/src/html/HTMLListAccessible.cpp
accessible/src/html/HTMLListAccessible.h
accessible/src/html/HTMLSelectAccessible.cpp
accessible/src/html/HTMLSelectAccessible.h
accessible/src/html/HTMLTableAccessible.cpp
accessible/src/html/HTMLTableAccessible.h
accessible/src/windows/msaa/DocAccessibleWrap.cpp
accessible/src/windows/msaa/DocAccessibleWrap.h
accessible/src/windows/msaa/HTMLWin32ObjectAccessible.cpp
accessible/src/windows/msaa/HTMLWin32ObjectAccessible.h
accessible/src/xul/XULListboxAccessible.cpp
accessible/src/xul/XULListboxAccessible.h
accessible/src/xul/XULSelectControlAccessible.cpp
accessible/src/xul/XULSelectControlAccessible.h
accessible/src/xul/XULTreeAccessible.cpp
accessible/src/xul/XULTreeAccessible.h
accessible/src/xul/XULTreeGridAccessible.cpp
accessible/src/xul/XULTreeGridAccessible.h
--- a/accessible/public/msaa/ISimpleDOMNode.idl
+++ b/accessible/public/msaa/ISimpleDOMNode.idl
@@ -79,17 +79,17 @@ cpp_quote("// DOM navigation - get a dif
 cpp_quote("//")
 cpp_quote("// get_innerHTML(/* [out] */ BSTR *htmlText);")
 cpp_quote("// ---------------------------------------------------------------------------------------------------=")
 cpp_quote("// Returns HTML of this DOM node's subtree. Does not include the start and end tag for this node/element.")
 cpp_quote("//")
 cpp_quote("//")
 cpp_quote("// get_localInterface(/* [out] */ void **localInterface);")
 cpp_quote("// ---------------------------------------------------------------------------------------------------=")
-cpp_quote("// Only available in Gecko's process - casts to an XPCOM nsAccessNode object pointer")
+cpp_quote("// Only available in Gecko's process")
 cpp_quote("//")
 cpp_quote("//")
 cpp_quote("// get_language(/* [out] */ BSTR *htmlText);")
 cpp_quote("// ---------------------------------------------------------------------------------------------------=")
 cpp_quote("// Returns the computed language for this node, or empty string if unknown.")
 cpp_quote("//")
 cpp_quote("//")
 cpp_quote("///////////////////////////////////////////////////////////////////////////////////////////////////////")
--- a/accessible/src/atk/AccessibleWrap.h
+++ b/accessible/src/atk/AccessibleWrap.h
@@ -47,17 +47,16 @@ class MaiHyperlink;
  */
 class AccessibleWrap : public Accessible
 {
 public:
   AccessibleWrap(nsIContent* aContent, DocAccessible* aDoc);
   virtual ~AccessibleWrap();
   void ShutdownAtkObject();
 
-  // nsAccessNode
   virtual void Shutdown();
 
   // return the atk object for this AccessibleWrap
   NS_IMETHOD GetNativeInterface(void **aOutAccessible);
   virtual nsresult HandleAccEvent(AccEvent* aEvent);
 
   AtkObject * GetAtkObject(void);
   static AtkObject * GetAtkObject(nsIAccessible * acc);
--- a/accessible/src/atk/AtkSocketAccessible.h
+++ b/accessible/src/atk/AtkSocketAccessible.h
@@ -40,17 +40,16 @@ public:
    * True if the current Atk version supports AtkSocket and it was correctly
    * loaded.
    */
   static bool gCanEmbed;
 
   AtkSocketAccessible(nsIContent* aContent, DocAccessible* aDoc,
                       const nsCString& aPlugId);
 
-  // nsAccessNode
   virtual void Shutdown();
 
   // nsIAccessible
   NS_IMETHODIMP GetNativeInterface(void** aOutAccessible);
 };
 
 } // namespace a11y
 } // namespace mozilla
--- a/accessible/src/base/moz.build
+++ b/accessible/src/base/moz.build
@@ -5,18 +5,17 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 include('../shared.mozbuild')
 
 MODULE = 'accessibility'
 
 EXPORTS += [
     'AccEvent.h',
-    'nsAccessibilityService.h',
-    'nsAccessNode.h',
+    'nsAccessibilityService.h'
 ]
 
 EXPORTS.mozilla.a11y += [
     'AccTypes.h',
     'DocManager.h',
     'FocusManager.h',
     'Platform.h',
     'RelationType.h',
@@ -40,17 +39,16 @@ SOURCES += [
     'Asserts.cpp',
     'DocManager.cpp',
     'EventQueue.cpp',
     'Filters.cpp',
     'FocusManager.cpp',
     'NotificationController.cpp',
     'nsAccessibilityService.cpp',
     'nsAccessiblePivot.cpp',
-    'nsAccessNode.cpp',
     'nsAccUtils.cpp',
     'nsCoreUtils.cpp',
     'nsEventShell.cpp',
     'nsTextEquivUtils.cpp',
     'SelectionManager.cpp',
     'StyleInfo.cpp',
     'TextAttrs.cpp',
     'TextUpdater.cpp',
deleted file mode 100644
--- a/accessible/src/base/nsAccessNode.cpp
+++ /dev/null
@@ -1,117 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsAccessNode.h"
-
-#include "nsAccUtils.h"
-#include "nsCoreUtils.h"
-#include "RootAccessible.h"
-
-#include "nsIDocShell.h"
-
-using namespace mozilla::a11y;
-
-/* For documentation of the accessibility architecture,
- * see http://lxr.mozilla.org/seamonkey/source/accessible/accessible-docs.html
- */
-
-/*
- * Class nsAccessNode
- */
-
-////////////////////////////////////////////////////////////////////////////////
-// AccessNode. nsISupports
-
-NS_IMPL_CYCLE_COLLECTION_1(nsAccessNode, mContent)
-
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsAccessNode)
-  NS_INTERFACE_MAP_ENTRY(nsAccessNode)
-NS_INTERFACE_MAP_END
- 
-NS_IMPL_CYCLE_COLLECTING_ADDREF(nsAccessNode)
-NS_IMPL_CYCLE_COLLECTING_RELEASE_WITH_DESTROY(nsAccessNode, LastRelease())
-
-////////////////////////////////////////////////////////////////////////////////
-// nsAccessNode construction/desctruction
-
-nsAccessNode::
-  nsAccessNode(nsIContent* aContent, DocAccessible* aDoc) :
-  mContent(aContent), mDoc(aDoc)
-{
-}
-
-nsAccessNode::~nsAccessNode()
-{
-  NS_ASSERTION(!mDoc, "LastRelease was never called!?!");
-}
-
-void nsAccessNode::LastRelease()
-{
-  // First cleanup if needed...
-  if (mDoc) {
-    Shutdown();
-    NS_ASSERTION(!mDoc, "A Shutdown() impl forgot to call its parent's Shutdown?");
-  }
-  // ... then die.
-  delete this;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-// nsAccessNode public
-
-
-void
-nsAccessNode::Shutdown()
-{
-  mContent = nullptr;
-  mDoc = nullptr;
-}
-
-RootAccessible*
-nsAccessNode::RootAccessible() const
-{
-  nsCOMPtr<nsIDocShell> docShell = nsCoreUtils::GetDocShellFor(GetNode());
-  NS_ASSERTION(docShell, "No docshell for mContent");
-  if (!docShell) {
-    return nullptr;
-  }
-  nsCOMPtr<nsIDocShellTreeItem> root;
-  docShell->GetRootTreeItem(getter_AddRefs(root));
-  NS_ASSERTION(root, "No root content tree item");
-  if (!root) {
-    return nullptr;
-  }
-
-  DocAccessible* docAcc = nsAccUtils::GetDocAccessibleFor(root);
-  return docAcc ? docAcc->AsRoot() : nullptr;
-}
-
-nsIFrame*
-nsAccessNode::GetFrame() const
-{
-  return mContent ? mContent->GetPrimaryFrame() : nullptr;
-}
-
-nsINode*
-nsAccessNode::GetNode() const
-{
-  return mContent;
-}
-
-void
-nsAccessNode::Language(nsAString& aLanguage)
-{
-  aLanguage.Truncate();
-
-  if (!mDoc)
-    return;
-
-  nsCoreUtils::GetLanguageFor(mContent, nullptr, aLanguage);
-  if (aLanguage.IsEmpty()) { // Nothing found, so use document's language
-    mDoc->DocumentNode()->GetHeaderData(nsGkAtoms::headerContentLanguage,
-                                        aLanguage);
-  }
-}
-
deleted file mode 100644
--- a/accessible/src/base/nsAccessNode.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/* For documentation of the accessibility architecture, 
- * see http://lxr.mozilla.org/seamonkey/source/accessible/accessible-docs.html
- */
-
-#ifndef _nsAccessNode_H_
-#define _nsAccessNode_H_
-
-#include "nsINode.h"
-
-class nsIContent;
-class nsIFrame;
-
-namespace mozilla {
-namespace a11y {
-
-class DocAccessible;
-class RootAccessible;
-
-class nsAccessNode : public nsISupports
-{
-public:
-
-  nsAccessNode(nsIContent* aContent, DocAccessible* aDoc);
-  virtual ~nsAccessNode();
-
-  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_CLASS(nsAccessNode)
-
-  /**
-   * Return the document accessible for this access node.
-   */
-  DocAccessible* Document() const { return mDoc; }
-
-  /**
-   * Return the root document accessible for this accessnode.
-   */
-  a11y::RootAccessible* RootAccessible() const;
-
-  /**
-   * Shutdown the access node object.
-   */
-  virtual void Shutdown();
-
-  /**
-   * Return frame for the given access node object.
-   */
-  virtual nsIFrame* GetFrame() const;
-
-  /**
-   * Return DOM node associated with the accessible.
-   */
-  virtual nsINode* GetNode() const;
-  nsIContent* GetContent() const { return mContent; }
-
-  /**
-   * Return node type information of DOM node associated with the accessible.
-   */
-  bool IsContent() const
-  {
-    return GetNode() && GetNode()->IsNodeOfType(nsINode::eCONTENT);
-  }
-
-  /**
-   * Return the unique identifier of the accessible.
-   */
-  void* UniqueID() { return static_cast<void*>(this); }
-
-  /**
-   * Interface methods on nsIAccessible shared with ISimpleDOM.
-   */
-  void Language(nsAString& aLocale);
-
-protected:
-  void LastRelease();
-
-  nsCOMPtr<nsIContent> mContent;
-  DocAccessible* mDoc;
-
-private:
-  nsAccessNode() MOZ_DELETE;
-  nsAccessNode(const nsAccessNode&) MOZ_DELETE;
-  nsAccessNode& operator =(const nsAccessNode&) MOZ_DELETE;
-};
-
-} // namespace a11y
-} // namespace mozilla
-
-#endif
-
--- a/accessible/src/generic/ARIAGridAccessible.cpp
+++ b/accessible/src/generic/ARIAGridAccessible.cpp
@@ -35,17 +35,17 @@ ARIAGridAccessible::
 ////////////////////////////////////////////////////////////////////////////////
 // nsISupports
 
 NS_IMPL_ISUPPORTS_INHERITED1(ARIAGridAccessible,
                              Accessible,
                              nsIAccessibleTable)
 
 ////////////////////////////////////////////////////////////////////////////////
-//nsAccessNode
+// Accessible
 
 void
 ARIAGridAccessible::Shutdown()
 {
   mTable = nullptr;
   AccessibleWrap::Shutdown();
 }
 
--- a/accessible/src/generic/ARIAGridAccessible.h
+++ b/accessible/src/generic/ARIAGridAccessible.h
@@ -31,18 +31,16 @@ public:
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIAccessibleTable
   NS_FORWARD_NSIACCESSIBLETABLE(xpcAccessibleTable::)
 
   // Accessible
   virtual TableAccessible* AsTable() { return this; }
-
-  // nsAccessNode
   virtual void Shutdown();
 
   // TableAccessible
   virtual uint32_t ColCount();
   virtual uint32_t RowCount();
   virtual Accessible* CellAt(uint32_t aRowIndex, uint32_t aColumnIndex);
   virtual bool IsColSelected(uint32_t aColIdx);
   virtual bool IsRowSelected(uint32_t aRowIdx);
--- a/accessible/src/generic/Accessible.cpp
+++ b/accessible/src/generic/Accessible.cpp
@@ -83,79 +83,37 @@
 #include "mozilla/Preferences.h"
 #include "mozilla/dom/Element.h"
 
 using namespace mozilla;
 using namespace mozilla::a11y;
 
 
 ////////////////////////////////////////////////////////////////////////////////
-// Accessible. nsISupports
-
-NS_IMPL_CYCLE_COLLECTION_INHERITED_2(Accessible, nsAccessNode,
-                                     mParent, mChildren)
-
-NS_IMPL_ADDREF_INHERITED(Accessible, nsAccessNode)
-NS_IMPL_RELEASE_INHERITED(Accessible, nsAccessNode)
-
-nsresult
-Accessible::QueryInterface(REFNSIID aIID, void** aInstancePtr)
-{
-  // Custom-built QueryInterface() knows when we support nsIAccessibleSelectable
-  // based on role attribute and aria-multiselectable
-  *aInstancePtr = nullptr;
-
-  if (aIID.Equals(NS_GET_IID(nsXPCOMCycleCollectionParticipant))) {
-    *aInstancePtr = NS_CYCLE_COLLECTION_PARTICIPANT(Accessible);
-    return NS_OK;
-  }
-
-  if (aIID.Equals(NS_GET_IID(nsIAccessible))) {
-    *aInstancePtr = static_cast<nsIAccessible*>(this);
-    NS_ADDREF_THIS();
-    return NS_OK;
-  }
-
-  if (aIID.Equals(NS_GET_IID(Accessible))) {
-    *aInstancePtr = static_cast<Accessible*>(this);
-    NS_ADDREF_THIS();
-    return NS_OK;
-  }
-
-  if (aIID.Equals(NS_GET_IID(nsIAccessibleSelectable))) {
-    if (IsSelect()) {
-      *aInstancePtr = static_cast<nsIAccessibleSelectable*>(this);
-      NS_ADDREF_THIS();
-      return NS_OK;
-    }
-    return NS_ERROR_NO_INTERFACE;
-  }
-
-  if (aIID.Equals(NS_GET_IID(nsIAccessibleValue))) {
-    if (HasNumericValue()) {
-      *aInstancePtr = static_cast<nsIAccessibleValue*>(this);
-      NS_ADDREF_THIS();
-      return NS_OK;
-    }
-  }
-
-  if (aIID.Equals(NS_GET_IID(nsIAccessibleHyperLink))) {
-    if (IsLink()) {
-      *aInstancePtr = static_cast<nsIAccessibleHyperLink*>(this);
-      NS_ADDREF_THIS();
-      return NS_OK;
-    }
-    return NS_ERROR_NO_INTERFACE;
-  }
-
-  return nsAccessNode::QueryInterface(aIID, aInstancePtr);
-}
+// Accessible: nsISupports and cycle collection
+
+NS_IMPL_CYCLE_COLLECTION_3(Accessible,
+                           mContent, mParent, mChildren)
+
+NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(Accessible)
+  NS_INTERFACE_MAP_ENTRY(nsIAccessible)
+  if (aIID.Equals(NS_GET_IID(Accessible)))
+    foundInterface = static_cast<nsIAccessible*>(this);
+  else
+  NS_INTERFACE_MAP_ENTRY_CONDITIONAL(nsIAccessibleSelectable, IsSelect())
+  NS_INTERFACE_MAP_ENTRY_CONDITIONAL(nsIAccessibleValue, HasNumericValue())
+  NS_INTERFACE_MAP_ENTRY_CONDITIONAL(nsIAccessibleHyperLink, IsLink())
+  NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIAccessible)
+NS_INTERFACE_MAP_END
+
+NS_IMPL_CYCLE_COLLECTING_ADDREF(Accessible)
+NS_IMPL_CYCLE_COLLECTING_RELEASE_WITH_DESTROY(Accessible, LastRelease())
 
 Accessible::Accessible(nsIContent* aContent, DocAccessible* aDoc) :
-  nsAccessNode(aContent, aDoc),
+  mContent(aContent), mDoc(aDoc),
   mParent(nullptr), mIndexInParent(-1), mChildrenFlags(eChildrenUninitialized),
   mStateFlags(0), mType(0), mGenericTypes(0), mIndexOfEmbeddedChild(-1),
   mRoleMapEntry(nullptr)
 {
 #ifdef NS_DEBUG_X
    {
      nsCOMPtr<nsIPresShell> shell(do_QueryReferent(aShell));
      printf(">>> %p Created Acc - DOM: %p  PS: %p", 
@@ -170,21 +128,19 @@ Accessible::Accessible(nsIContent* aCont
       Name(buf);
       printf(" Name:[%s]", NS_ConvertUTF16toUTF8(buf).get());
      }
      printf("\n");
    }
 #endif
 }
 
-//-----------------------------------------------------
-// destruction
-//-----------------------------------------------------
 Accessible::~Accessible()
 {
+  NS_ASSERTION(!mDoc, "LastRelease was never called!?!");
 }
 
 NS_IMETHODIMP
 Accessible::GetDocument(nsIAccessibleDocument** aDocument)
 {
   NS_ENSURE_ARG_POINTER(aDocument);
 
   NS_IF_ADDREF(*aDocument = Document());
@@ -2619,31 +2575,29 @@ Accessible::AppendTextTo(nsAString& aTex
     // character if its parent hypertext accessible doesn't expose children to
     // AT.
     aText += kImaginaryEmbeddedObjectChar;
   } else {
     aText += kEmbeddedObjectChar;
   }
 }
 
-////////////////////////////////////////////////////////////////////////////////
-// nsAccessNode public methods
-
 void
 Accessible::Shutdown()
 {
   // Mark the accessible as defunct, invalidate the child count and pointers to 
   // other accessibles, also make sure none of its children point to this parent
   mStateFlags |= eIsDefunct;
 
   InvalidateChildren();
   if (mParent)
     mParent->RemoveChild(this);
 
-  nsAccessNode::Shutdown();
+  mContent = nullptr;
+  mDoc = nullptr;
 }
 
 // Accessible protected
 void
 Accessible::ARIAName(nsString& aName)
 {
   // aria-labelledby now takes precedence over aria-label
   nsresult rv = nsTextEquivUtils::
@@ -2711,16 +2665,63 @@ Accessible::UnbindFromParent()
   mIndexInParent = -1;
   mIndexOfEmbeddedChild = -1;
   mGroupInfo = nullptr;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // Accessible public methods
 
+RootAccessible*
+Accessible::RootAccessible() const
+{
+  nsCOMPtr<nsIDocShell> docShell = nsCoreUtils::GetDocShellFor(GetNode());
+  NS_ASSERTION(docShell, "No docshell for mContent");
+  if (!docShell) {
+    return nullptr;
+  }
+
+  nsCOMPtr<nsIDocShellTreeItem> root;
+  docShell->GetRootTreeItem(getter_AddRefs(root));
+  NS_ASSERTION(root, "No root content tree item");
+  if (!root) {
+    return nullptr;
+  }
+
+  DocAccessible* docAcc = nsAccUtils::GetDocAccessibleFor(root);
+  return docAcc ? docAcc->AsRoot() : nullptr;
+}
+
+nsIFrame*
+Accessible::GetFrame() const
+{
+  return mContent ? mContent->GetPrimaryFrame() : nullptr;
+}
+
+nsINode*
+Accessible::GetNode() const
+{
+  return mContent;
+}
+
+void
+Accessible::Language(nsAString& aLanguage)
+{
+  aLanguage.Truncate();
+
+  if (!mDoc)
+    return;
+
+  nsCoreUtils::GetLanguageFor(mContent, nullptr, aLanguage);
+  if (aLanguage.IsEmpty()) { // Nothing found, so use document's language
+    mDoc->DocumentNode()->GetHeaderData(nsGkAtoms::headerContentLanguage,
+                                        aLanguage);
+  }
+}
+
 void
 Accessible::InvalidateChildren()
 {
   int32_t childCount = mChildren.Length();
   for (int32_t childIdx = 0; childIdx < childCount; childIdx++) {
     Accessible* child = mChildren.ElementAt(childIdx);
     child->UnbindFromParent();
   }
@@ -3123,16 +3124,29 @@ Accessible::ContainerWidget() const
   }
   return nullptr;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // Accessible protected methods
 
 void
+Accessible::LastRelease()
+{
+  // First cleanup if needed...
+  if (mDoc) {
+    Shutdown();
+    NS_ASSERTION(!mDoc,
+                 "A Shutdown() impl forgot to call its parent's Shutdown?");
+  }
+  // ... then die.
+  delete this;
+}
+
+void
 Accessible::CacheChildren()
 {
   DocAccessible* doc = Document();
   NS_ENSURE_TRUE_VOID(doc);
 
   TreeWalker walker(this, mContent);
 
   Accessible* child = nullptr;
--- a/accessible/src/generic/Accessible.h
+++ b/accessible/src/generic/Accessible.h
@@ -5,17 +5,16 @@
 
 #ifndef _Accessible_H_
 #define _Accessible_H_
 
 #include "mozilla/a11y/AccTypes.h"
 #include "mozilla/a11y/RelationType.h"
 #include "mozilla/a11y/Role.h"
 #include "mozilla/a11y/States.h"
-#include "nsAccessNode.h"
 
 #include "nsIAccessible.h"
 #include "nsIAccessibleHyperLink.h"
 #include "nsIAccessibleSelectable.h"
 #include "nsIAccessibleValue.h"
 #include "nsIAccessibleStates.h"
 
 #include "nsIContent.h"
@@ -31,23 +30,25 @@ class nsIAtom;
 class nsView;
 
 namespace mozilla {
 namespace a11y {
 
 class Accessible;
 class AccEvent;
 class AccGroupInfo;
+class DocAccessible;
 class EmbeddedObjCollector;
 class HTMLImageMapAccessible;
 class HTMLLIAccessible;
 class HyperTextAccessible;
 class ImageAccessible;
 class KeyBinding;
 class Relation;
+class RootAccessible;
 class TableAccessible;
 class TableCellAccessible;
 class TextLeafAccessible;
 class XULLabelAccessible;
 class XULTreeAccessible;
 
 /**
  * Name type flags.
@@ -96,42 +97,78 @@ typedef nsRefPtrHashtable<nsPtrHashKey<c
 #define NS_ACCESSIBLE_IMPL_IID                          \
 {  /* 133c8bf4-4913-4355-bd50-426bd1d6e1ad */           \
   0x133c8bf4,                                           \
   0x4913,                                               \
   0x4355,                                               \
   { 0xbd, 0x50, 0x42, 0x6b, 0xd1, 0xd6, 0xe1, 0xad }    \
 }
 
-class Accessible : public nsAccessNode,
-                   public nsIAccessible,
+class Accessible : public nsIAccessible,
                    public nsIAccessibleHyperLink,
                    public nsIAccessibleSelectable,
                    public nsIAccessibleValue
 {
 public:
   Accessible(nsIContent* aContent, DocAccessible* aDoc);
   virtual ~Accessible();
 
-  NS_DECL_ISUPPORTS_INHERITED
-  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(Accessible, nsAccessNode)
+  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
+  NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(Accessible, nsIAccessible)
 
   NS_DECL_NSIACCESSIBLE
   NS_DECL_NSIACCESSIBLEHYPERLINK
   NS_DECL_NSIACCESSIBLESELECTABLE
   NS_DECL_NSIACCESSIBLEVALUE
   NS_DECLARE_STATIC_IID_ACCESSOR(NS_ACCESSIBLE_IMPL_IID)
 
   //////////////////////////////////////////////////////////////////////////////
-  // nsAccessNode
+  // Public methods
+
+  /**
+   * Return the document accessible for this accessible.
+   */
+  DocAccessible* Document() const { return mDoc; }
+
+  /**
+   * Return the root document accessible for this accessible.
+   */
+  a11y::RootAccessible* RootAccessible() const;
+
+  /**
+   * Return frame for this accessible.
+   */
+  virtual nsIFrame* GetFrame() const;
 
-  virtual void Shutdown();
+  /**
+   * Return DOM node associated with the accessible.
+   */
+  virtual nsINode* GetNode() const;
+  inline already_AddRefed<nsIDOMNode> DOMNode() const
+  {
+    nsCOMPtr<nsIDOMNode> DOMNode = do_QueryInterface(GetNode());
+    return DOMNode.forget();
+  }
+  nsIContent* GetContent() const { return mContent; }
 
-  //////////////////////////////////////////////////////////////////////////////
-  // Public methods
+  /**
+   * Return node type information of DOM node associated with the accessible.
+   */
+  bool IsContent() const
+    { return GetNode() && GetNode()->IsNodeOfType(nsINode::eCONTENT); }
+
+  /**
+   * Return the unique identifier of the accessible.
+   */
+  void* UniqueID() { return static_cast<void*>(this); }
+
+  /**
+   * Return language associated with the accessible.
+   */
+  void Language(nsAString& aLocale);
 
   /**
    * Get the description of this accessible.
    */
   virtual void Description(nsString& aDescription);
 
   /**
    * Get the value of this accessible.
@@ -142,25 +179,16 @@ public:
    * Get the name of this accessible.
    *
    * Note: aName.IsVoid() when name was left empty by the author on purpose.
    * aName.IsEmpty() when the author missed name, AT can try to repair a name.
    */
   virtual ENameValueFlag Name(nsString& aName);
 
   /**
-   * Return DOM node associated with this accessible.
-   */
-  inline already_AddRefed<nsIDOMNode> DOMNode() const
-  {
-    nsCOMPtr<nsIDOMNode> DOMNode = do_QueryInterface(GetNode());
-    return DOMNode.forget();
-  }
-
-  /**
    * Maps ARIA state attributes to state of accessible. Note the given state
    * argument should hold states for accessible before you pass it into this
    * method.
    *
    * @param  [in/out] where to fill the states into.
    */
   virtual void ApplyARIAState(uint64_t* aState) const;
 
@@ -296,16 +324,21 @@ public:
    * Get the relation of the given type.
    */
   virtual Relation RelationByType(RelationType aType);
 
   //////////////////////////////////////////////////////////////////////////////
   // Initializing methods
 
   /**
+   * Shutdown this accessible object.
+   */
+  virtual void Shutdown();
+
+  /**
    * Set the ARIA role map entry for a new accessible.
    */
   void SetRoleMapEntry(nsRoleMapEntry* aRoleMapEntry)
     { mRoleMapEntry = aRoleMapEntry; }
 
   /**
    * Update the children cache.
    */
@@ -379,17 +412,16 @@ public:
   inline Accessible* FirstChild()
     { return GetChildAt(0); }
   inline Accessible* LastChild()
   {
     uint32_t childCount = ChildCount();
     return childCount != 0 ? GetChildAt(childCount - 1) : nullptr;
   }
 
-
   /**
    * Return embedded accessible children count.
    */
   uint32_t EmbeddedChildCount();
 
   /**
    * Return embedded accessible child at the given index.
    */
@@ -752,16 +784,21 @@ protected:
    * account ARIA.
    */
   virtual already_AddRefed<nsIPersistentProperties> NativeAttributes();
 
   //////////////////////////////////////////////////////////////////////////////
   // Initializing, cache and tree traverse methods
 
   /**
+   * Destroy the object.
+   */
+  void LastRelease();
+
+  /**
    * Cache accessible children.
    */
   virtual void CacheChildren();
 
   /**
    * Set accessible parent and index in parent.
    */
   virtual void BindToParent(Accessible* aParent, uint32_t aIndexInParent);
@@ -895,16 +932,19 @@ protected:
   uint32_t GetActionRule();
 
   /**
    * Return group info.
    */
   AccGroupInfo* GetGroupInfo();
 
   // Data Members
+  nsCOMPtr<nsIContent> mContent;
+  DocAccessible* mDoc;
+
   nsRefPtr<Accessible> mParent;
   nsTArray<nsRefPtr<Accessible> > mChildren;
   int32_t mIndexInParent;
 
   static const uint8_t kChildrenFlagsBits = 2;
   static const uint8_t kStateFlagsBits = 5;
   static const uint8_t kTypeBits = 6;
   static const uint8_t kGenericTypesBits = 12;
@@ -927,16 +967,22 @@ protected:
 
   nsAutoPtr<AccGroupInfo> mGroupInfo;
   friend class AccGroupInfo;
 
   /**
    * Non-null indicates author-supplied role; possibly state & value as well
    */
   nsRoleMapEntry* mRoleMapEntry;
+
+private:
+  Accessible() MOZ_DELETE;
+  Accessible(const Accessible&) MOZ_DELETE;
+  Accessible& operator =(const Accessible&) MOZ_DELETE;
+
 };
 
 NS_DEFINE_STATIC_IID_ACCESSOR(Accessible,
                               NS_ACCESSIBLE_IMPL_IID)
 
 
 /**
  * Represent key binding associated with accessible (such as access key and
--- a/accessible/src/generic/ApplicationAccessible.cpp
+++ b/accessible/src/generic/ApplicationAccessible.cpp
@@ -260,28 +260,24 @@ ApplicationAccessible::GetPlatformVersio
   nsresult rv = mAppInfo->GetPlatformVersion(cversion);
   NS_ENSURE_SUCCESS(rv, rv);
 
   AppendUTF8toUTF16(cversion, aVersion);
   return NS_OK;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsAccessNode public methods
+// Accessible public methods
 
 void
 ApplicationAccessible::Shutdown()
 {
   mAppInfo = nullptr;
 }
 
-
-////////////////////////////////////////////////////////////////////////////////
-// Accessible public methods
-
 void
 ApplicationAccessible::ApplyARIAState(uint64_t* aState) const
 {
 }
 
 role
 ApplicationAccessible::NativeRole()
 {
--- a/accessible/src/generic/ApplicationAccessible.h
+++ b/accessible/src/generic/ApplicationAccessible.h
@@ -52,20 +52,18 @@ public:
   NS_IMETHOD TakeFocus();
   NS_IMETHOD GetActionName(uint8_t aIndex, nsAString &aName);
   NS_IMETHOD GetActionDescription(uint8_t aIndex, nsAString &aDescription);
   NS_IMETHOD DoAction(uint8_t aIndex);
 
   // nsIAccessibleApplication
   NS_DECL_NSIACCESSIBLEAPPLICATION
 
-  // nsAccessNode
+  // Accessible
   virtual void Shutdown();
-
-  // Accessible
   virtual already_AddRefed<nsIPersistentProperties> NativeAttributes() MOZ_OVERRIDE;
   virtual GroupPos GroupPosition();
   virtual ENameValueFlag Name(nsString& aName);
   virtual void ApplyARIAState(uint64_t* aState) const;
   virtual void Description(nsString& aDescription);
   virtual void Value(nsString& aValue);
   virtual mozilla::a11y::role NativeRole();
   virtual uint64_t State();
--- a/accessible/src/generic/BaseAccessibles.cpp
+++ b/accessible/src/generic/BaseAccessibles.cpp
@@ -150,17 +150,17 @@ LinkableAccessible::DoAction(uint8_t aIn
 KeyBinding
 LinkableAccessible::AccessKey() const
 {
   return mActionAcc ?
     mActionAcc->AccessKey() : Accessible::AccessKey();
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// LinkableAccessible. nsAccessNode
+// LinkableAccessible. Accessible
 
 void
 LinkableAccessible::Shutdown()
 {
   mIsLink = false;
   mIsOnclick = false;
   mActionAcc = nullptr;
   AccessibleWrap::Shutdown();
--- a/accessible/src/generic/BaseAccessibles.h
+++ b/accessible/src/generic/BaseAccessibles.h
@@ -59,20 +59,18 @@ public:
 
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIAccessible
   NS_IMETHOD GetActionName(uint8_t aIndex, nsAString& aName);
   NS_IMETHOD DoAction(uint8_t index);
   NS_IMETHOD TakeFocus();
 
-  // nsAccessNode
+  // Accessible
   virtual void Shutdown();
-
-  // Accessible
   virtual void Value(nsString& aValue);
   virtual uint64_t NativeLinkState() const;
 
   // ActionAccessible
   virtual uint8_t ActionCount();
   virtual KeyBinding AccessKey() const;
 
   // HyperLinkAccessible
--- a/accessible/src/generic/DocAccessible.cpp
+++ b/accessible/src/generic/DocAccessible.cpp
@@ -547,17 +547,17 @@ DocAccessible::GetAccessible(nsINode* aN
   if (parent)
     parent->TestChildCache(accessible);
 #endif
 
   return accessible;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsAccessNode
+// Accessible
 
 void
 DocAccessible::Init()
 {
 #ifdef A11Y_LOG
   if (logging::IsEnabled(logging::eDocCreate))
     logging::DocCreate("document initialize", mDocumentNode, this);
 #endif
--- a/accessible/src/generic/DocAccessible.h
+++ b/accessible/src/generic/DocAccessible.h
@@ -66,24 +66,23 @@ public:
 
   // nsIScrollPositionListener
   virtual void ScrollPositionWillChange(nscoord aX, nscoord aY) {}
   virtual void ScrollPositionDidChange(nscoord aX, nscoord aY);
 
   // nsIDocumentObserver
   NS_DECL_NSIDOCUMENTOBSERVER
 
-  // nsAccessNode
+  // Accessible
   virtual void Init();
   virtual void Shutdown();
   virtual nsIFrame* GetFrame() const;
   virtual nsINode* GetNode() const { return mDocumentNode; }
   nsIDocument* DocumentNode() const { return mDocumentNode; }
 
-  // Accessible
   virtual mozilla::a11y::ENameValueFlag Name(nsString& aName);
   virtual void Description(nsString& aDescription);
   virtual Accessible* FocusedChild();
   virtual mozilla::a11y::role NativeRole();
   virtual uint64_t NativeState();
   virtual uint64_t NativeInteractiveState() const;
   virtual bool NativelyUnavailable() const;
   virtual void ApplyARIAState(uint64_t* aState) const;
@@ -217,17 +216,17 @@ public:
    * Return whether the given DOM node has an accessible or not.
    */
   bool HasAccessible(nsINode* aNode) const
     { return GetAccessible(aNode); }
 
   /**
    * Return the cached accessible by the given unique ID within this document.
    *
-   * @note   the unique ID matches with the uniqueID() of nsAccessNode
+   * @note   the unique ID matches with the uniqueID() of Accessible
    *
    * @param  aUniqueID  [in] the unique ID used to cache the node.
    */
   Accessible* GetAccessibleByUniqueID(void* aUniqueID)
   {
     return UniqueID() == aUniqueID ?
       this : mAccessibleCache.GetWeak(aUniqueID);
   }
--- a/accessible/src/generic/OuterDocAccessible.cpp
+++ b/accessible/src/generic/OuterDocAccessible.cpp
@@ -97,17 +97,17 @@ OuterDocAccessible::GetActionDescription
 
 NS_IMETHODIMP
 OuterDocAccessible::DoAction(uint8_t aIndex)
 {
   return NS_ERROR_INVALID_ARG;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsAccessNode public
+// Accessible public
 
 void
 OuterDocAccessible::Shutdown()
 {
   // XXX: sometimes outerdoc accessible is shutdown because of layout style
   // change however the presshell of underlying document isn't destroyed and
   // the document doesn't get pagehide events. Schedule a document rebind
   // to its parent document. Otherwise a document accessible may be lost if its
@@ -128,19 +128,16 @@ OuterDocAccessible::Shutdown()
 #endif
     RemoveChild(child);
     mDoc->BindChildDocument(child->AsDoc());
   }
 
   AccessibleWrap::Shutdown();
 }
 
-////////////////////////////////////////////////////////////////////////////////
-// Accessible public
-
 void
 OuterDocAccessible::InvalidateChildren()
 {
   // Do not invalidate children because DocManager is responsible for
   // document accessible lifetime when DOM document is created or destroyed. If
   // DOM document isn't destroyed but its presshell is destroyed (for example,
   // when DOM node of outerdoc accessible is hidden), then outerdoc accessible
   // notifies DocManager about this. If presshell is created for existing
--- a/accessible/src/generic/OuterDocAccessible.h
+++ b/accessible/src/generic/OuterDocAccessible.h
@@ -28,20 +28,18 @@ public:
 
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIAccessible
   NS_IMETHOD GetActionName(uint8_t aIndex, nsAString& aName);
   NS_IMETHOD GetActionDescription(uint8_t aIndex, nsAString& aDescription);
   NS_IMETHOD DoAction(uint8_t aIndex);
 
-  // nsAccessNode
+  // Accessible
   virtual void Shutdown();
-
-  // Accessible
   virtual mozilla::a11y::role NativeRole();
   virtual Accessible* ChildAtPoint(int32_t aX, int32_t aY,
                                    EWhichChildAtPoint aWhichChild);
 
   virtual void InvalidateChildren();
   virtual bool InsertChildAt(uint32_t aIdx, Accessible* aChild) MOZ_OVERRIDE;
   virtual bool RemoveChild(Accessible* aAccessible);
 
--- a/accessible/src/generic/RootAccessible.cpp
+++ b/accessible/src/generic/RootAccessible.cpp
@@ -462,22 +462,22 @@ RootAccessible::ProcessDOMEvent(nsIDOMEv
     nsEventShell::FireEvent(nsIAccessibleEvent::EVENT_DRAGDROP_START,
                             accessible);
   }
 #endif
 }
 
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsAccessNode
+// Accessible
 
 void
 RootAccessible::Shutdown()
 {
-  // Called manually or by nsAccessNode::LastRelease()
+  // Called manually or by Accessible::LastRelease()
   if (!PresShell())
     return;  // Already shutdown
 
   DocAccessibleWrap::Shutdown();
 }
 
 // nsIAccessible method
 Relation
--- a/accessible/src/generic/RootAccessible.h
+++ b/accessible/src/generic/RootAccessible.h
@@ -24,20 +24,18 @@ class RootAccessible : public DocAccessi
 public:
   RootAccessible(nsIDocument* aDocument, nsIContent* aRootContent,
                  nsIPresShell* aPresShell);
   virtual ~RootAccessible();
 
   // nsIDOMEventListener
   NS_IMETHOD HandleEvent(nsIDOMEvent* aEvent);
 
-  // nsAccessNode
+  // Accessible
   virtual void Shutdown();
-
-  // Accessible
   virtual mozilla::a11y::ENameValueFlag Name(nsString& aName);
   virtual Relation RelationByType(RelationType aType) MOZ_OVERRIDE;
   virtual mozilla::a11y::role NativeRole();
   virtual uint64_t NativeState();
 
   // RootAccessible
 
   /**
--- a/accessible/src/html/HTMLListAccessible.cpp
+++ b/accessible/src/html/HTMLListAccessible.cpp
@@ -142,28 +142,25 @@ HTMLLIAccessible::CacheChildren()
 HTMLListBulletAccessible::
   HTMLListBulletAccessible(nsIContent* aContent, DocAccessible* aDoc) :
   LeafAccessible(aContent, aDoc)
 {
   mStateFlags |= eSharedNode;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// HTMLListBulletAccessible: nsAccessNode
+// HTMLListBulletAccessible: Accessible
 
 nsIFrame*
 HTMLListBulletAccessible::GetFrame() const
 {
   nsBlockFrame* blockFrame = do_QueryFrame(mContent->GetPrimaryFrame());
   return blockFrame ? blockFrame->GetBullet() : nullptr;
 }
 
-////////////////////////////////////////////////////////////////////////////////
-// HTMLListBulletAccessible: Accessible
-
 ENameValueFlag
 HTMLListBulletAccessible::Name(nsString &aName)
 {
   aName.Truncate();
 
   // Native anonymous content, ARIA can't be used. Get list bullet text.
   nsBlockFrame* blockFrame = do_QueryFrame(mContent->GetPrimaryFrame());
   if (blockFrame) {
--- a/accessible/src/html/HTMLListAccessible.h
+++ b/accessible/src/html/HTMLListAccessible.h
@@ -41,24 +41,22 @@ class HTMLLIAccessible : public HyperTex
 {
 public:
   HTMLLIAccessible(nsIContent* aContent, DocAccessible* aDoc);
   virtual ~HTMLLIAccessible() { }
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
-  // nsAccessNode
-  virtual void Shutdown();
-
   // nsIAccessible
   NS_IMETHOD GetBounds(int32_t* aX, int32_t* aY,
                        int32_t* aWidth, int32_t* aHeight);
 
   // Accessible
+  virtual void Shutdown();
   virtual a11y::role NativeRole();
   virtual uint64_t NativeState();
 
   // nsHTMLLIAccessible
   void UpdateBullet(bool aHasBullet);
 
 protected:
   // Accessible
@@ -73,20 +71,18 @@ private:
  * Used for bullet of HTML list item element (for example, HTML li).
  */
 class HTMLListBulletAccessible : public LeafAccessible
 {
 public:
   HTMLListBulletAccessible(nsIContent* aContent, DocAccessible* aDoc);
   virtual ~HTMLListBulletAccessible() { }
 
-  // nsAccessNode
+  // Accessible
   virtual nsIFrame* GetFrame() const;
-
-  // Accessible
   virtual ENameValueFlag Name(nsString& aName);
   virtual a11y::role NativeRole();
   virtual uint64_t NativeState();
   virtual void AppendTextTo(nsAString& aText, uint32_t aStartOffset = 0,
                             uint32_t aLength = UINT32_MAX);
 
   // HTMLListBulletAccessible
 
--- a/accessible/src/html/HTMLSelectAccessible.cpp
+++ b/accessible/src/html/HTMLSelectAccessible.cpp
@@ -590,36 +590,33 @@ HTMLComboboxListAccessible::
   HTMLComboboxListAccessible(nsIAccessible* aParent, nsIContent* aContent,
                              DocAccessible* aDoc) :
   HTMLSelectListAccessible(aContent, aDoc)
 {
   mStateFlags |= eSharedNode;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// HTMLComboboxAccessible: nsAccessNode
+// HTMLComboboxAccessible: Accessible
 
 nsIFrame*
 HTMLComboboxListAccessible::GetFrame() const
 {
   nsIFrame* frame = HTMLSelectListAccessible::GetFrame();
 
   if (frame) {
     nsIComboboxControlFrame* comboBox = do_QueryFrame(frame);
     if (comboBox) {
       return comboBox->GetDropDown();
     }
   }
 
   return nullptr;
 }
 
-////////////////////////////////////////////////////////////////////////////////
-// HTMLComboboxAccessible: Accessible
-
 role
 HTMLComboboxListAccessible::NativeRole()
 {
   return roles::COMBOBOX_LIST;
 }
 
 uint64_t
 HTMLComboboxListAccessible::NativeState()
--- a/accessible/src/html/HTMLSelectAccessible.h
+++ b/accessible/src/html/HTMLSelectAccessible.h
@@ -170,20 +170,18 @@ public:
 
   HTMLComboboxAccessible(nsIContent* aContent, DocAccessible* aDoc);
   virtual ~HTMLComboboxAccessible() {}
 
   // nsIAccessible
   NS_IMETHOD DoAction(uint8_t index);
   NS_IMETHOD GetActionName(uint8_t aIndex, nsAString& aName);
 
-  // nsAccessNode
+  // Accessible
   virtual void Shutdown();
-
-  // Accessible
   virtual void Description(nsString& aDescription);
   virtual void Value(nsString& aValue);
   virtual a11y::role NativeRole();
   virtual uint64_t NativeState();
   virtual void InvalidateChildren();
 
   // ActionAccessible
   virtual uint8_t ActionCount();
@@ -216,20 +214,18 @@ private:
 class HTMLComboboxListAccessible : public HTMLSelectListAccessible
 {
 public:
 
   HTMLComboboxListAccessible(nsIAccessible* aParent, nsIContent* aContent,
                              DocAccessible* aDoc);
   virtual ~HTMLComboboxListAccessible() {}
 
-  // nsAccessNode
+  // Accessible
   virtual nsIFrame* GetFrame() const;
-
-  // Accessible
   virtual a11y::role NativeRole();
   virtual uint64_t NativeState();
   virtual void GetBoundsRect(nsRect& aBounds, nsIFrame** aBoundingFrame);
 
   // Widgets
   virtual bool IsActiveWidget() const;
   virtual bool AreItemsOperable() const;
 };
--- a/accessible/src/html/HTMLTableAccessible.cpp
+++ b/accessible/src/html/HTMLTableAccessible.cpp
@@ -360,29 +360,25 @@ HTMLTableRowAccessible::NativeRole()
 ////////////////////////////////////////////////////////////////////////////////
 // HTMLTableAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
 NS_IMPL_ISUPPORTS_INHERITED1(HTMLTableAccessible, Accessible,
                              nsIAccessibleTable)
 
 ////////////////////////////////////////////////////////////////////////////////
-//nsAccessNode
+// HTMLTableAccessible: Accessible
 
 void
 HTMLTableAccessible::Shutdown()
 {
   mTable = nullptr;
   AccessibleWrap::Shutdown();
 }
 
-
-////////////////////////////////////////////////////////////////////////////////
-// HTMLTableAccessible: Accessible implementation
-
 void
 HTMLTableAccessible::CacheChildren()
 {
   // Move caption accessible so that it's the first child. Check for the first
   // caption only, because nsAccessibilityService ensures we don't create
   // accessibles for the other captions, since only the first is actually
   // visible.
   TreeWalker walker(this, mContent);
--- a/accessible/src/html/HTMLTableAccessible.h
+++ b/accessible/src/html/HTMLTableAccessible.h
@@ -158,20 +158,18 @@ public:
   virtual void SelectedRowIndices(nsTArray<uint32_t>* aRows);
   virtual void SelectCol(uint32_t aColIdx);
   virtual void SelectRow(uint32_t aRowIdx);
   virtual void UnselectCol(uint32_t aColIdx);
   virtual void UnselectRow(uint32_t aRowIdx);
   virtual bool IsProbablyLayoutTable();
   virtual Accessible* AsAccessible() { return this; }
 
-  // nsAccessNode
+  // Accessible
   virtual void Shutdown();
-
-  // Accessible
   virtual TableAccessible* AsTable() { return this; }
   virtual void Description(nsString& aDescription);
   virtual a11y::role NativeRole();
   virtual uint64_t NativeState();
   virtual already_AddRefed<nsIPersistentProperties> NativeAttributes() MOZ_OVERRIDE;
   virtual Relation RelationByType(RelationType aRelationType) MOZ_OVERRIDE;
 
 protected:
--- a/accessible/src/windows/msaa/DocAccessibleWrap.cpp
+++ b/accessible/src/windows/msaa/DocAccessibleWrap.cpp
@@ -72,17 +72,17 @@ DocAccessibleWrap::get_accValue(VARIANT 
 
   *aValue = ::SysAllocStringLen(URL.get(), URL.Length());
   return *aValue ? S_OK : E_OUTOFMEMORY;
 
   A11Y_TRYBLOCK_END
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsAccessNode
+// Accessible
 
 void
 DocAccessibleWrap::Shutdown()
 {
   // Do window emulation specific shutdown if emulation was started.
   if (nsWinUtils::IsWindowEmulationStarted()) {
     // Destroy window created for root document.
     if (mDocFlags & eTabDocument) {
--- a/accessible/src/windows/msaa/DocAccessibleWrap.h
+++ b/accessible/src/windows/msaa/DocAccessibleWrap.h
@@ -23,17 +23,17 @@ public:
 
   // IAccessible
 
     // Override get_accValue to provide URL when no other value is available
     virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_accValue( 
         /* [optional][in] */ VARIANT varChild,
         /* [retval][out] */ BSTR __RPC_FAR *pszValue);
 
-  // nsAccessNode
+  // Accessible
   virtual void Shutdown();
 
   // DocAccessible
   virtual void* GetNativeWindow() const;
 
 protected:
   // DocAccessible
   virtual void DoInitialUpdate();
--- a/accessible/src/windows/msaa/HTMLWin32ObjectAccessible.cpp
+++ b/accessible/src/windows/msaa/HTMLWin32ObjectAccessible.cpp
@@ -20,28 +20,25 @@ HTMLWin32ObjectOwnerAccessible::
   AccessibleWrap(aContent, aDoc), mHwnd(aHwnd)
 {
   // Our only child is a HTMLWin32ObjectAccessible object.
   if (mHwnd)
     mNativeAccessible = new HTMLWin32ObjectAccessible(mHwnd);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// HTMLWin32ObjectOwnerAccessible: nsAccessNode implementation
+// HTMLWin32ObjectOwnerAccessible: Accessible implementation
 
 void
 HTMLWin32ObjectOwnerAccessible::Shutdown()
 {
   AccessibleWrap::Shutdown();
   mNativeAccessible = nullptr;
 }
 
-////////////////////////////////////////////////////////////////////////////////
-// HTMLWin32ObjectOwnerAccessible: Accessible implementation
-
 role
 HTMLWin32ObjectOwnerAccessible::NativeRole()
 {
   return roles::EMBEDDED_OBJECT;
 }
 
 bool
 HTMLWin32ObjectOwnerAccessible::NativelyUnavailable() const
--- a/accessible/src/windows/msaa/HTMLWin32ObjectAccessible.h
+++ b/accessible/src/windows/msaa/HTMLWin32ObjectAccessible.h
@@ -21,20 +21,18 @@ public:
   // will still point to Gecko accessible sibling content. This is necessary
   // 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.
   HTMLWin32ObjectOwnerAccessible(nsIContent* aContent,
                                    DocAccessible* aDoc, void* aHwnd);
   virtual ~HTMLWin32ObjectOwnerAccessible() {}
 
-  // nsAccessNode
+  // Accessible
   virtual void Shutdown();
-
-  // Accessible
   virtual mozilla::a11y::role NativeRole();
   virtual bool NativelyUnavailable() const;
 
 protected:
 
   // Accessible
   virtual void CacheChildren();
 
--- a/accessible/src/xul/XULListboxAccessible.cpp
+++ b/accessible/src/xul/XULListboxAccessible.cpp
@@ -128,17 +128,17 @@ XULListboxAccessible::QueryInterface(REF
     NS_ADDREF_THIS();
     return NS_OK;
   }
 
   return NS_ERROR_NO_INTERFACE;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-//nsAccessNode
+// Accessible
 
 void
 XULListboxAccessible::Shutdown()
 {
   mTable = nullptr;
   XULSelectControlAccessible::Shutdown();
 }
 
--- a/accessible/src/xul/XULListboxAccessible.h
+++ b/accessible/src/xul/XULListboxAccessible.h
@@ -87,20 +87,18 @@ public:
   virtual void SelectedCells(nsTArray<Accessible*>* aCells);
   virtual void SelectedCellIndices(nsTArray<uint32_t>* aCells);
   virtual void SelectedColIndices(nsTArray<uint32_t>* aCols);
   virtual void SelectedRowIndices(nsTArray<uint32_t>* aRows);
   virtual void SelectRow(uint32_t aRowIdx);
   virtual void UnselectRow(uint32_t aRowIdx);
   virtual Accessible* AsAccessible() { return this; }
 
-  // nsAccessNode
+  // Accessible
   virtual void Shutdown();
-
-  // Accessible
   virtual void Value(nsString& aValue);
   virtual TableAccessible* AsTable() { return this; }
   virtual a11y::role NativeRole();
   virtual uint64_t NativeState();
 
   // Widgets
   virtual bool IsWidget() const;
   virtual bool IsActiveWidget() const;
--- a/accessible/src/xul/XULSelectControlAccessible.cpp
+++ b/accessible/src/xul/XULSelectControlAccessible.cpp
@@ -31,17 +31,17 @@ XULSelectControlAccessible::
   XULSelectControlAccessible(nsIContent* aContent, DocAccessible* aDoc) :
   AccessibleWrap(aContent, aDoc)
 {
   mGenericTypes |= eSelect;
   mSelectControl = do_QueryInterface(aContent);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// XULSelectControlAccessible: nsAccessNode
+// XULSelectControlAccessible: Accessible
 
 void
 XULSelectControlAccessible::Shutdown()
 {
   mSelectControl = nullptr;
   AccessibleWrap::Shutdown();
 }
 
--- a/accessible/src/xul/XULSelectControlAccessible.h
+++ b/accessible/src/xul/XULSelectControlAccessible.h
@@ -17,17 +17,17 @@ namespace a11y {
  * The basic implementation of accessible selection for XUL select controls.
  */
 class XULSelectControlAccessible : public AccessibleWrap
 {
 public:
   XULSelectControlAccessible(nsIContent* aContent, DocAccessible* aDoc);
   virtual ~XULSelectControlAccessible() {}
 
-  // nsAccessNode
+  // Accessible
   virtual void Shutdown();
 
   // SelectAccessible
   virtual already_AddRefed<nsIArray> SelectedItems();
   virtual uint32_t SelectedItemCount();
   virtual Accessible* GetSelectedItem(uint32_t aIndex);
   virtual bool IsItemSelected(uint32_t aIndex);
   virtual bool AddItemToSelection(uint32_t aIndex);
--- a/accessible/src/xul/XULTreeAccessible.cpp
+++ b/accessible/src/xul/XULTreeAccessible.cpp
@@ -129,36 +129,33 @@ XULTreeAccessible::Value(nsString& aValu
       cols->GetKeyColumn(getter_AddRefs(keyCol));
 
     mTreeView->GetCellText(currentIndex, keyCol, aValue);
   }
 
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// XULTreeAccessible: nsAccessNode implementation
+// XULTreeAccessible: Accessible implementation
 
 void
 XULTreeAccessible::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 = nullptr;
   mTreeView = nullptr;
 
   AccessibleWrap::Shutdown();
 }
 
-////////////////////////////////////////////////////////////////////////////////
-// XULTreeAccessible: Accessible implementation (put methods here)
-
 role
 XULTreeAccessible::NativeRole()
 {
   // No primary column means we're in a list. In fact, history and mail turn off
   // the primary flag when switching to a flat view.
 
   nsIContent* child = nsTreeUtils::GetDescendantChild(mContent, nsGkAtoms::treechildren);
   NS_ASSERTION(child, "tree without treechildren!");
@@ -884,32 +881,28 @@ XULTreeItemAccessibleBase::DoAction(uint
       (aIndex != eAction_Expand || !IsExpandable()))
     return NS_ERROR_INVALID_ARG;
 
   DoCommand(nullptr, aIndex);
   return NS_OK;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// XULTreeItemAccessibleBase: nsAccessNode implementation
+// XULTreeItemAccessibleBase: Accessible implementation
 
 void
 XULTreeItemAccessibleBase::Shutdown()
 {
   mTree = nullptr;
   mTreeView = nullptr;
   mRow = -1;
 
   AccessibleWrap::Shutdown();
 }
 
-////////////////////////////////////////////////////////////////////////////////
-// XULTreeItemAccessibleBase: Accessible public methods
-
-// nsIAccessible::groupPosition
 GroupPos
 XULTreeItemAccessibleBase::GroupPosition()
 {
   GroupPos groupPos;
 
   int32_t level;
   nsresult rv = mTreeView->GetLevel(mRow, &level);
   NS_ENSURE_SUCCESS(rv, groupPos);
@@ -1129,28 +1122,25 @@ XULTreeItemAccessible::Name(nsString& aN
 {
   aName.Truncate();
 
   GetCellName(mColumn, aName);
   return eNameOK;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// XULTreeItemAccessible: nsAccessNode implementation
+// XULTreeItemAccessible: Accessible implementation
 
 void
 XULTreeItemAccessible::Shutdown()
 {
   mColumn = nullptr;
   XULTreeItemAccessibleBase::Shutdown();
 }
 
-////////////////////////////////////////////////////////////////////////////////
-// XULTreeItemAccessible: Accessible implementation
-
 role
 XULTreeItemAccessible::NativeRole()
 {
   nsCOMPtr<nsITreeColumns> columns;
   mTree->GetColumns(getter_AddRefs(columns));
   if (!columns) {
     NS_ERROR("No tree columns object in the tree!");
     return roles::NOTHING;
--- a/accessible/src/xul/XULTreeAccessible.h
+++ b/accessible/src/xul/XULTreeAccessible.h
@@ -33,20 +33,18 @@ public:
 
   XULTreeAccessible(nsIContent* aContent, DocAccessible* aDoc,
                     nsTreeBodyFrame* aTreeframe);
 
   // nsISupports and cycle collection
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(XULTreeAccessible, Accessible)
 
-  // nsAccessNode
+  // Accessible
   virtual void Shutdown();
-
-  // Accessible
   virtual void Value(nsString& aValue);
   virtual a11y::role NativeRole();
   virtual uint64_t NativeState();
   virtual Accessible* ChildAtPoint(int32_t aX, int32_t aY,
                                    EWhichChildAtPoint aWhichChild);
 
   virtual Accessible* GetChildAt(uint32_t aIndex);
   virtual uint32_t ChildCount() const;
@@ -150,20 +148,18 @@ public:
                        int32_t *aWidth, int32_t *aHeight);
 
   NS_IMETHOD SetSelected(bool aSelect);
   NS_IMETHOD TakeFocus();
 
   NS_IMETHOD GetActionName(uint8_t aIndex, nsAString& aName);
   NS_IMETHOD DoAction(uint8_t aIndex);
 
-  // nsAccessNode
+  // Accessible
   virtual void Shutdown();
-
-  // Accessible
   virtual GroupPos GroupPosition();
   virtual uint64_t NativeState();
   virtual uint64_t NativeInteractiveState() const;
   virtual int32_t IndexInParent() const;
   virtual Relation RelationByType(RelationType aType) MOZ_OVERRIDE;
   virtual Accessible* FocusedChild();
 
   // ActionAccessible
@@ -231,20 +227,18 @@ public:
                         Accessible* aParent, nsITreeBoxObject* aTree,
                         nsITreeView* aTreeView, int32_t aRow);
 
   // nsISupports and cycle collection
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(XULTreeItemAccessible,
                                            XULTreeItemAccessibleBase)
 
-  // nsAccessNode
+  // Accessible
   virtual void Shutdown();
-
-  // Accessible
   virtual ENameValueFlag Name(nsString& aName);
   virtual a11y::role NativeRole();
 
   // XULTreeItemAccessibleBase
   virtual void RowInvalidated(int32_t aStartColIdx, int32_t aEndColIdx);
 
 protected:
 
--- a/accessible/src/xul/XULTreeGridAccessible.cpp
+++ b/accessible/src/xul/XULTreeGridAccessible.cpp
@@ -215,28 +215,25 @@ XULTreeGridAccessible::UnselectRow(uint3
   nsCOMPtr<nsITreeSelection> selection;
   mTreeView->GetSelection(getter_AddRefs(selection));
 
   if (selection)
     selection->ClearRange(aRowIdx, aRowIdx);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// XULTreeGridAccessible: nsAccessNode implementation
+// XULTreeGridAccessible: Accessible implementation
 
 void
 XULTreeGridAccessible::Shutdown()
 {
   mTable = nullptr;
   XULTreeAccessible::Shutdown();
 }
 
-////////////////////////////////////////////////////////////////////////////////
-// XULTreeGridAccessible: Accessible implementation
-
 role
 XULTreeGridAccessible::NativeRole()
 {
   nsCOMPtr<nsITreeColumns> treeColumns;
   mTree->GetColumns(getter_AddRefs(treeColumns));
   if (!treeColumns) {
     NS_ERROR("No treecolumns object for tree!");
     return roles::NOTHING;
@@ -286,28 +283,25 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_
 NS_INTERFACE_MAP_END_INHERITING(XULTreeItemAccessibleBase)
 
 NS_IMPL_ADDREF_INHERITED(XULTreeGridRowAccessible,
                          XULTreeItemAccessibleBase)
 NS_IMPL_RELEASE_INHERITED(XULTreeGridRowAccessible,
                           XULTreeItemAccessibleBase)
 
 ////////////////////////////////////////////////////////////////////////////////
-// XULTreeGridRowAccessible: nsAccessNode implementation
+// XULTreeGridRowAccessible: Accessible implementation
 
 void
 XULTreeGridRowAccessible::Shutdown()
 {
   ClearCache(mAccessibleCache);
   XULTreeItemAccessibleBase::Shutdown();
 }
 
-////////////////////////////////////////////////////////////////////////////////
-// XULTreeGridRowAccessible: Accessible implementation
-
 role
 XULTreeGridRowAccessible::NativeRole()
 {
   return roles::ROW;
 }
 
 ENameValueFlag
 XULTreeGridRowAccessible::Name(nsString& aName)
--- a/accessible/src/xul/XULTreeGridAccessible.h
+++ b/accessible/src/xul/XULTreeGridAccessible.h
@@ -49,20 +49,18 @@ public:
   virtual void SelectedCells(nsTArray<Accessible*>* aCells);
   virtual void SelectedCellIndices(nsTArray<uint32_t>* aCells);
   virtual void SelectedColIndices(nsTArray<uint32_t>* aCols);
   virtual void SelectedRowIndices(nsTArray<uint32_t>* aRows);
   virtual void SelectRow(uint32_t aRowIdx);
   virtual void UnselectRow(uint32_t aRowIdx);
   virtual Accessible* AsAccessible() { return this; }
 
-  // nsAccessNode
+  // Accessible
   virtual void Shutdown();
-
-  // Accessible
   virtual TableAccessible* AsTable() { return this; }
   virtual a11y::role NativeRole();
 
 protected:
 
   // XULTreeAccessible
   virtual already_AddRefed<Accessible> CreateTreeItemAccessible(int32_t aRow);
 };
@@ -81,20 +79,18 @@ public:
                            Accessible* aParent, nsITreeBoxObject* aTree,
                            nsITreeView* aTreeView, int32_t aRow);
 
   // nsISupports and cycle collection
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(XULTreeGridRowAccessible,
                                            XULTreeItemAccessibleBase)
 
-  // nsAccessNode
+  // Accessible
   virtual void Shutdown();
-
-  // Accessible
   virtual a11y::role NativeRole();
   virtual ENameValueFlag Name(nsString& aName);
   virtual Accessible* ChildAtPoint(int32_t aX, int32_t aY,
                                    EWhichChildAtPoint aWhichChild);
 
   virtual Accessible* GetChildAt(uint32_t aIndex);
   virtual uint32_t ChildCount() const;