Bug 762389 - de-ns-ify nsXULTreeAccessible and nsXULTreeGridAccessible, r=surkov
authorMark Capella <markcapella@twcny.rr.com>
Fri, 08 Jun 2012 06:28:27 -0400
changeset 96160 8d547fb468e702c32659d126249d6bdc7f06c0b0
parent 96159 d04694a800165c8f5bb905fe85c6e40a7ad2d110
child 96161 67933a562482e30928800b2b23c875e26d90c508
push id22876
push useremorley@mozilla.com
push dateFri, 08 Jun 2012 20:48:39 +0000
treeherdermozilla-central@827c1fac4905 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssurkov
bugs762389
milestone16.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 762389 - de-ns-ify nsXULTreeAccessible and nsXULTreeGridAccessible, r=surkov
accessible/src/atk/XULTreeGridAccessibleWrap.h
accessible/src/atk/nsXULTreeGridAccessibleWrap.h
accessible/src/base/nsAccUtils.h
accessible/src/base/nsAccessibilityService.cpp
accessible/src/base/nsAccessibilityService.h
accessible/src/generic/Accessible.h
accessible/src/generic/RootAccessible.cpp
accessible/src/generic/RootAccessible.h
accessible/src/mac/XULTreeGridAccessibleWrap.h
accessible/src/mac/nsXULTreeGridAccessibleWrap.h
accessible/src/msaa/Makefile.in
accessible/src/msaa/XULTreeGridAccessibleWrap.cpp
accessible/src/msaa/XULTreeGridAccessibleWrap.h
accessible/src/msaa/nsXULTreeGridAccessibleWrap.cpp
accessible/src/msaa/nsXULTreeGridAccessibleWrap.h
accessible/src/other/XULTreeGridAccessibleWrap.h
accessible/src/other/nsXULTreeGridAccessibleWrap.h
accessible/src/xul/Makefile.in
accessible/src/xul/XULTreeAccessible.cpp
accessible/src/xul/XULTreeAccessible.h
accessible/src/xul/XULTreeGridAccessible.cpp
accessible/src/xul/XULTreeGridAccessible.h
accessible/src/xul/nsXULTreeAccessible.cpp
accessible/src/xul/nsXULTreeAccessible.h
accessible/src/xul/nsXULTreeGridAccessible.cpp
accessible/src/xul/nsXULTreeGridAccessible.h
rename from accessible/src/atk/nsXULTreeGridAccessibleWrap.h
rename to accessible/src/atk/XULTreeGridAccessibleWrap.h
--- a/accessible/src/atk/nsXULTreeGridAccessibleWrap.h
+++ b/accessible/src/atk/XULTreeGridAccessibleWrap.h
@@ -1,16 +1,22 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=2 et sw=2 tw=80: */
 /* 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/. */
 
-#ifndef __nsXULTreeGridAccessibleWrap_h__
-#define __nsXULTreeGridAccessibleWrap_h__
+#ifndef mozilla_a11y_XULTreeGridAccessibleWrap_h__
+#define mozilla_a11y_XULTreeGridAccessibleWrap_h__
+
+#include "XULTreeGridAccessible.h"
 
-#include "nsXULTreeGridAccessible.h"
+namespace mozilla {
+namespace a11y {
 
-typedef class nsXULTreeGridAccessible nsXULTreeGridAccessibleWrap;
-typedef class nsXULTreeGridCellAccessible nsXULTreeGridCellAccessibleWrap;
+typedef class XULTreeGridAccessible XULTreeGridAccessibleWrap;
+typedef class XULTreeGridCellAccessible XULTreeGridCellAccessibleWrap;
+
+} // namespace a11y
+} // namespace mozilla
 
 #endif
 
--- a/accessible/src/base/nsAccUtils.h
+++ b/accessible/src/base/nsAccUtils.h
@@ -21,19 +21,16 @@
 #include "nsIPresShell.h"
 #include "nsPoint.h"
 
 class nsAccessNode;
 class Accessible;
 class HyperTextAccessible;
 class DocAccessible;
 struct nsRoleMapEntry;
-#ifdef MOZ_XUL
-class nsXULTreeAccessible;
-#endif
 
 class nsAccUtils
 {
 public:
   /**
    * Returns value of attribute from the given attributes container.
    *
    * @param aAttributes - attributes container
--- a/accessible/src/base/nsAccessibilityService.cpp
+++ b/accessible/src/base/nsAccessibilityService.cpp
@@ -71,17 +71,17 @@
 #include "nsXULColorPickerAccessible.h"
 #include "nsXULComboboxAccessible.h"
 #include "XULFormControlAccessible.h"
 #include "nsXULListboxAccessibleWrap.h"
 #include "nsXULMenuAccessibleWrap.h"
 #include "nsXULSliderAccessible.h"
 #include "nsXULTabAccessible.h"
 #include "nsXULTextAccessible.h"
-#include "nsXULTreeGridAccessibleWrap.h"
+#include "XULTreeGridAccessibleWrap.h"
 #endif
 
 using namespace mozilla;
 using namespace mozilla::a11y;
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsAccessibilityService
 ////////////////////////////////////////////////////////////////////////////////
@@ -525,17 +525,17 @@ void
 nsAccessibilityService::TreeViewChanged(nsIPresShell* aPresShell,
                                         nsIContent* aContent,
                                         nsITreeView* aView)
 {
   DocAccessible* document = GetDocAccessible(aPresShell);
   if (document) {
     Accessible* accessible = document->GetAccessible(aContent);
     if (accessible) {
-      nsXULTreeAccessible* treeAcc = accessible->AsXULTree();
+      XULTreeAccessible* treeAcc = accessible->AsXULTree();
       if (treeAcc) 
         treeAcc->TreeViewChanged(aView);
     }
   }
 }
 
 void
 nsAccessibilityService::UpdateListBullet(nsIPresShell* aPresShell,
@@ -1455,17 +1455,17 @@ nsAccessibilityService::CreateAccessible
     case nsIAccessibleProvider::XULThumb:
       accessible = new nsXULThumbAccessible(aContent, aDoc);
       break;
 
     case nsIAccessibleProvider::XULTree:
       return CreateAccessibleForXULTree(aContent, aDoc);
 
     case nsIAccessibleProvider::XULTreeColumns:
-      accessible = new nsXULTreeColumAccessible(aContent, aDoc);
+      accessible = new XULTreeColumAccessible(aContent, aDoc);
       break;
 
     case nsIAccessibleProvider::XULTreeColumnItem:
       accessible = new nsXULColumnItemAccessible(aContent, aDoc);
       break;
 
     case nsIAccessibleProvider::XULToolbar:
       accessible = new XULToolbarAccessible(aContent, aDoc);
@@ -1798,23 +1798,23 @@ nsAccessibilityService::CreateAccessible
   if (!treeColumns)
     return nsnull;
 
   PRInt32 count = 0;
   treeColumns->GetCount(&count);
 
   // Outline of list accessible.
   if (count == 1) {
-    Accessible* accessible = new nsXULTreeAccessible(aContent, aDoc);
+    Accessible* accessible = new XULTreeAccessible(aContent, aDoc);
     NS_IF_ADDREF(accessible);
     return accessible;
   }
 
   // Table or tree table accessible.
-  Accessible* accessible = new nsXULTreeGridAccessibleWrap(aContent, aDoc);
+  Accessible* accessible = new XULTreeGridAccessibleWrap(aContent, aDoc);
   NS_IF_ADDREF(accessible);
   return accessible;
 }
 #endif
 
 ////////////////////////////////////////////////////////////////////////////////
 // Services
 ////////////////////////////////////////////////////////////////////////////////
--- a/accessible/src/base/nsAccessibilityService.h
+++ b/accessible/src/base/nsAccessibilityService.h
@@ -165,17 +165,17 @@ public:
    */
   static bool IsShutdown() { return gIsShutdown; }
 
   /**
    * Return an accessible for the given DOM node from the cache or create new
    * one.
    *
    * @param  aNode             [in] the given node
-   * @param  aDoc              [in] the doc accessible of the node  
+   * @param  aDoc              [in] the doc accessible of the node
    * @param  aIsSubtreeHidden  [out, optional] indicates whether the node's
    *                             frame and its subtree is hidden
    */
   Accessible* GetOrCreateAccessible(nsINode* aNode, DocAccessible* aDoc,
                                     bool* aIsSubtreeHidden = nsnull);
 
 private:
   // nsAccessibilityService creation is controlled by friend
--- a/accessible/src/generic/Accessible.h
+++ b/accessible/src/generic/Accessible.h
@@ -33,16 +33,17 @@ class Relation;
 namespace mozilla {
 namespace a11y {
 
 class HTMLImageMapAccessible;
 class HTMLLIAccessible;
 class ImageAccessible;
 class TableAccessible;
 class TextLeafAccessible;
+class XULTreeAccessible;
 
 /**
  * Name type flags.
  */
 enum ENameValueFlag {
   /**
    * Name either
    *  a) present (not empty): !name.IsEmpty()
@@ -63,18 +64,16 @@ struct GroupPos
   PRInt32 level;
   PRInt32 posInSet;
   PRInt32 setSize;
 };
 
 } // namespace a11y
 } // namespace mozilla
 
-class nsXULTreeAccessible;
-
 struct nsRect;
 class nsIContent;
 class nsIFrame;
 class nsIAtom;
 class nsIView;
 
 typedef nsRefPtrHashtable<nsPtrHashKey<const void>, Accessible>
   AccessibleHashtable;
@@ -95,18 +94,18 @@ NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODUL
 #define NS_ACCESSIBLE_IMPL_IID                          \
 {  /* 133c8bf4-4913-4355-bd50-426bd1d6e1ad */           \
   0x133c8bf4,                                           \
   0x4913,                                               \
   0x4355,                                               \
   { 0xbd, 0x50, 0x42, 0x6b, 0xd1, 0xd6, 0xe1, 0xad }    \
 }
 
-class Accessible : public nsAccessNodeWrap, 
-                   public nsIAccessible, 
+class Accessible : public nsAccessNodeWrap,
+                   public nsIAccessible,
                    public nsIAccessibleHyperLink,
                    public nsIAccessibleSelectable,
                    public nsIAccessibleValue
 {
 public:
   Accessible(nsIContent* aContent, DocAccessible* aDoc);
   virtual ~Accessible();
 
@@ -311,17 +310,17 @@ public:
 
   //////////////////////////////////////////////////////////////////////////////
   // Initializing methods
 
   /**
    * Set the ARIA role map entry for a new accessible.
    * For a newly created accessible, specify which role map entry should be used.
    *
-   * @param aRoleMapEntry The ARIA nsRoleMapEntry* for the accessible, or 
+   * @param aRoleMapEntry The ARIA nsRoleMapEntry* for the accessible, or
    *                      nsnull if none.
    */
   virtual void SetRoleMapEntry(nsRoleMapEntry* aRoleMapEntry);
 
   /**
    * Update the children cache.
    */
   inline bool UpdateChildren()
@@ -502,17 +501,17 @@ public:
 
   inline bool IsImage() const { return mFlags & eImageAccessible; }
   mozilla::a11y::ImageAccessible* AsImage();
 
   bool IsImageMapAccessible() const { return mFlags & eImageMapAccessible; }
   mozilla::a11y::HTMLImageMapAccessible* AsImageMap();
 
   inline bool IsXULTree() const { return mFlags & eXULTreeAccessible; }
-  nsXULTreeAccessible* AsXULTree();
+  mozilla::a11y::XULTreeAccessible* AsXULTree();
 
   inline bool IsListControl() const { return mFlags & eListControlAccessible; }
 
   inline bool IsMenuButton() const { return mFlags & eMenuButtonAccessible; }
 
   inline bool IsMenuPopup() const { return mFlags & eMenuPopupAccessible; }
 
   inline bool IsRoot() const { return mFlags & eRootAccessible; }
--- a/accessible/src/generic/RootAccessible.cpp
+++ b/accessible/src/generic/RootAccessible.cpp
@@ -13,16 +13,19 @@
 #include "Accessible-inl.h"
 #include "DocAccessible-inl.h"
 #include "nsAccessibilityService.h"
 #include "nsAccUtils.h"
 #include "nsCoreUtils.h"
 #include "Relation.h"
 #include "Role.h"
 #include "States.h"
+#ifdef MOZ_XUL
+#include "XULTreeAccessible.h"
+#endif
 
 #include "mozilla/dom/Element.h"
 
 #include "nsIAccessibleRelation.h"
 #include "nsIDocShell.h"
 #include "nsIDocShellTreeItem.h"
 #include "nsIDocShellTreeNode.h"
 #include "nsIDocShellTreeOwner.h"
@@ -46,17 +49,16 @@
 #include "nsIServiceManager.h"
 #include "nsPIDOMWindow.h"
 #include "nsIWebBrowserChrome.h"
 #include "nsReadableUtils.h"
 #include "nsIPrivateDOMEvent.h"
 #include "nsFocusManager.h"
 
 #ifdef MOZ_XUL
-#include "nsXULTreeAccessible.h"
 #include "nsIXULDocument.h"
 #include "nsIXULWindow.h"
 #endif
 
 using namespace mozilla;
 using namespace mozilla::a11y;
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -319,17 +321,17 @@ RootAccessible::ProcessDOMEvent(nsIDOMEv
   Accessible* accessible = 
     targetDocument->GetAccessibleOrContainer(origTargetNode);
   if (!accessible)
     return;
 
   nsINode* targetNode = accessible->GetNode();
 
 #ifdef MOZ_XUL
-  nsXULTreeAccessible* treeAcc = accessible->AsXULTree();
+  XULTreeAccessible* treeAcc = accessible->AsXULTree();
   if (treeAcc) {
     if (eventType.EqualsLiteral("TreeRowCountChanged")) {
       HandleTreeRowCountChangedEvent(aDOMEvent, treeAcc);
       return;
     }
 
     if (eventType.EqualsLiteral("TreeInvalidated")) {
       HandleTreeInvalidatedEvent(aDOMEvent, treeAcc);
@@ -398,17 +400,17 @@ RootAccessible::ProcessDOMEvent(nsIDOMEv
       nsCOMPtr<nsIDOMXULMultiSelectControlElement> multiSel =
         do_QueryInterface(targetNode);
       nsAutoString selType;
       multiSel->GetSelType(selType);
       if (selType.IsEmpty() || !selType.EqualsLiteral("single")) {
         // XXX: We need to fire EVENT_SELECTION_ADD and EVENT_SELECTION_REMOVE
         // for each tree item. Perhaps each tree item will need to cache its
         // selection state and fire an event after a DOM "select" event when
-        // that state changes. nsXULTreeAccessible::UpdateTreeSelection();
+        // that state changes. XULTreeAccessible::UpdateTreeSelection();
         nsEventShell::FireEvent(nsIAccessibleEvent::EVENT_SELECTION_WITHIN,
                                 accessible);
         return;
       }
 
       nsRefPtr<AccSelChangeEvent> selChangeEvent =
         new AccSelChangeEvent(treeAcc, treeItemAcc,
                               AccSelChangeEvent::eSelectionAdd);
@@ -667,17 +669,17 @@ RootAccessible::HandlePopupHidingEvent(n
       new AccStateChangeEvent(widget, states::EXPANDED, false);
     document->FireDelayedAccessibleEvent(event);
   }
 }
 
 #ifdef MOZ_XUL
 void
 RootAccessible::HandleTreeRowCountChangedEvent(nsIDOMEvent* aEvent,
-                                               nsXULTreeAccessible* aAccessible)
+                                               XULTreeAccessible* aAccessible)
 {
   nsCOMPtr<nsIDOMDataContainerEvent> dataEvent(do_QueryInterface(aEvent));
   if (!dataEvent)
     return;
 
   nsCOMPtr<nsIVariant> indexVariant;
   dataEvent->GetData(NS_LITERAL_STRING("index"),
                      getter_AddRefs(indexVariant));
@@ -694,17 +696,17 @@ RootAccessible::HandleTreeRowCountChange
   indexVariant->GetAsInt32(&index);
   countVariant->GetAsInt32(&count);
 
   aAccessible->InvalidateCache(index, count);
 }
 
 void
 RootAccessible::HandleTreeInvalidatedEvent(nsIDOMEvent* aEvent,
-                                           nsXULTreeAccessible* aAccessible)
+                                           XULTreeAccessible* aAccessible)
 {
   nsCOMPtr<nsIDOMDataContainerEvent> dataEvent(do_QueryInterface(aEvent));
   if (!dataEvent)
     return;
 
   PRInt32 startRow = 0, endRow = -1, startCol = 0, endCol = -1;
 
   nsCOMPtr<nsIVariant> startRowVariant;
--- a/accessible/src/generic/RootAccessible.h
+++ b/accessible/src/generic/RootAccessible.h
@@ -10,17 +10,16 @@
 #include "DocAccessibleWrap.h"
 
 
 #include "nsHashtable.h"
 #include "nsCaretAccessible.h"
 #include "nsIDocument.h"
 #include "nsIDOMEventListener.h"
 
-class nsXULTreeAccessible;
 class Relation;
 
 namespace mozilla {
 namespace a11y {
 
 class RootAccessible : public DocAccessibleWrap,
                        public nsIDOMEventListener
 {
@@ -71,19 +70,19 @@ protected:
 
   /*
    * Process "popuphiding" event. Used by HandleEvent().
    */
   void HandlePopupHidingEvent(nsINode* aNode);
 
 #ifdef MOZ_XUL
     void HandleTreeRowCountChangedEvent(nsIDOMEvent* aEvent,
-                                        nsXULTreeAccessible* aAccessible);
+                                        XULTreeAccessible* aAccessible);
     void HandleTreeInvalidatedEvent(nsIDOMEvent* aEvent,
-                                    nsXULTreeAccessible* aAccessible);
+                                    XULTreeAccessible* aAccessible);
 
     PRUint32 GetChromeFlags();
 #endif
 
     nsRefPtr<nsCaretAccessible> mCaretAccessible;
 };
 
 } // namespace a11y
rename from accessible/src/mac/nsXULTreeGridAccessibleWrap.h
rename to accessible/src/mac/XULTreeGridAccessibleWrap.h
--- a/accessible/src/mac/nsXULTreeGridAccessibleWrap.h
+++ b/accessible/src/mac/XULTreeGridAccessibleWrap.h
@@ -1,14 +1,20 @@
 /* -*- 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/. */
 
-#ifndef __nsXULTreeGridAccessibleWrap_h__
-#define __nsXULTreeGridAccessibleWrap_h__
+#ifndef mozilla_a11y_XULTreeGridAccessibleWrap_h__
+#define mozilla_a11y_XULTreeGridAccessibleWrap_h__
+
+#include "XULTreeGridAccessible.h"
 
-#include "nsXULTreeGridAccessible.h"
+namespace mozilla {
+namespace a11y {
 
-typedef class nsXULTreeGridAccessible nsXULTreeGridAccessibleWrap;
-typedef class nsXULTreeGridCellAccessible nsXULTreeGridCellAccessibleWrap;
+typedef class XULTreeGridAccessible XULTreeGridAccessibleWrap;
+typedef class XULTreeGridCellAccessible XULTreeGridCellAccessibleWrap;
+
+} // namespace a11y
+} // namespace mozilla
 
 #endif
--- a/accessible/src/msaa/Makefile.in
+++ b/accessible/src/msaa/Makefile.in
@@ -22,17 +22,16 @@ CPPSRCS = \
   DocAccessibleWrap.cpp \
   HTMLTableAccessibleWrap.cpp \
   HyperTextAccessibleWrap.cpp \
   ImageAccessibleWrap.cpp \
   nsAccessNodeWrap.cpp \
   nsHTMLWin32ObjectAccessible.cpp \
   nsXULMenuAccessibleWrap.cpp \
   nsXULListboxAccessibleWrap.cpp \
-  nsXULTreeGridAccessibleWrap.cpp \
   nsWinUtils.cpp \
   CAccessibleText.cpp \
   CAccessibleEditableText.cpp \
   CAccessibleHyperlink.cpp \
   CAccessibleTable.cpp \
   CAccessibleTableCell.cpp \
   CAccessibleValue.cpp \
   Compatibility.cpp \
@@ -41,16 +40,22 @@ CPPSRCS = \
   ia2AccessibleComponent.cpp \
   ia2AccessibleImage.cpp \
   ia2AccessibleHypertext.cpp \
   ia2AccessibleRelation.cpp \
   RootAccessibleWrap.cpp \
   TextLeafAccessibleWrap.cpp \
   $(NULL)
 
+ifdef MOZ_XUL
+CPPSRCS += \
+  XULTreeGridAccessibleWrap.cpp \
+  $(NULL)
+endif
+
 EXPORTS = \
   nsAccessNodeWrap.h \
   $(NULL)
 
 # we don't want the shared lib, but we want to force the creation of a static lib.
 FORCE_STATIC_LIB = 1
 
 include $(topsrcdir)/config/config.mk
rename from accessible/src/msaa/nsXULTreeGridAccessibleWrap.cpp
rename to accessible/src/msaa/XULTreeGridAccessibleWrap.cpp
--- a/accessible/src/msaa/nsXULTreeGridAccessibleWrap.cpp
+++ b/accessible/src/msaa/XULTreeGridAccessibleWrap.cpp
@@ -1,47 +1,49 @@
 /* -*- 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 "nsXULTreeGridAccessibleWrap.h"
+#include "XULTreeGridAccessibleWrap.h"
+
+using namespace mozilla::a11y;
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsXULTreeGridAccessibleWrap
+// XULTreeGridAccessibleWrap
 ////////////////////////////////////////////////////////////////////////////////
 
-nsXULTreeGridAccessibleWrap::
-  nsXULTreeGridAccessibleWrap(nsIContent* aContent, DocAccessible* aDoc) :
-  nsXULTreeGridAccessible(aContent, aDoc)
+XULTreeGridAccessibleWrap::
+  XULTreeGridAccessibleWrap(nsIContent* aContent, DocAccessible* aDoc) :
+  XULTreeGridAccessible(aContent, aDoc)
 {
 }
 
-NS_IMPL_ISUPPORTS_INHERITED0(nsXULTreeGridAccessibleWrap,
-                             nsXULTreeGridAccessible)
+NS_IMPL_ISUPPORTS_INHERITED0(XULTreeGridAccessibleWrap,
+                             XULTreeGridAccessible)
 
-IMPL_IUNKNOWN_INHERITED1(nsXULTreeGridAccessibleWrap,
+IMPL_IUNKNOWN_INHERITED1(XULTreeGridAccessibleWrap,
                          AccessibleWrap,
                          CAccessibleTable)
 
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsXULTreeGridCellAccessibleWrap
+// XULTreeGridCellAccessibleWrap
 ////////////////////////////////////////////////////////////////////////////////
 
-nsXULTreeGridCellAccessibleWrap::
-  nsXULTreeGridCellAccessibleWrap(nsIContent* aContent,
-                                  DocAccessible* aDoc,
-                                  nsXULTreeGridRowAccessible* aRowAcc,
-                                  nsITreeBoxObject* aTree,
-                                  nsITreeView* aTreeView,
-                                  PRInt32 aRow, nsITreeColumn* aColumn) :
-  nsXULTreeGridCellAccessible(aContent, aDoc, aRowAcc, aTree, aTreeView,
-                              aRow, aColumn)
+XULTreeGridCellAccessibleWrap::
+  XULTreeGridCellAccessibleWrap(nsIContent* aContent,
+                                DocAccessible* aDoc,
+                                XULTreeGridRowAccessible* aRowAcc,
+                                nsITreeBoxObject* aTree,
+                                nsITreeView* aTreeView,
+                                PRInt32 aRow, nsITreeColumn* aColumn) :
+  XULTreeGridCellAccessible(aContent, aDoc, aRowAcc, aTree, aTreeView,
+                            aRow, aColumn)
 {
 }
 
-NS_IMPL_ISUPPORTS_INHERITED0(nsXULTreeGridCellAccessibleWrap,
-                             nsXULTreeGridCellAccessible)
+NS_IMPL_ISUPPORTS_INHERITED0(XULTreeGridCellAccessibleWrap,
+                             XULTreeGridCellAccessible)
 
-IMPL_IUNKNOWN_INHERITED1(nsXULTreeGridCellAccessibleWrap,
+IMPL_IUNKNOWN_INHERITED1(XULTreeGridCellAccessibleWrap,
                          AccessibleWrap,
                          CAccessibleTableCell)
rename from accessible/src/msaa/nsXULTreeGridAccessibleWrap.h
rename to accessible/src/msaa/XULTreeGridAccessibleWrap.h
--- a/accessible/src/msaa/nsXULTreeGridAccessibleWrap.h
+++ b/accessible/src/msaa/XULTreeGridAccessibleWrap.h
@@ -1,53 +1,59 @@
 /* -*- 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/. */
 
-#ifndef __nsXULTreeGridAccessibleWrap_h__
-#define __nsXULTreeGridAccessibleWrap_h__
+#ifndef mozilla_a11y_XULTreeGridAccessibleWrap_h__
+#define mozilla_a11y_XULTreeGridAccessibleWrap_h__
 
-#include "nsXULTreeGridAccessible.h"
+#include "XULTreeGridAccessible.h"
 
 #include "CAccessibleTable.h"
 #include "CAccessibleTableCell.h"
 
+namespace mozilla {
+namespace a11y {
+
 /**
- * IA2 wrapper class for nsXULTreeGridAccessible class implementing
+ * IA2 wrapper class for XULTreeGridAccessible class implementing
  * IAccessibleTable and IAccessibleTable2 interfaces.
  */
-class nsXULTreeGridAccessibleWrap : public nsXULTreeGridAccessible,
-                                    public CAccessibleTable
+class XULTreeGridAccessibleWrap : public XULTreeGridAccessible,
+                                  public CAccessibleTable
 {
 public:
-  nsXULTreeGridAccessibleWrap(nsIContent* aContent, DocAccessible* aDoc);
+  XULTreeGridAccessibleWrap(nsIContent* aContent, DocAccessible* aDoc);
 
   // IUnknown
   DECL_IUNKNOWN_INHERITED
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 };
 
 /**
- * IA2 wrapper class for nsXULTreeGridCellAccessible class, implements
+ * IA2 wrapper class for XULTreeGridCellAccessible class, implements
  * IAccessibleTableCell interface.
  */
-class nsXULTreeGridCellAccessibleWrap : public nsXULTreeGridCellAccessible,
-                                        public CAccessibleTableCell
+class XULTreeGridCellAccessibleWrap : public XULTreeGridCellAccessible,
+                                      public CAccessibleTableCell
 {
 public:
-  nsXULTreeGridCellAccessibleWrap(nsIContent* aContent,
-                                  DocAccessible* aDoc,
-                                  nsXULTreeGridRowAccessible* aRowAcc,
-                                  nsITreeBoxObject* aTree,
-                                  nsITreeView* aTreeView,
-                                  PRInt32 aRow, nsITreeColumn* aColumn);
+  XULTreeGridCellAccessibleWrap(nsIContent* aContent,
+                                DocAccessible* aDoc,
+                                XULTreeGridRowAccessible* aRowAcc,
+                                nsITreeBoxObject* aTree,
+                                nsITreeView* aTreeView,
+                                PRInt32 aRow, nsITreeColumn* aColumn);
 
   // IUnknown
   DECL_IUNKNOWN_INHERITED
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 };
 
+} // namespace a11y
+} // namespace mozilla
+
 #endif
rename from accessible/src/other/nsXULTreeGridAccessibleWrap.h
rename to accessible/src/other/XULTreeGridAccessibleWrap.h
--- a/accessible/src/other/nsXULTreeGridAccessibleWrap.h
+++ b/accessible/src/other/XULTreeGridAccessibleWrap.h
@@ -1,14 +1,20 @@
 /* -*- 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/. */
 
-#ifndef __nsXULTreeGridAccessibleWrap_h__
-#define __nsXULTreeGridAccessibleWrap_h__
+#ifndef mozilla_a11y_XULTreeGridAccessibleWrap_h__
+#define mozilla_a11y_XULTreeGridAccessibleWrap_h__
+
+#include "XULTreeGridAccessible.h"
 
-#include "nsXULTreeGridAccessible.h"
+namespace mozilla {
+namespace a11y {
 
-typedef class nsXULTreeGridAccessible nsXULTreeGridAccessibleWrap;
-typedef class nsXULTreeGridCellAccessible nsXULTreeGridCellAccessibleWrap;
+typedef class XULTreeGridAccessible XULTreeGridAccessibleWrap;
+typedef class XULTreeGridCellAccessible XULTreeGridCellAccessibleWrap;
+
+} // namespace a11y
+} // namespace mozilla
 
 #endif
--- a/accessible/src/xul/Makefile.in
+++ b/accessible/src/xul/Makefile.in
@@ -22,18 +22,18 @@ CPPSRCS = \
   nsXULColorPickerAccessible.cpp \
   nsXULComboboxAccessible.cpp \
   XULFormControlAccessible.cpp \
   nsXULListboxAccessible.cpp \
   nsXULMenuAccessible.cpp \
   nsXULSliderAccessible.cpp \
   nsXULTabAccessible.cpp \
   nsXULTextAccessible.cpp \
-  nsXULTreeAccessible.cpp \
-  nsXULTreeGridAccessible.cpp \
+  XULTreeAccessible.cpp \
+  XULTreeGridAccessible.cpp \
   $(NULL)
 
 # we don't want the shared lib, but we want to force the creation of a static lib.
 FORCE_STATIC_LIB = 1
 
 include $(topsrcdir)/config/rules.mk
 
 LOCAL_INCLUDES = \
rename from accessible/src/xul/nsXULTreeAccessible.cpp
rename to accessible/src/xul/XULTreeAccessible.cpp
--- a/accessible/src/xul/nsXULTreeAccessible.cpp
+++ b/accessible/src/xul/XULTreeAccessible.cpp
@@ -1,15 +1,15 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=2 et sw=2 tw=80: */
 /* 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 "nsXULTreeAccessible.h"
+#include "XULTreeAccessible.h"
 
 #include "nsAccCache.h"
 #include "nsAccUtils.h"
 #include "nsCoreUtils.h"
 #include "DocAccessible.h"
 #include "Relation.h"
 #include "Role.h"
 #include "States.h"
@@ -23,21 +23,21 @@
 #include "nsIDOMXULMultSelectCntrlEl.h"
 #include "nsIDOMXULTreeElement.h"
 #include "nsITreeSelection.h"
 #include "nsIMutableArray.h"
 
 using namespace mozilla::a11y;
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsXULTreeAccessible
+// XULTreeAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
-nsXULTreeAccessible::
-  nsXULTreeAccessible(nsIContent* aContent, DocAccessible* aDoc) :
+XULTreeAccessible::
+  XULTreeAccessible(nsIContent* aContent, DocAccessible* aDoc) :
   AccessibleWrap(aContent, aDoc)
 {
   mFlags |= eXULTreeAccessible;
 
   mTree = nsCoreUtils::GetTreeBoxObject(aContent);
   NS_ASSERTION(mTree, "Can't get mTree!\n");
 
   if (mTree) {
@@ -53,43 +53,42 @@ nsXULTreeAccessible::
     if (autoCompletePopupElm)
       mFlags |= eAutoCompletePopupAccessible;
   }
 
   mAccessibleCache.Init(kDefaultTreeCacheSize);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsXULTreeAccessible: nsISupports and cycle collection implementation
+// XULTreeAccessible: nsISupports and cycle collection implementation
 
-NS_IMPL_CYCLE_COLLECTION_CLASS(nsXULTreeAccessible)
+NS_IMPL_CYCLE_COLLECTION_CLASS(XULTreeAccessible)
 
-NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsXULTreeAccessible,
+NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(XULTreeAccessible,
                                                   Accessible)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mTree)
   CycleCollectorTraverseCache(tmp->mAccessibleCache, &cb);
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
-NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(nsXULTreeAccessible,
-                                                Accessible)
+NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(XULTreeAccessible, Accessible)
   NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mTree)
   ClearCache(tmp->mAccessibleCache);
 NS_IMPL_CYCLE_COLLECTION_UNLINK_END
 
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(nsXULTreeAccessible)
+NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(XULTreeAccessible)
 NS_INTERFACE_MAP_END_INHERITING(Accessible)
 
-NS_IMPL_ADDREF_INHERITED(nsXULTreeAccessible, Accessible)
-NS_IMPL_RELEASE_INHERITED(nsXULTreeAccessible, Accessible)
+NS_IMPL_ADDREF_INHERITED(XULTreeAccessible, Accessible)
+NS_IMPL_RELEASE_INHERITED(XULTreeAccessible, Accessible)
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsXULTreeAccessible: Accessible implementation
+// XULTreeAccessible: Accessible implementation
 
 PRUint64
-nsXULTreeAccessible::NativeState()
+XULTreeAccessible::NativeState()
 {
   // Get focus status from base class.
   PRUint64 state = Accessible::NativeState();
 
   // readonly state
   state |= states::READONLY;
 
   // multiselectable state.
@@ -106,17 +105,17 @@ nsXULTreeAccessible::NativeState()
 
   if (!isSingle)
     state |= states::MULTISELECTABLE;
 
   return state;
 }
 
 void
-nsXULTreeAccessible::Value(nsString& aValue)
+XULTreeAccessible::Value(nsString& aValue)
 {
   aValue.Truncate();
   if (!mTreeView)
     return;
 
   // Return the value is the first selected child.
   nsCOMPtr<nsITreeSelection> selection;
   mTreeView->GetSelection(getter_AddRefs(selection));
@@ -135,57 +134,57 @@ nsXULTreeAccessible::Value(nsString& aVa
       cols->GetKeyColumn(getter_AddRefs(keyCol));
 
     mTreeView->GetCellText(currentIndex, keyCol, aValue);
   }
 
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsXULTreeAccessible: nsAccessNode implementation
+// XULTreeAccessible: nsAccessNode implementation
 
 void
-nsXULTreeAccessible::Shutdown()
+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 = nsnull;
   mTreeView = nsnull;
 
   AccessibleWrap::Shutdown();
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsXULTreeAccessible: Accessible implementation (put methods here)
+// XULTreeAccessible: Accessible implementation (put methods here)
 
 role
-nsXULTreeAccessible::NativeRole()
+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.
 
   nsCOMPtr<nsITreeColumns> cols;
   mTree->GetColumns(getter_AddRefs(cols));
   nsCOMPtr<nsITreeColumn> primaryCol;
   if (cols)
     cols->GetPrimaryColumn(getter_AddRefs(primaryCol));
 
   return primaryCol ? roles::OUTLINE : roles::LIST;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsXULTreeAccessible: Accessible implementation (DON'T put methods here)
+// XULTreeAccessible: Accessible implementation (DON'T put methods here)
 
 Accessible*
-nsXULTreeAccessible::ChildAtPoint(PRInt32 aX, PRInt32 aY,
-                                  EWhichChildAtPoint aWhichChild)
+XULTreeAccessible::ChildAtPoint(PRInt32 aX, PRInt32 aY,
+                                EWhichChildAtPoint aWhichChild)
 {
   nsIFrame *frame = GetFrame();
   if (!frame)
     return nsnull;
 
   nsPresContext *presContext = frame->PresContext();
   nsIPresShell* presShell = presContext->PresShell();
 
@@ -206,37 +205,37 @@ nsXULTreeAccessible::ChildAtPoint(PRInt3
   // If we failed to find tree cell for the given point then it might be
   // tree columns.
   if (row == -1 || !column)
     return AccessibleWrap::ChildAtPoint(aX, aY, aWhichChild);
 
   Accessible* child = GetTreeItemAccessible(row);
   if (aWhichChild == eDeepestChild && child) {
     // Look for accessible cell for the found item accessible.
-    nsRefPtr<nsXULTreeItemAccessibleBase> treeitem = do_QueryObject(child);
+    nsRefPtr<XULTreeItemAccessibleBase> treeitem = do_QueryObject(child);
 
     Accessible* cell = treeitem->GetCellAccessible(column);
     if (cell)
       child = cell;
   }
 
   return child;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsXULTreeAccessible: SelectAccessible
+// XULTreeAccessible: SelectAccessible
 
 bool
-nsXULTreeAccessible::IsSelect()
+XULTreeAccessible::IsSelect()
 {
   return true;
 }
 
 Accessible*
-nsXULTreeAccessible::CurrentItem()
+XULTreeAccessible::CurrentItem()
 {
   if (!mTreeView)
     return nsnull;
 
   nsCOMPtr<nsITreeSelection> selection;
   mTreeView->GetSelection(getter_AddRefs(selection));
   if (selection) {
     PRInt32 currentIndex = -1;
@@ -244,23 +243,23 @@ nsXULTreeAccessible::CurrentItem()
     if (currentIndex >= 0)
       return GetTreeItemAccessible(currentIndex);
   }
 
   return nsnull;
 }
 
 void
-nsXULTreeAccessible::SetCurrentItem(Accessible* aItem)
+XULTreeAccessible::SetCurrentItem(Accessible* aItem)
 {
-  NS_ERROR("nsXULTreeAccessible::SetCurrentItem not implemented");
+  NS_ERROR("XULTreeAccessible::SetCurrentItem not implemented");
 }
 
 already_AddRefed<nsIArray>
-nsXULTreeAccessible::SelectedItems()
+XULTreeAccessible::SelectedItems()
 {
   if (!mTreeView)
     return nsnull;
 
   nsCOMPtr<nsITreeSelection> selection;
   mTreeView->GetSelection(getter_AddRefs(selection));
   if (!selection)
     return nsnull;
@@ -283,34 +282,34 @@ nsXULTreeAccessible::SelectedItems()
   }
 
   nsIMutableArray* items = nsnull;
   selectedItems.forget(&items);
   return items;
 }
 
 PRUint32
-nsXULTreeAccessible::SelectedItemCount()
+XULTreeAccessible::SelectedItemCount()
 {
   if (!mTreeView)
     return 0;
 
   nsCOMPtr<nsITreeSelection> selection;
   mTreeView->GetSelection(getter_AddRefs(selection));
   if (selection) {
     PRInt32 count = 0;
     selection->GetCount(&count);
     return count;
   }
 
   return 0;
 }
 
 bool
-nsXULTreeAccessible::AddItemToSelection(PRUint32 aIndex)
+XULTreeAccessible::AddItemToSelection(PRUint32 aIndex)
 {
   if (!mTreeView)
     return false;
 
   nsCOMPtr<nsITreeSelection> selection;
   mTreeView->GetSelection(getter_AddRefs(selection));
   if (selection) {
     bool isSelected = false;
@@ -319,17 +318,17 @@ nsXULTreeAccessible::AddItemToSelection(
       selection->ToggleSelect(aIndex);
 
     return true;
   }
   return false;
 }
 
 bool
-nsXULTreeAccessible::RemoveItemFromSelection(PRUint32 aIndex)
+XULTreeAccessible::RemoveItemFromSelection(PRUint32 aIndex)
 {
   if (!mTreeView)
     return false;
 
   nsCOMPtr<nsITreeSelection> selection;
   mTreeView->GetSelection(getter_AddRefs(selection));
   if (selection) {
     bool isSelected = false;
@@ -338,48 +337,48 @@ nsXULTreeAccessible::RemoveItemFromSelec
       selection->ToggleSelect(aIndex);
 
     return true;
   }
   return false;
 }
 
 bool
-nsXULTreeAccessible::IsItemSelected(PRUint32 aIndex)
+XULTreeAccessible::IsItemSelected(PRUint32 aIndex)
 {
   if (!mTreeView)
     return false;
 
   nsCOMPtr<nsITreeSelection> selection;
   mTreeView->GetSelection(getter_AddRefs(selection));
   if (selection) {
     bool isSelected = false;
     selection->IsSelected(aIndex, &isSelected);
     return isSelected;
   }
   return false;
 }
 
 bool
-nsXULTreeAccessible::UnselectAll()
+XULTreeAccessible::UnselectAll()
 {
   if (!mTreeView)
     return false;
 
   nsCOMPtr<nsITreeSelection> selection;
   mTreeView->GetSelection(getter_AddRefs(selection));
   if (!selection)
     return false;
 
   selection->ClearSelection();
   return true;
 }
 
 Accessible*
-nsXULTreeAccessible::GetSelectedItem(PRUint32 aIndex)
+XULTreeAccessible::GetSelectedItem(PRUint32 aIndex)
 {
   if (!mTreeView)
     return nsnull;
 
   nsCOMPtr<nsITreeSelection> selection;
   mTreeView->GetSelection(getter_AddRefs(selection));
   if (!selection)
     return nsnull;
@@ -397,17 +396,17 @@ nsXULTreeAccessible::GetSelectedItem(PRU
       selCount++;
     }
   }
 
   return nsnull;
 }
 
 bool
-nsXULTreeAccessible::SelectAll()
+XULTreeAccessible::SelectAll()
 {
   // see if we are multiple select if so set ourselves as such
   if (!mTreeView)
     return false;
 
   nsCOMPtr<nsITreeSelection> selection;
   mTreeView->GetSelection(getter_AddRefs(selection));
   if (selection) {
@@ -418,86 +417,86 @@ nsXULTreeAccessible::SelectAll()
       return true;
     }
   }
 
   return false;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsXULTreeAccessible: Accessible implementation
+// XULTreeAccessible: Accessible implementation
 
 Accessible*
-nsXULTreeAccessible::GetChildAt(PRUint32 aIndex)
+XULTreeAccessible::GetChildAt(PRUint32 aIndex)
 {
   PRUint32 childCount = Accessible::ChildCount();
   if (aIndex < childCount)
     return Accessible::GetChildAt(aIndex);
 
   return GetTreeItemAccessible(aIndex - childCount);
 }
 
 PRUint32
-nsXULTreeAccessible::ChildCount() const
+XULTreeAccessible::ChildCount() const
 {
   // Tree's children count is row count + treecols count.
   PRUint32 childCount = Accessible::ChildCount();
   if (!mTreeView)
     return childCount;
 
   PRInt32 rowCount = 0;
   mTreeView->GetRowCount(&rowCount);
   childCount += rowCount;
 
   return childCount;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsXULTreeAccessible: Widgets
+// XULTreeAccessible: Widgets
 
 bool
-nsXULTreeAccessible::IsWidget() const
+XULTreeAccessible::IsWidget() const
 {
   return true;
 }
 
 bool
-nsXULTreeAccessible::IsActiveWidget() const
+XULTreeAccessible::IsActiveWidget() const
 {
   if (IsAutoCompletePopup()) {
     nsCOMPtr<nsIAutoCompletePopup> autoCompletePopupElm =
       do_QueryInterface(mContent->GetParent());
 
     if (autoCompletePopupElm) {
       bool isOpen = false;
       autoCompletePopupElm->GetPopupOpen(&isOpen);
       return isOpen;
     }
   }
   return FocusMgr()->HasDOMFocus(mContent);
 }
 
 bool
-nsXULTreeAccessible::AreItemsOperable() const
+XULTreeAccessible::AreItemsOperable() const
 {
   if (IsAutoCompletePopup()) {
     nsCOMPtr<nsIAutoCompletePopup> autoCompletePopupElm =
       do_QueryInterface(mContent->GetParent());
 
     if (autoCompletePopupElm) {
       bool isOpen = false;
       autoCompletePopupElm->GetPopupOpen(&isOpen);
       return isOpen;
     }
   }
   return true;
 }
 
 Accessible*
-nsXULTreeAccessible::ContainerWidget() const
+XULTreeAccessible::ContainerWidget() const
 {
   if (IsAutoCompletePopup()) {
     // This works for XUL autocompletes. It doesn't work for HTML forms
     // autocomplete because of potential crossprocess calls (when autocomplete
     // lives in content process while popup lives in chrome process). If that's
     // a problem then rethink Widgets interface.
     nsCOMPtr<nsIDOMXULMenuListElement> menuListElm =
       do_QueryInterface(mContent->GetParent());
@@ -513,20 +512,20 @@ nsXULTreeAccessible::ContainerWidget() c
         }
       }
     }
   }
   return nsnull;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsXULTreeAccessible: public implementation
+// XULTreeAccessible: public implementation
 
 Accessible*
-nsXULTreeAccessible::GetTreeItemAccessible(PRInt32 aRow)
+XULTreeAccessible::GetTreeItemAccessible(PRInt32 aRow)
 {
   if (aRow < 0 || IsDefunct() || !mTreeView)
     return nsnull;
 
   PRInt32 rowCount = 0;
   nsresult rv = mTreeView->GetRowCount(&rowCount);
   if (NS_FAILED(rv) || aRow >= rowCount)
     return nsnull;
@@ -544,17 +543,17 @@ nsXULTreeAccessible::GetTreeItemAccessib
 
     mAccessibleCache.Remove(key);
   }
 
   return nsnull;
 }
 
 void
-nsXULTreeAccessible::InvalidateCache(PRInt32 aRow, PRInt32 aCount)
+XULTreeAccessible::InvalidateCache(PRInt32 aRow, PRInt32 aCount)
 {
   if (IsDefunct())
     return;
 
   // Do not invalidate the cache if rows have been inserted.
   if (aCount > 0)
     return;
 
@@ -596,18 +595,18 @@ nsXULTreeAccessible::InvalidateCache(PRI
       // Unbind from document, shutdown and remove from tree cache.
       document->UnbindFromDocument(treeItem);
       mAccessibleCache.Remove(key);
     }
   }
 }
 
 void
-nsXULTreeAccessible::TreeViewInvalidated(PRInt32 aStartRow, PRInt32 aEndRow,
-                                         PRInt32 aStartCol, PRInt32 aEndCol)
+XULTreeAccessible::TreeViewInvalidated(PRInt32 aStartRow, PRInt32 aEndRow,
+                                       PRInt32 aStartCol, PRInt32 aEndCol)
 {
   if (IsDefunct())
     return;
 
   PRInt32 endRow = aEndRow;
 
   nsresult rv;
   if (endRow == -1) {
@@ -636,26 +635,26 @@ nsXULTreeAccessible::TreeViewInvalidated
   }
 
   for (PRInt32 rowIdx = aStartRow; rowIdx <= endRow; ++rowIdx) {
 
     void *key = reinterpret_cast<void*>(rowIdx);
     Accessible* accessible = mAccessibleCache.GetWeak(key);
 
     if (accessible) {
-      nsRefPtr<nsXULTreeItemAccessibleBase> treeitemAcc = do_QueryObject(accessible);
+      nsRefPtr<XULTreeItemAccessibleBase> treeitemAcc = do_QueryObject(accessible);
       NS_ASSERTION(treeitemAcc, "Wrong accessible at the given key!");
 
       treeitemAcc->RowInvalidated(aStartCol, endCol);
     }
   }
 }
 
 void
-nsXULTreeAccessible::TreeViewChanged(nsITreeView* aView)
+XULTreeAccessible::TreeViewChanged(nsITreeView* aView)
 {
   if (IsDefunct())
     return;
 
   // Fire reorder event on tree accessible on accessible tree (do not fire
   // show/hide events on tree items because it can be expensive to fire them for
   // each tree item.
   nsRefPtr<AccEvent> reorderEvent =
@@ -665,76 +664,75 @@ nsXULTreeAccessible::TreeViewChanged(nsI
     Document()->FireDelayedAccessibleEvent(reorderEvent);
 
   // Clear cache.
   ClearCache(mAccessibleCache);
   mTreeView = aView;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsXULTreeAccessible: protected implementation
+// XULTreeAccessible: protected implementation
 
 already_AddRefed<Accessible>
-nsXULTreeAccessible::CreateTreeItemAccessible(PRInt32 aRow)
+XULTreeAccessible::CreateTreeItemAccessible(PRInt32 aRow)
 {
   nsRefPtr<Accessible> accessible =
-    new nsXULTreeItemAccessible(mContent, mDoc, this, mTree, mTreeView,
-                                aRow);
+    new XULTreeItemAccessible(mContent, mDoc, this, mTree, mTreeView, aRow);
 
   return accessible.forget();
 }
                              
 ////////////////////////////////////////////////////////////////////////////////
-// nsXULTreeItemAccessibleBase
+// XULTreeItemAccessibleBase
 ////////////////////////////////////////////////////////////////////////////////
 
-nsXULTreeItemAccessibleBase::
-  nsXULTreeItemAccessibleBase(nsIContent* aContent, DocAccessible* aDoc,
-                              Accessible* aParent, nsITreeBoxObject* aTree,
-                              nsITreeView* aTreeView, PRInt32 aRow) :
+XULTreeItemAccessibleBase::
+  XULTreeItemAccessibleBase(nsIContent* aContent, DocAccessible* aDoc,
+                            Accessible* aParent, nsITreeBoxObject* aTree,
+                            nsITreeView* aTreeView, PRInt32 aRow) :
   AccessibleWrap(aContent, aDoc),
   mTree(aTree), mTreeView(aTreeView), mRow(aRow)
 {
   mParent = aParent;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsXULTreeItemAccessibleBase: nsISupports implementation
+// XULTreeItemAccessibleBase: nsISupports implementation
 
-NS_IMPL_CYCLE_COLLECTION_CLASS(nsXULTreeItemAccessibleBase)
+NS_IMPL_CYCLE_COLLECTION_CLASS(XULTreeItemAccessibleBase)
 
-NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsXULTreeItemAccessibleBase,
+NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(XULTreeItemAccessibleBase,
                                                   Accessible)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mTree)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
-NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(nsXULTreeItemAccessibleBase,
+NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(XULTreeItemAccessibleBase,
                                                 Accessible)
   NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mTree)
 NS_IMPL_CYCLE_COLLECTION_UNLINK_END
 
-NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(nsXULTreeItemAccessibleBase)
-  NS_INTERFACE_TABLE_INHERITED1(nsXULTreeItemAccessibleBase,
-                                nsXULTreeItemAccessibleBase)
+NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(XULTreeItemAccessibleBase)
+  NS_INTERFACE_TABLE_INHERITED1(XULTreeItemAccessibleBase,
+                                XULTreeItemAccessibleBase)
 NS_INTERFACE_TABLE_TAIL_INHERITING(Accessible)
-NS_IMPL_ADDREF_INHERITED(nsXULTreeItemAccessibleBase, Accessible)
-NS_IMPL_RELEASE_INHERITED(nsXULTreeItemAccessibleBase, Accessible)
+NS_IMPL_ADDREF_INHERITED(XULTreeItemAccessibleBase, Accessible)
+NS_IMPL_RELEASE_INHERITED(XULTreeItemAccessibleBase, Accessible)
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsXULTreeItemAccessibleBase: nsIAccessible implementation
+// XULTreeItemAccessibleBase: nsIAccessible implementation
 
 Accessible*
-nsXULTreeItemAccessibleBase::FocusedChild()
+XULTreeItemAccessibleBase::FocusedChild()
 {
   return FocusMgr()->FocusedAccessible() == this ? this : nsnull;
 }
 
 NS_IMETHODIMP
-nsXULTreeItemAccessibleBase::GetBounds(PRInt32 *aX, PRInt32 *aY,
-                                       PRInt32 *aWidth, PRInt32 *aHeight)
+XULTreeItemAccessibleBase::GetBounds(PRInt32* aX, PRInt32* aY,
+                                     PRInt32* aWidth, PRInt32* aHeight)
 {
   NS_ENSURE_ARG_POINTER(aX);
   *aX = 0;
   NS_ENSURE_ARG_POINTER(aY);
   *aY = 0;
   NS_ENSURE_ARG_POINTER(aWidth);
   *aWidth = 0;
   NS_ENSURE_ARG_POINTER(aHeight);
@@ -770,17 +768,17 @@ nsXULTreeItemAccessibleBase::GetBounds(P
   *aY = presContext->CSSPixelsToDevPixels(y);
   *aWidth = presContext->CSSPixelsToDevPixels(width);
   *aHeight = presContext->CSSPixelsToDevPixels(height);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsXULTreeItemAccessibleBase::SetSelected(bool aSelect)
+XULTreeItemAccessibleBase::SetSelected(bool aSelect)
 {
   if (IsDefunct() || !mTreeView)
     return NS_ERROR_FAILURE;
 
   nsCOMPtr<nsITreeSelection> selection;
   mTreeView->GetSelection(getter_AddRefs(selection));
   if (selection) {
     bool isSelected;
@@ -788,60 +786,60 @@ nsXULTreeItemAccessibleBase::SetSelected
     if (isSelected != aSelect)
       selection->ToggleSelect(mRow);
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsXULTreeItemAccessibleBase::TakeFocus()
+XULTreeItemAccessibleBase::TakeFocus()
 {
   if (IsDefunct() || !mTreeView)
     return NS_ERROR_FAILURE;
 
   nsCOMPtr<nsITreeSelection> selection;
   mTreeView->GetSelection(getter_AddRefs(selection));
   if (selection)
     selection->SetCurrentIndex(mRow);
 
   // focus event will be fired here
   return Accessible::TakeFocus();
 }
 
 Relation
-nsXULTreeItemAccessibleBase::RelationByType(PRUint32 aType)
+XULTreeItemAccessibleBase::RelationByType(PRUint32 aType)
 {
   if (!mTreeView)
     return Relation();
 
   if (aType != nsIAccessibleRelation::RELATION_NODE_CHILD_OF)
     return Relation();
 
   PRInt32 parentIndex = -1;
   if (!NS_SUCCEEDED(mTreeView->GetParentIndex(mRow, &parentIndex)))
     return Relation();
 
   if (parentIndex == -1)
     return Relation(mParent);
 
-  nsXULTreeAccessible* treeAcc = mParent->AsXULTree();
+  XULTreeAccessible* treeAcc = mParent->AsXULTree();
   return Relation(treeAcc->GetTreeItemAccessible(parentIndex));
 }
 
 PRUint8
-nsXULTreeItemAccessibleBase::ActionCount()
+XULTreeItemAccessibleBase::ActionCount()
 {
   // "activate" action is available for all treeitems, "expand/collapse" action
   // is avaible for treeitem which is container.
   return IsExpandable() ? 2 : 1;
 }
 
 NS_IMETHODIMP
-nsXULTreeItemAccessibleBase::GetActionName(PRUint8 aIndex, nsAString& aName)
+XULTreeItemAccessibleBase::GetActionName(PRUint8 aIndex, nsAString& aName)
 {
   if (IsDefunct())
     return NS_ERROR_FAILURE;
 
   if (aIndex == eAction_Click) {
     aName.AssignLiteral("activate");
     return NS_OK;
   }
@@ -856,54 +854,54 @@ nsXULTreeItemAccessibleBase::GetActionNa
 
     return NS_OK;
   }
 
   return NS_ERROR_INVALID_ARG;
 }
 
 NS_IMETHODIMP
-nsXULTreeItemAccessibleBase::DoAction(PRUint8 aIndex)
+XULTreeItemAccessibleBase::DoAction(PRUint8 aIndex)
 {
   if (IsDefunct())
     return NS_ERROR_FAILURE;
 
   if (aIndex != eAction_Click &&
       (aIndex != eAction_Expand || !IsExpandable()))
     return NS_ERROR_INVALID_ARG;
 
   DoCommand(nsnull, aIndex);
   return NS_OK;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsXULTreeItemAccessibleBase: nsAccessNode implementation
+// XULTreeItemAccessibleBase: nsAccessNode implementation
 
 void
-nsXULTreeItemAccessibleBase::Shutdown()
+XULTreeItemAccessibleBase::Shutdown()
 {
   mTree = nsnull;
   mTreeView = nsnull;
   mRow = -1;
 
   AccessibleWrap::Shutdown();
 }
 
 bool
-nsXULTreeItemAccessibleBase::IsPrimaryForNode() const
+XULTreeItemAccessibleBase::IsPrimaryForNode() const
 {
   return false;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsXULTreeItemAccessibleBase: Accessible public methods
+// XULTreeItemAccessibleBase: Accessible public methods
 
 // nsIAccessible::groupPosition
 GroupPos
-nsXULTreeItemAccessibleBase::GroupPosition()
+XULTreeItemAccessibleBase::GroupPosition()
 {
   GroupPos groupPos;
 
   PRInt32 level;
   nsresult rv = mTreeView->GetLevel(mRow, &level);
   NS_ENSURE_SUCCESS(rv, groupPos);
 
   PRInt32 topCount = 1;
@@ -937,17 +935,17 @@ nsXULTreeItemAccessibleBase::GroupPositi
   groupPos.level = level + 1;
   groupPos.setSize = topCount + bottomCount;
   groupPos.posInSet = topCount;
 
   return groupPos;
 }
 
 PRUint64
-nsXULTreeItemAccessibleBase::NativeState()
+XULTreeItemAccessibleBase::NativeState()
 {
   if (!mTreeView)
     return states::DEFUNCT;
 
   // focusable and selectable states
   PRUint64 state = NativeInteractiveState();
 
   // expanded/collapsed state
@@ -977,42 +975,42 @@ nsXULTreeItemAccessibleBase::NativeState
   mTree->GetLastVisibleRow(&lastVisibleRow);
   if (mRow < firstVisibleRow || mRow > lastVisibleRow)
     state |= states::INVISIBLE;
 
   return state;
 }
 
 PRUint64
-nsXULTreeItemAccessibleBase::NativeInteractiveState() const
+XULTreeItemAccessibleBase::NativeInteractiveState() const
 {
   return states::FOCUSABLE | states::SELECTABLE;
 }
 
 PRInt32
-nsXULTreeItemAccessibleBase::IndexInParent() const
+XULTreeItemAccessibleBase::IndexInParent() const
 {
   return mParent ? mParent->ContentChildCount() + mRow : -1;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsXULTreeItemAccessibleBase: Widgets
+// XULTreeItemAccessibleBase: Widgets
 
 Accessible*
-nsXULTreeItemAccessibleBase::ContainerWidget() const
+XULTreeItemAccessibleBase::ContainerWidget() const
 {
   return mParent;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsXULTreeItemAccessibleBase: Accessible protected methods
+// XULTreeItemAccessibleBase: Accessible protected methods
 
 void
-nsXULTreeItemAccessibleBase::DispatchClickEvent(nsIContent *aContent,
-                                                PRUint32 aActionIndex)
+XULTreeItemAccessibleBase::DispatchClickEvent(nsIContent* aContent,
+                                              PRUint32 aActionIndex)
 {
   if (IsDefunct())
     return;
 
   nsCOMPtr<nsITreeColumns> columns;
   mTree->GetColumns(getter_AddRefs(columns));
   if (!columns)
     return;
@@ -1030,30 +1028,30 @@ nsXULTreeItemAccessibleBase::DispatchCli
     pseudoElm = NS_LITERAL_CSTRING("twisty");
   }
 
   if (column)
     nsCoreUtils::DispatchClickEvent(mTree, mRow, column, pseudoElm);
 }
 
 Accessible*
-nsXULTreeItemAccessibleBase::GetSiblingAtOffset(PRInt32 aOffset,
-                                                nsresult* aError) const
+XULTreeItemAccessibleBase::GetSiblingAtOffset(PRInt32 aOffset,
+                                              nsresult* aError) const
 {
   if (aError)
     *aError = NS_OK; // fail peacefully
 
   return mParent->GetChildAt(IndexInParent() + aOffset);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsXULTreeItemAccessibleBase: protected implementation
+// XULTreeItemAccessibleBase: protected implementation
 
 bool
-nsXULTreeItemAccessibleBase::IsExpandable()
+XULTreeItemAccessibleBase::IsExpandable()
 {
   if (!mTreeView)
     return false;
 
   bool isContainer = false;
   mTreeView->IsContainer(mRow, &isContainer);
   if (isContainer) {
     bool isEmpty = false;
@@ -1070,18 +1068,17 @@ nsXULTreeItemAccessibleBase::IsExpandabl
       }
     }
   }
 
   return false;
 }
 
 void
-nsXULTreeItemAccessibleBase::GetCellName(nsITreeColumn* aColumn,
-                                         nsAString& aName)
+XULTreeItemAccessibleBase::GetCellName(nsITreeColumn* aColumn, nsAString& aName)
 {
   if (!mTreeView)
     return;
 
   mTreeView->GetCellText(mRow, aColumn, aName);
 
   // If there is still no name try the cell value:
   // This is for graphical cells. We need tree/table view implementors to
@@ -1090,153 +1087,152 @@ nsXULTreeItemAccessibleBase::GetCellName
   // in which case GetCellValue for that cell would return "starred" or
   // "flagged" for example.
   if (aName.IsEmpty())
     mTreeView->GetCellValue(mRow, aColumn, aName);
 }
 
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsXULTreeItemAccessible
+// XULTreeItemAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
-nsXULTreeItemAccessible::
-  nsXULTreeItemAccessible(nsIContent* aContent, DocAccessible* aDoc,
-                          Accessible* aParent, nsITreeBoxObject* aTree,
-                          nsITreeView* aTreeView, PRInt32 aRow) :
-  nsXULTreeItemAccessibleBase(aContent, aDoc, aParent, aTree, aTreeView, aRow)
+XULTreeItemAccessible::
+  XULTreeItemAccessible(nsIContent* aContent, DocAccessible* aDoc,
+                        Accessible* aParent, nsITreeBoxObject* aTree,
+                        nsITreeView* aTreeView, PRInt32 aRow) :
+  XULTreeItemAccessibleBase(aContent, aDoc, aParent, aTree, aTreeView, aRow)
 {
   mColumn = nsCoreUtils::GetFirstSensibleColumn(mTree);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsXULTreeItemAccessible: nsISupports implementation
+// XULTreeItemAccessible: nsISupports implementation
 
-NS_IMPL_CYCLE_COLLECTION_CLASS(nsXULTreeItemAccessible)
+NS_IMPL_CYCLE_COLLECTION_CLASS(XULTreeItemAccessible)
 
-NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsXULTreeItemAccessible,
-                                                  nsXULTreeItemAccessibleBase)
+NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(XULTreeItemAccessible,
+                                                  XULTreeItemAccessibleBase)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mColumn)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
-NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(nsXULTreeItemAccessible,
-                                                nsXULTreeItemAccessibleBase)
+NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(XULTreeItemAccessible,
+                                                XULTreeItemAccessibleBase)
   NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mColumn)
 NS_IMPL_CYCLE_COLLECTION_UNLINK_END
 
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(nsXULTreeItemAccessible)
-NS_INTERFACE_MAP_END_INHERITING(nsXULTreeItemAccessibleBase)
-NS_IMPL_ADDREF_INHERITED(nsXULTreeItemAccessible, nsXULTreeItemAccessibleBase)
-NS_IMPL_RELEASE_INHERITED(nsXULTreeItemAccessible, nsXULTreeItemAccessibleBase)
+NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(XULTreeItemAccessible)
+NS_INTERFACE_MAP_END_INHERITING(XULTreeItemAccessibleBase)
+NS_IMPL_ADDREF_INHERITED(XULTreeItemAccessible, XULTreeItemAccessibleBase)
+NS_IMPL_RELEASE_INHERITED(XULTreeItemAccessible, XULTreeItemAccessibleBase)
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsXULTreeItemAccessible: nsIAccessible implementation
+// XULTreeItemAccessible: nsIAccessible implementation
 
 ENameValueFlag
-nsXULTreeItemAccessible::Name(nsString& aName)
+XULTreeItemAccessible::Name(nsString& aName)
 {
   aName.Truncate();
 
   GetCellName(mColumn, aName);
   return eNameOK;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsXULTreeItemAccessible: nsAccessNode implementation
+// XULTreeItemAccessible: nsAccessNode implementation
 
 bool
-nsXULTreeItemAccessible::Init()
+XULTreeItemAccessible::Init()
 {
-  if (!nsXULTreeItemAccessibleBase::Init())
+  if (!XULTreeItemAccessibleBase::Init())
     return false;
 
   Name(mCachedName);
   return true;
 }
 
 void
-nsXULTreeItemAccessible::Shutdown()
+XULTreeItemAccessible::Shutdown()
 {
   mColumn = nsnull;
-  nsXULTreeItemAccessibleBase::Shutdown();
+  XULTreeItemAccessibleBase::Shutdown();
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsXULTreeItemAccessible: Accessible implementation
+// XULTreeItemAccessible: Accessible implementation
 
 role
-nsXULTreeItemAccessible::NativeRole()
+XULTreeItemAccessible::NativeRole()
 {
   nsCOMPtr<nsITreeColumns> columns;
   mTree->GetColumns(getter_AddRefs(columns));
   if (!columns) {
     NS_ERROR("No tree columns object in the tree!");
     return roles::NOTHING;
   }
 
   nsCOMPtr<nsITreeColumn> primaryColumn;
   columns->GetPrimaryColumn(getter_AddRefs(primaryColumn));
 
   return primaryColumn ? roles::OUTLINEITEM : roles::LISTITEM;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsXULTreeItemAccessible: nsXULTreeItemAccessibleBase implementation
+// XULTreeItemAccessible: XULTreeItemAccessibleBase implementation
 
 void
-nsXULTreeItemAccessible::RowInvalidated(PRInt32 aStartColIdx,
-                                        PRInt32 aEndColIdx)
+XULTreeItemAccessible::RowInvalidated(PRInt32 aStartColIdx, PRInt32 aEndColIdx)
 {
   nsAutoString name;
   Name(name);
 
   if (name != mCachedName) {
     nsEventShell::FireEvent(nsIAccessibleEvent::EVENT_NAME_CHANGE, this);
     mCachedName = name;
   }
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsXULTreeItemAccessible: Accessible protected implementation
+// XULTreeItemAccessible: Accessible protected implementation
 
 void
-nsXULTreeItemAccessible::CacheChildren()
+XULTreeItemAccessible::CacheChildren()
 {
 }
 
 
 ////////////////////////////////////////////////////////////////////////////////
-//  nsXULTreeColumAccessible
+//  XULTreeColumAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
-nsXULTreeColumAccessible::
-  nsXULTreeColumAccessible(nsIContent* aContent, DocAccessible* aDoc) :
+XULTreeColumAccessible::
+  XULTreeColumAccessible(nsIContent* aContent, DocAccessible* aDoc) :
   nsXULColumAccessible(aContent, aDoc)
 {
 }
 
 Accessible*
-nsXULTreeColumAccessible::GetSiblingAtOffset(PRInt32 aOffset,
-                                             nsresult* aError) const
+XULTreeColumAccessible::GetSiblingAtOffset(PRInt32 aOffset,
+                                           nsresult* aError) const
 {
   if (aOffset < 0)
     return nsXULColumAccessible::GetSiblingAtOffset(aOffset, aError);
 
   if (aError)
     *aError =  NS_OK; // fail peacefully
 
   nsCOMPtr<nsITreeBoxObject> tree = nsCoreUtils::GetTreeBoxObject(mContent);
   if (tree) {
     nsCOMPtr<nsITreeView> treeView;
     tree->GetView(getter_AddRefs(treeView));
     if (treeView) {
       PRInt32 rowCount = 0;
       treeView->GetRowCount(&rowCount);
       if (rowCount > 0 && aOffset <= rowCount) {
-        nsXULTreeAccessible* treeAcc = Parent()->AsXULTree();
+        XULTreeAccessible* treeAcc = Parent()->AsXULTree();
 
         if (treeAcc)
           return treeAcc->GetTreeItemAccessible(aOffset - 1);
       }
     }
   }
 
   return nsnull;
rename from accessible/src/xul/nsXULTreeAccessible.h
rename to accessible/src/xul/XULTreeAccessible.h
--- a/accessible/src/xul/nsXULTreeAccessible.h
+++ b/accessible/src/xul/XULTreeAccessible.h
@@ -1,48 +1,51 @@
 /* -*- 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/. */
-#ifndef __nsXULTreeAccessible_h__
-#define __nsXULTreeAccessible_h__
+
+#ifndef mozilla_a11y_XULTreeAccessible_h__
+#define mozilla_a11y_XULTreeAccessible_h__
 
 #include "nsITreeBoxObject.h"
 #include "nsITreeView.h"
 #include "nsITreeColumns.h"
 #include "nsXULListboxAccessible.h"
 
+namespace mozilla {
+namespace a11y {
+
 /*
  * A class the represents the XUL Tree widget.
  */
 const PRUint32 kMaxTreeColumns = 100;
 const PRUint32 kDefaultTreeCacheSize = 256;
 
 /**
  * Accessible class for XUL tree element.
  */
 
-class nsXULTreeAccessible : public AccessibleWrap
+class XULTreeAccessible : public AccessibleWrap
 {
 public:
   using Accessible::GetChildAt;
 
-  nsXULTreeAccessible(nsIContent* aContent, DocAccessible* aDoc);
+  XULTreeAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // nsISupports and cycle collection
   NS_DECL_ISUPPORTS_INHERITED
-  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsXULTreeAccessible,
-                                           Accessible)
+  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(XULTreeAccessible, Accessible)
 
   // nsAccessNode
   virtual void Shutdown();
 
   // Accessible
   virtual void Value(nsString& aValue);
-  virtual mozilla::a11y::role NativeRole();
+  virtual a11y::role NativeRole();
   virtual PRUint64 NativeState();
   virtual Accessible* ChildAtPoint(PRInt32 aX, PRInt32 aY,
                                    EWhichChildAtPoint aWhichChild);
 
   virtual Accessible* GetChildAt(PRUint32 aIndex);
   virtual PRUint32 ChildCount() const;
 
   // SelectAccessible
@@ -60,17 +63,17 @@ public:
   virtual bool IsWidget() const;
   virtual bool IsActiveWidget() const;
   virtual bool AreItemsOperable() const;
   virtual Accessible* CurrentItem();
   virtual void SetCurrentItem(Accessible* aItem);
 
   virtual Accessible* ContainerWidget() const;
 
-  // nsXULTreeAccessible
+  // XULTreeAccessible
 
   /**
    * Return tree item accessible at the givem row. If accessible doesn't exist
    * in the cache then create and cache it.
    *
    * @param aRow         [in] the given row index
    */
   Accessible* GetTreeItemAccessible(PRInt32 aRow);
@@ -112,68 +115,68 @@ protected:
   nsITreeView* mTreeView;
   AccessibleHashtable mAccessibleCache;
 };
 
 /**
  * Base class for tree item accessibles.
  */
 
-#define NS_XULTREEITEMBASEACCESSIBLE_IMPL_CID         \
+#define XULTREEITEMBASEACCESSIBLE_IMPL_CID            \
 {  /* 1ab79ae7-766a-443c-940b-b1e6b0831dfc */         \
   0x1ab79ae7,                                         \
   0x766a,                                             \
   0x443c,                                             \
   { 0x94, 0x0b, 0xb1, 0xe6, 0xb0, 0x83, 0x1d, 0xfc }  \
 }
 
-class nsXULTreeItemAccessibleBase : public AccessibleWrap
+class XULTreeItemAccessibleBase : public AccessibleWrap
 {
 public:
   using Accessible::GetParent;
 
-  nsXULTreeItemAccessibleBase(nsIContent* aContent, DocAccessible* aDoc,
-                              Accessible* aParent, nsITreeBoxObject* aTree,
-                              nsITreeView* aTreeView, PRInt32 aRow);
+  XULTreeItemAccessibleBase(nsIContent* aContent, DocAccessible* aDoc,
+                            Accessible* aParent, nsITreeBoxObject* aTree,
+                            nsITreeView* aTreeView, PRInt32 aRow);
 
   // nsISupports and cycle collection
   NS_DECL_ISUPPORTS_INHERITED
-  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsXULTreeItemAccessibleBase,
+  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(XULTreeItemAccessibleBase,
                                            AccessibleWrap)
 
   // nsIAccessible
   NS_IMETHOD GetBounds(PRInt32 *aX, PRInt32 *aY,
                        PRInt32 *aWidth, PRInt32 *aHeight);
 
-  NS_IMETHOD SetSelected(bool aSelect); 
+  NS_IMETHOD SetSelected(bool aSelect);
   NS_IMETHOD TakeFocus();
 
   NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
   NS_IMETHOD DoAction(PRUint8 aIndex);
 
   // nsAccessNode
   virtual void Shutdown();
   virtual bool IsPrimaryForNode() const;
 
   // Accessible
-  virtual mozilla::a11y::GroupPos GroupPosition();
+  virtual GroupPos GroupPosition();
   virtual PRUint64 NativeState();
   virtual PRUint64 NativeInteractiveState() const;
   virtual PRInt32 IndexInParent() const;
   virtual Relation RelationByType(PRUint32 aType);
   virtual Accessible* FocusedChild();
 
   // ActionAccessible
   virtual PRUint8 ActionCount();
 
   // Widgets
   virtual Accessible* ContainerWidget() const;
 
-  // nsXULTreeItemAccessibleBase
-  NS_DECLARE_STATIC_IID_ACCESSOR(NS_XULTREEITEMBASEACCESSIBLE_IMPL_CID)
+  // XULTreeItemAccessibleBase
+  NS_DECLARE_STATIC_IID_ACCESSOR(XULTREEITEMBASEACCESSIBLE_IMPL_CID)
 
   /**
    * Return row index associated with the accessible.
    */
   PRInt32 GetRowIndex() const { return mRow; }
 
   /**
    * Return cell accessible for the given column. If XUL tree accessible is not
@@ -190,92 +193,95 @@ public:
 protected:
   enum { eAction_Click = 0, eAction_Expand = 1 };
 
   // Accessible
   virtual void DispatchClickEvent(nsIContent *aContent, PRUint32 aActionIndex);
   virtual Accessible* GetSiblingAtOffset(PRInt32 aOffset,
                                          nsresult *aError = nsnull) const;
 
-  // nsXULTreeItemAccessibleBase
+  // XULTreeItemAccessibleBase
 
   /**
    * Return true if the tree item accessible is expandable (contains subrows).
    */
   bool IsExpandable();
 
   /**
    * Return name for cell at the given column.
    */
   void GetCellName(nsITreeColumn* aColumn, nsAString& aName);
 
   nsCOMPtr<nsITreeBoxObject> mTree;
   nsITreeView* mTreeView;
   PRInt32 mRow;
 };
 
-NS_DEFINE_STATIC_IID_ACCESSOR(nsXULTreeItemAccessibleBase,
-                              NS_XULTREEITEMBASEACCESSIBLE_IMPL_CID)
+NS_DEFINE_STATIC_IID_ACCESSOR(XULTreeItemAccessibleBase,
+                              XULTREEITEMBASEACCESSIBLE_IMPL_CID)
 
 
 /**
  * Accessible class for items for XUL tree.
  */
-class nsXULTreeItemAccessible : public nsXULTreeItemAccessibleBase
+class XULTreeItemAccessible : public XULTreeItemAccessibleBase
 {
 public:
-  nsXULTreeItemAccessible(nsIContent* aContent, DocAccessible* aDoc,
-                          Accessible* aParent, nsITreeBoxObject* aTree,
-                          nsITreeView* aTreeView, PRInt32 aRow);
+  XULTreeItemAccessible(nsIContent* aContent, DocAccessible* aDoc,
+                        Accessible* aParent, nsITreeBoxObject* aTree,
+                        nsITreeView* aTreeView, PRInt32 aRow);
 
   // nsISupports and cycle collection
   NS_DECL_ISUPPORTS_INHERITED
-  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsXULTreeItemAccessible,
-                                           nsXULTreeItemAccessibleBase)
+  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(XULTreeItemAccessible,
+                                           XULTreeItemAccessibleBase)
 
   // nsAccessNode
   virtual bool Init();
   virtual void Shutdown();
 
   // Accessible
-  virtual mozilla::a11y::ENameValueFlag Name(nsString& aName);
-  virtual mozilla::a11y::role NativeRole();
+  virtual ENameValueFlag Name(nsString& aName);
+  virtual a11y::role NativeRole();
 
-  // nsXULTreeItemAccessibleBase
+  // XULTreeItemAccessibleBase
   virtual void RowInvalidated(PRInt32 aStartColIdx, PRInt32 aEndColIdx);
 
 protected:
 
   // Accessible
   virtual void CacheChildren();
 
-  // nsXULTreeItemAccessible
+  // XULTreeItemAccessible
   nsCOMPtr<nsITreeColumn> mColumn;
   nsString mCachedName;
 };
 
 
 /**
  * Accessible class for columns element of XUL tree.
  */
-class nsXULTreeColumAccessible : public nsXULColumAccessible
+class XULTreeColumAccessible : public nsXULColumAccessible
 {
 public:
-  nsXULTreeColumAccessible(nsIContent* aContent, DocAccessible* aDoc);
+  XULTreeColumAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
 protected:
 
   // Accessible
   virtual Accessible* GetSiblingAtOffset(PRInt32 aOffset,
                                          nsresult *aError = nsnull) const;
 };
 
+} // namespace a11y
+} // namespace mozilla
+
 ////////////////////////////////////////////////////////////////////////////////
 // Accessible downcasting method
 
-inline nsXULTreeAccessible*
+inline mozilla::a11y::XULTreeAccessible*
 Accessible::AsXULTree()
 {
   return IsXULTree() ?
-    static_cast<nsXULTreeAccessible*>(this) : nsnull;
+    static_cast<mozilla::a11y::XULTreeAccessible*>(this) : nsnull;
 }
 
 #endif
rename from accessible/src/xul/nsXULTreeGridAccessible.cpp
rename to accessible/src/xul/XULTreeGridAccessible.cpp
--- a/accessible/src/xul/nsXULTreeGridAccessible.cpp
+++ b/accessible/src/xul/XULTreeGridAccessible.cpp
@@ -1,68 +1,68 @@
 /* -*- 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 "nsXULTreeGridAccessibleWrap.h"
+#include "XULTreeGridAccessibleWrap.h"
 
 #include "nsAccCache.h"
 #include "nsAccessibilityService.h"
 #include "nsAccUtils.h"
 #include "DocAccessible.h"
 #include "nsEventShell.h"
 #include "Relation.h"
 #include "Role.h"
 #include "States.h"
 
 #include "nsITreeSelection.h"
 #include "nsComponentManagerUtils.h"
 
 using namespace mozilla::a11y;
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsXULTreeGridAccessible
+// XULTreeGridAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
-nsXULTreeGridAccessible::
-  nsXULTreeGridAccessible(nsIContent* aContent, DocAccessible* aDoc) :
-  nsXULTreeAccessible(aContent, aDoc), xpcAccessibleTable(this)
+XULTreeGridAccessible::
+  XULTreeGridAccessible(nsIContent* aContent, DocAccessible* aDoc) :
+  XULTreeAccessible(aContent, aDoc), xpcAccessibleTable(this)
 {
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsXULTreeGridAccessible: nsISupports implementation
+// XULTreeGridAccessible: nsISupports implementation
 
-NS_IMPL_ISUPPORTS_INHERITED1(nsXULTreeGridAccessible,
-                             nsXULTreeAccessible,
+NS_IMPL_ISUPPORTS_INHERITED1(XULTreeGridAccessible,
+                             XULTreeAccessible,
                              nsIAccessibleTable)
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsXULTreeGridAccessible: nsIAccessibleTable implementation
+// XULTreeGridAccessible: nsIAccessibleTable implementation
 
 PRUint32
-nsXULTreeGridAccessible::ColCount()
+XULTreeGridAccessible::ColCount()
 {
   return nsCoreUtils::GetSensibleColumnCount(mTree);
 }
 
 PRUint32
-nsXULTreeGridAccessible::RowCount()
+XULTreeGridAccessible::RowCount()
 {
   if (!mTreeView)
     return 0;
 
   PRInt32 rowCount = 0;
   mTreeView->GetRowCount(&rowCount);
   return rowCount >= 0 ? rowCount : 0;
 }
 
 NS_IMETHODIMP
-nsXULTreeGridAccessible::GetSelectedCellCount(PRUint32* aCount)
+XULTreeGridAccessible::GetSelectedCellCount(PRUint32* aCount)
 {
   NS_ENSURE_ARG_POINTER(aCount);
   *aCount = 0;
 
   PRUint32 selectedrowCount = 0;
   nsresult rv = GetSelectedRowCount(&selectedrowCount);
   NS_ENSURE_SUCCESS(rv, rv);
 
@@ -70,17 +70,17 @@ nsXULTreeGridAccessible::GetSelectedCell
   rv = GetColumnCount(&columnCount);
   NS_ENSURE_SUCCESS(rv, rv);
 
   *aCount = selectedrowCount * columnCount;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsXULTreeGridAccessible::GetSelectedColumnCount(PRUint32* aCount)
+XULTreeGridAccessible::GetSelectedColumnCount(PRUint32* aCount)
 {
   NS_ENSURE_ARG_POINTER(aCount);
   *aCount = 0;
 
   if (IsDefunct())
     return NS_ERROR_FAILURE;
 
   // If all the row has been selected, then all the columns are selected,
@@ -101,34 +101,34 @@ nsXULTreeGridAccessible::GetSelectedColu
 
     *aCount = columnCount;
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsXULTreeGridAccessible::GetSelectedRowCount(PRUint32* aCount)
+XULTreeGridAccessible::GetSelectedRowCount(PRUint32* aCount)
 {
   NS_ENSURE_ARG_POINTER(aCount);
   *aCount = 0;
 
   if (IsDefunct())
     return NS_ERROR_FAILURE;
 
   PRInt32 selectedrowCount = 0;
   nsresult rv = GetSelectionCount(&selectedrowCount);
   NS_ENSURE_SUCCESS(rv, rv);
 
   *aCount = selectedrowCount;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsXULTreeGridAccessible::GetSelectedCells(nsIArray **aCells)
+XULTreeGridAccessible::GetSelectedCells(nsIArray** aCells)
 {
   NS_ENSURE_ARG_POINTER(aCells);
   *aCells = nsnull;
 
   if (!mTreeView)
     return NS_OK;
 
   nsCOMPtr<nsIMutableArray> selCells = do_CreateInstance(NS_ARRAY_CONTRACTID);
@@ -162,18 +162,18 @@ nsXULTreeGridAccessible::GetSelectedCell
     }
   }
 
   NS_ADDREF(*aCells = selCells);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsXULTreeGridAccessible::GetSelectedCellIndices(PRUint32 *aCellsCount,
-                                                PRInt32 **aCells)
+XULTreeGridAccessible::GetSelectedCellIndices(PRUint32* aCellsCount,
+                                              PRInt32** aCells)
 {
   NS_ENSURE_ARG_POINTER(aCellsCount);
   *aCellsCount = 0;
   NS_ENSURE_ARG_POINTER(aCells);
   *aCells = nsnull;
 
   if (!mTreeView)
     return NS_OK;
@@ -209,18 +209,18 @@ nsXULTreeGridAccessible::GetSelectedCell
   }
 
   *aCellsCount = selectedCellCount;
   *aCells = outArray;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsXULTreeGridAccessible::GetSelectedColumnIndices(PRUint32 *acolumnCount,
-                                                  PRInt32 **aColumns)
+XULTreeGridAccessible::GetSelectedColumnIndices(PRUint32* acolumnCount,
+                                                PRInt32** aColumns)
 {
   NS_ENSURE_ARG_POINTER(acolumnCount);
   *acolumnCount = 0;
   NS_ENSURE_ARG_POINTER(aColumns);
   *aColumns = nsnull;
 
   if (IsDefunct())
     return NS_ERROR_FAILURE;
@@ -251,18 +251,18 @@ nsXULTreeGridAccessible::GetSelectedColu
     outArray[colIdx] = colIdx;
 
   *acolumnCount = columnCount;
   *aColumns = outArray;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsXULTreeGridAccessible::GetSelectedRowIndices(PRUint32 *arowCount,
-                                               PRInt32 **aRows)
+XULTreeGridAccessible::GetSelectedRowIndices(PRUint32* arowCount,
+                                             PRInt32** aRows)
 {
   NS_ENSURE_ARG_POINTER(arowCount);
   *arowCount = 0;
   NS_ENSURE_ARG_POINTER(aRows);
   *aRows = nsnull;
 
   if (IsDefunct())
     return NS_ERROR_FAILURE;
@@ -294,67 +294,67 @@ nsXULTreeGridAccessible::GetSelectedRowI
   }
 
   *arowCount = selectedrowCount;
   *aRows = outArray;
   return NS_OK;
 }
 
 Accessible*
-nsXULTreeGridAccessible::CellAt(PRUint32 aRowIndex, PRUint32 aColumnIndex)
+XULTreeGridAccessible::CellAt(PRUint32 aRowIndex, PRUint32 aColumnIndex)
 { 
   Accessible* row = GetTreeItemAccessible(aRowIndex);
   if (!row)
     return nsnull;
 
   nsCOMPtr<nsITreeColumn> column =
     nsCoreUtils::GetSensibleColumnAt(mTree, aColumnIndex);
   if (!column)
     return nsnull;
 
-  nsRefPtr<nsXULTreeItemAccessibleBase> rowAcc = do_QueryObject(row);
+  nsRefPtr<XULTreeItemAccessibleBase> rowAcc = do_QueryObject(row);
   if (!rowAcc)
     return nsnull;
 
   return rowAcc->GetCellAccessible(column);
 }
 
 NS_IMETHODIMP
-nsXULTreeGridAccessible::GetColumnIndexAt(PRInt32 aCellIndex,
-                                          PRInt32 *aColumnIndex)
+XULTreeGridAccessible::GetColumnIndexAt(PRInt32 aCellIndex,
+                                        PRInt32* aColumnIndex)
 {
   NS_ENSURE_ARG_POINTER(aColumnIndex);
   *aColumnIndex = -1;
 
   PRInt32 columnCount = 0;
   nsresult rv = GetColumnCount(&columnCount);
   NS_ENSURE_SUCCESS(rv, rv);
 
   *aColumnIndex = aCellIndex % columnCount;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsXULTreeGridAccessible::GetRowIndexAt(PRInt32 aCellIndex, PRInt32 *aRowIndex)
+XULTreeGridAccessible::GetRowIndexAt(PRInt32 aCellIndex, PRInt32* aRowIndex)
 {
   NS_ENSURE_ARG_POINTER(aRowIndex);
   *aRowIndex = -1;
 
   PRInt32 columnCount;
   nsresult rv = GetColumnCount(&columnCount);
   NS_ENSURE_SUCCESS(rv, rv);
 
   *aRowIndex = aCellIndex / columnCount;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsXULTreeGridAccessible::GetRowAndColumnIndicesAt(PRInt32 aCellIndex,
-                                                  PRInt32* aRowIndex,
-                                                  PRInt32* aColumnIndex)
+XULTreeGridAccessible::GetRowAndColumnIndicesAt(PRInt32 aCellIndex,
+                                                PRInt32* aRowIndex,
+                                                PRInt32* aColumnIndex)
 {
   NS_ENSURE_ARG_POINTER(aRowIndex);
   *aRowIndex = -1;
   NS_ENSURE_ARG_POINTER(aColumnIndex);
   *aColumnIndex = -1;
 
   if (IsDefunct())
     return NS_ERROR_FAILURE;
@@ -364,18 +364,18 @@ nsXULTreeGridAccessible::GetRowAndColumn
   NS_ENSURE_SUCCESS(rv, rv);
 
   *aColumnIndex = aCellIndex % columnCount;
   *aRowIndex = aCellIndex / columnCount;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsXULTreeGridAccessible::GetColumnDescription(PRInt32 aColumnIndex,
-                                              nsAString& aDescription)
+XULTreeGridAccessible::GetColumnDescription(PRInt32 aColumnIndex,
+                                            nsAString& aDescription)
 {
   aDescription.Truncate();
 
   if (IsDefunct())
     return NS_ERROR_FAILURE;
 
   nsCOMPtr<nsIAccessible> treeColumns;
   Accessible::GetFirstChild(getter_AddRefs(treeColumns));
@@ -385,26 +385,25 @@ nsXULTreeGridAccessible::GetColumnDescri
     if (treeColumnItem)
       return treeColumnItem->GetName(aDescription);
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsXULTreeGridAccessible::GetRowDescription(PRInt32 aRowIndex,
-                                           nsAString& aDescription)
+XULTreeGridAccessible::GetRowDescription(PRInt32 aRowIndex,
+                                         nsAString& aDescription)
 {
   aDescription.Truncate();
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsXULTreeGridAccessible::IsColumnSelected(PRInt32 aColumnIndex,
-                                          bool *aIsSelected)
+XULTreeGridAccessible::IsColumnSelected(PRInt32 aColumnIndex, bool* aIsSelected)
 {
   NS_ENSURE_ARG_POINTER(aIsSelected);
   *aIsSelected = false;
 
   if (IsDefunct())
     return NS_ERROR_FAILURE;
 
   // If all the row has been selected, then all the columns are selected.
@@ -418,17 +417,17 @@ nsXULTreeGridAccessible::IsColumnSelecte
   rv = GetSelectionCount(&selectedrowCount);
   NS_ENSURE_SUCCESS(rv, rv);
 
   *aIsSelected = rowCount == selectedrowCount;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsXULTreeGridAccessible::IsRowSelected(PRInt32 aRowIndex, bool *aIsSelected)
+XULTreeGridAccessible::IsRowSelected(PRInt32 aRowIndex, bool* aIsSelected)
 {
   NS_ENSURE_ARG_POINTER(aIsSelected);
   *aIsSelected = false;
 
   if (IsDefunct())
     return NS_ERROR_FAILURE;
 
   if (!mTreeView)
@@ -437,155 +436,154 @@ nsXULTreeGridAccessible::IsRowSelected(P
   nsCOMPtr<nsITreeSelection> selection;
   nsresult rv = mTreeView->GetSelection(getter_AddRefs(selection));
   NS_ENSURE_SUCCESS(rv, rv);
 
   return selection->IsSelected(aRowIndex, aIsSelected);
 }
 
 NS_IMETHODIMP
-nsXULTreeGridAccessible::IsCellSelected(PRInt32 aRowIndex, PRInt32 aColumnIndex,
-                                        bool *aIsSelected)
+XULTreeGridAccessible::IsCellSelected(PRInt32 aRowIndex, PRInt32 aColumnIndex,
+                                      bool* aIsSelected)
 {
   return IsRowSelected(aRowIndex, aIsSelected);
 }
 
 NS_IMETHODIMP
-nsXULTreeGridAccessible::SelectRow(PRInt32 aRowIndex)
+XULTreeGridAccessible::SelectRow(PRInt32 aRowIndex)
 {
   if (!mTreeView)
     return NS_ERROR_INVALID_ARG;
 
   nsCOMPtr<nsITreeSelection> selection;
   mTreeView->GetSelection(getter_AddRefs(selection));
   NS_ENSURE_STATE(selection);
 
   return selection->Select(aRowIndex);
 }
 
 NS_IMETHODIMP
-nsXULTreeGridAccessible::SelectColumn(PRInt32 aColumnIndex)
+XULTreeGridAccessible::SelectColumn(PRInt32 aColumnIndex)
 {
   return NS_OK;
 }
 
 void
-nsXULTreeGridAccessible::UnselectRow(PRUint32 aRowIdx)
+XULTreeGridAccessible::UnselectRow(PRUint32 aRowIdx)
 {
   if (!mTreeView)
     return;
 
   nsCOMPtr<nsITreeSelection> selection;
   mTreeView->GetSelection(getter_AddRefs(selection));
 
   if (selection)
     selection->ClearRange(aRowIdx, aRowIdx);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsXULTreeGridAccessible: nsAccessNode implementation
+// XULTreeGridAccessible: nsAccessNode implementation
 
 void
-nsXULTreeGridAccessible::Shutdown()
+XULTreeGridAccessible::Shutdown()
 {
   mTable = nsnull;
-  nsXULTreeAccessible::Shutdown();
+  XULTreeAccessible::Shutdown();
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsXULTreeGridAccessible: Accessible implementation
+// XULTreeGridAccessible: Accessible implementation
 
 role
-nsXULTreeGridAccessible::NativeRole()
+XULTreeGridAccessible::NativeRole()
 {
   nsCOMPtr<nsITreeColumns> treeColumns;
   mTree->GetColumns(getter_AddRefs(treeColumns));
   if (!treeColumns) {
     NS_ERROR("No treecolumns object for tree!");
     return roles::NOTHING;
   }
 
   nsCOMPtr<nsITreeColumn> primaryColumn;
   treeColumns->GetPrimaryColumn(getter_AddRefs(primaryColumn));
 
   return primaryColumn ? roles::TREE_TABLE : roles::TABLE;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsXULTreeGridAccessible: nsXULTreeAccessible implementation
+// XULTreeGridAccessible: XULTreeAccessible implementation
 
 already_AddRefed<Accessible>
-nsXULTreeGridAccessible::CreateTreeItemAccessible(PRInt32 aRow)
+XULTreeGridAccessible::CreateTreeItemAccessible(PRInt32 aRow)
 {
   nsRefPtr<Accessible> accessible =
-    new nsXULTreeGridRowAccessible(mContent, mDoc, this, mTree,
-                                   mTreeView, aRow);
+    new XULTreeGridRowAccessible(mContent, mDoc, this, mTree, mTreeView, aRow);
 
   return accessible.forget();
 }
 
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsXULTreeGridRowAccessible
+// XULTreeGridRowAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
-nsXULTreeGridRowAccessible::
-  nsXULTreeGridRowAccessible(nsIContent* aContent, DocAccessible* aDoc,
-                             Accessible* aTreeAcc, nsITreeBoxObject* aTree,
-                             nsITreeView* aTreeView, PRInt32 aRow) :
-  nsXULTreeItemAccessibleBase(aContent, aDoc, aTreeAcc, aTree, aTreeView, aRow)
+XULTreeGridRowAccessible::
+  XULTreeGridRowAccessible(nsIContent* aContent, DocAccessible* aDoc,
+                           Accessible* aTreeAcc, nsITreeBoxObject* aTree,
+                           nsITreeView* aTreeView, PRInt32 aRow) :
+  XULTreeItemAccessibleBase(aContent, aDoc, aTreeAcc, aTree, aTreeView, aRow)
 {
   mAccessibleCache.Init(kDefaultTreeCacheSize);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsXULTreeGridRowAccessible: nsISupports and cycle collection implementation
+// XULTreeGridRowAccessible: nsISupports and cycle collection implementation
 
-NS_IMPL_CYCLE_COLLECTION_CLASS(nsXULTreeGridRowAccessible)
+NS_IMPL_CYCLE_COLLECTION_CLASS(XULTreeGridRowAccessible)
 
-NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsXULTreeGridRowAccessible,
-                                                  nsXULTreeItemAccessibleBase)
+NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(XULTreeGridRowAccessible,
+                                                  XULTreeItemAccessibleBase)
 CycleCollectorTraverseCache(tmp->mAccessibleCache, &cb);
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
-NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(nsXULTreeGridRowAccessible,
-                                                nsXULTreeItemAccessibleBase)
+NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(XULTreeGridRowAccessible,
+                                                XULTreeItemAccessibleBase)
 ClearCache(tmp->mAccessibleCache);
 NS_IMPL_CYCLE_COLLECTION_UNLINK_END
 
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(nsXULTreeGridRowAccessible)
-NS_INTERFACE_MAP_STATIC_AMBIGUOUS(nsXULTreeGridRowAccessible)
-NS_INTERFACE_MAP_END_INHERITING(nsXULTreeItemAccessibleBase)
+NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(XULTreeGridRowAccessible)
+NS_INTERFACE_MAP_STATIC_AMBIGUOUS(XULTreeGridRowAccessible)
+NS_INTERFACE_MAP_END_INHERITING(XULTreeItemAccessibleBase)
 
-NS_IMPL_ADDREF_INHERITED(nsXULTreeGridRowAccessible,
-                         nsXULTreeItemAccessibleBase)
-NS_IMPL_RELEASE_INHERITED(nsXULTreeGridRowAccessible,
-                          nsXULTreeItemAccessibleBase)
+NS_IMPL_ADDREF_INHERITED(XULTreeGridRowAccessible,
+                         XULTreeItemAccessibleBase)
+NS_IMPL_RELEASE_INHERITED(XULTreeGridRowAccessible,
+                          XULTreeItemAccessibleBase)
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsXULTreeGridRowAccessible: nsAccessNode implementation
+// XULTreeGridRowAccessible: nsAccessNode implementation
 
 void
-nsXULTreeGridRowAccessible::Shutdown()
+XULTreeGridRowAccessible::Shutdown()
 {
   ClearCache(mAccessibleCache);
-  nsXULTreeItemAccessibleBase::Shutdown();
+  XULTreeItemAccessibleBase::Shutdown();
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsXULTreeGridRowAccessible: Accessible implementation
+// XULTreeGridRowAccessible: Accessible implementation
 
 role
-nsXULTreeGridRowAccessible::NativeRole()
+XULTreeGridRowAccessible::NativeRole()
 {
   return roles::ROW;
 }
 
 ENameValueFlag
-nsXULTreeGridRowAccessible::Name(nsString& aName)
+XULTreeGridRowAccessible::Name(nsString& aName)
 {
   aName.Truncate();
 
   // XXX: the row name sholdn't be a concatenation of cell names (bug 664384).
   nsCOMPtr<nsITreeColumn> column = nsCoreUtils::GetFirstSensibleColumn(mTree);
   while (column) {
     if (!aName.IsEmpty())
       aName.AppendLiteral(" ");
@@ -596,18 +594,18 @@ nsXULTreeGridRowAccessible::Name(nsStrin
 
     column = nsCoreUtils::GetNextSensibleColumn(column);
   }
 
   return eNameOK;
 }
 
 Accessible*
-nsXULTreeGridRowAccessible::ChildAtPoint(PRInt32 aX, PRInt32 aY,
-                                         EWhichChildAtPoint aWhichChild)
+XULTreeGridRowAccessible::ChildAtPoint(PRInt32 aX, PRInt32 aY,
+                                       EWhichChildAtPoint aWhichChild)
 {
   nsIFrame *frame = GetFrame();
   if (!frame)
     return nsnull;
 
   nsPresContext *presContext = frame->PresContext();
   nsIPresShell* presShell = presContext->PresShell();
 
@@ -628,144 +626,144 @@ nsXULTreeGridRowAccessible::ChildAtPoint
   // Return if we failed to find tree cell in the row for the given point.
   if (row != mRow || !column)
     return nsnull;
 
   return GetCellAccessible(column);
 }
 
 Accessible*
-nsXULTreeGridRowAccessible::GetChildAt(PRUint32 aIndex)
+XULTreeGridRowAccessible::GetChildAt(PRUint32 aIndex)
 {
   if (IsDefunct())
     return nsnull;
 
   nsCOMPtr<nsITreeColumn> column =
     nsCoreUtils::GetSensibleColumnAt(mTree, aIndex);
   if (!column)
     return nsnull;
 
   return GetCellAccessible(column);
 }
 
 PRUint32
-nsXULTreeGridRowAccessible::ChildCount() const
+XULTreeGridRowAccessible::ChildCount() const
 {
   return nsCoreUtils::GetSensibleColumnCount(mTree);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsXULTreeGridRowAccessible: nsXULTreeItemAccessibleBase implementation
+// XULTreeGridRowAccessible: XULTreeItemAccessibleBase implementation
 
 Accessible*
-nsXULTreeGridRowAccessible::GetCellAccessible(nsITreeColumn* aColumn)
+XULTreeGridRowAccessible::GetCellAccessible(nsITreeColumn* aColumn)
 {
   NS_PRECONDITION(aColumn, "No tree column!");
 
   void* key = static_cast<void*>(aColumn);
   Accessible* cachedCell = mAccessibleCache.GetWeak(key);
   if (cachedCell)
     return cachedCell;
 
   nsRefPtr<Accessible> cell =
-    new nsXULTreeGridCellAccessibleWrap(mContent, mDoc, this, mTree,
-                                        mTreeView, mRow, aColumn);
+    new XULTreeGridCellAccessibleWrap(mContent, mDoc, this, mTree,
+                                      mTreeView, mRow, aColumn);
   if (cell) {
     mAccessibleCache.Put(key, cell);
     if (Document()->BindToDocument(cell, nsnull))
       return cell;
 
     mAccessibleCache.Remove(key);
   }
 
   return nsnull;
 }
 
 void
-nsXULTreeGridRowAccessible::RowInvalidated(PRInt32 aStartColIdx,
-                                           PRInt32 aEndColIdx)
+XULTreeGridRowAccessible::RowInvalidated(PRInt32 aStartColIdx,
+                                         PRInt32 aEndColIdx)
 {
   nsCOMPtr<nsITreeColumns> treeColumns;
   mTree->GetColumns(getter_AddRefs(treeColumns));
   if (!treeColumns)
     return;
 
   for (PRInt32 colIdx = aStartColIdx; colIdx <= aEndColIdx; ++colIdx) {
     nsCOMPtr<nsITreeColumn> column;
     treeColumns->GetColumnAt(colIdx, getter_AddRefs(column));
     if (column && !nsCoreUtils::IsColumnHidden(column)) {
       Accessible* cellAccessible = GetCellAccessible(column);
       if (cellAccessible) {
-        nsRefPtr<nsXULTreeGridCellAccessible> cellAcc = do_QueryObject(cellAccessible);
+        nsRefPtr<XULTreeGridCellAccessible> cellAcc = do_QueryObject(cellAccessible);
 
         cellAcc->CellInvalidated();
       }
     }
   }
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsXULTreeGridRowAccessible: Accessible protected implementation
+// XULTreeGridRowAccessible: Accessible protected implementation
 
 void
-nsXULTreeGridRowAccessible::CacheChildren()
+XULTreeGridRowAccessible::CacheChildren()
 {
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsXULTreeGridCellAccessible
+// XULTreeGridCellAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
-nsXULTreeGridCellAccessible::
-  nsXULTreeGridCellAccessible(nsIContent* aContent, DocAccessible* aDoc,
-                              nsXULTreeGridRowAccessible* aRowAcc,
-                              nsITreeBoxObject* aTree, nsITreeView* aTreeView,
-                              PRInt32 aRow, nsITreeColumn* aColumn) :
+XULTreeGridCellAccessible::
+  XULTreeGridCellAccessible(nsIContent* aContent, DocAccessible* aDoc,
+                            XULTreeGridRowAccessible* aRowAcc,
+                            nsITreeBoxObject* aTree, nsITreeView* aTreeView,
+                            PRInt32 aRow, nsITreeColumn* aColumn) :
   LeafAccessible(aContent, aDoc), mTree(aTree),
   mTreeView(aTreeView), mRow(aRow), mColumn(aColumn)
 {
   mParent = aRowAcc;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsXULTreeGridCellAccessible: nsISupports implementation
+// XULTreeGridCellAccessible: nsISupports implementation
 
-NS_IMPL_CYCLE_COLLECTION_CLASS(nsXULTreeGridCellAccessible)
+NS_IMPL_CYCLE_COLLECTION_CLASS(XULTreeGridCellAccessible)
 
-NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsXULTreeGridCellAccessible,
+NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(XULTreeGridCellAccessible,
                                                   LeafAccessible)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mTree)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mColumn)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
-NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(nsXULTreeGridCellAccessible,
+NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(XULTreeGridCellAccessible,
                                                 LeafAccessible)
   NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mTree)
   NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mColumn)
 NS_IMPL_CYCLE_COLLECTION_UNLINK_END
 
-NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(nsXULTreeGridCellAccessible)
-  NS_INTERFACE_TABLE_INHERITED2(nsXULTreeGridCellAccessible,
+NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(XULTreeGridCellAccessible)
+  NS_INTERFACE_TABLE_INHERITED2(XULTreeGridCellAccessible,
                                 nsIAccessibleTableCell,
-                                nsXULTreeGridCellAccessible)
+                                XULTreeGridCellAccessible)
 NS_INTERFACE_TABLE_TAIL_INHERITING(LeafAccessible)
-NS_IMPL_ADDREF_INHERITED(nsXULTreeGridCellAccessible, LeafAccessible)
-NS_IMPL_RELEASE_INHERITED(nsXULTreeGridCellAccessible, LeafAccessible)
+NS_IMPL_ADDREF_INHERITED(XULTreeGridCellAccessible, LeafAccessible)
+NS_IMPL_RELEASE_INHERITED(XULTreeGridCellAccessible, LeafAccessible)
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsXULTreeGridCellAccessible: nsIAccessible implementation
+// XULTreeGridCellAccessible: nsIAccessible implementation
 
 Accessible*
-nsXULTreeGridCellAccessible::FocusedChild()
+XULTreeGridCellAccessible::FocusedChild()
 {
   return nsnull;
 }
 
 ENameValueFlag
-nsXULTreeGridCellAccessible::Name(nsString& aName)
+XULTreeGridCellAccessible::Name(nsString& aName)
 {
   aName.Truncate();
 
   if (!mTreeView)
     return eNameOK;
 
   mTreeView->GetCellText(mRow, mColumn, aName);
 
@@ -776,18 +774,18 @@ nsXULTreeGridCellAccessible::Name(nsStri
   // GetCellValue for that cell would return "starred" or "flagged" for example.
   if (aName.IsEmpty())
     mTreeView->GetCellValue(mRow, mColumn, aName);
 
   return eNameOK;
 }
 
 NS_IMETHODIMP
-nsXULTreeGridCellAccessible::GetBounds(PRInt32 *aX, PRInt32 *aY,
-                                       PRInt32 *aWidth, PRInt32 *aHeight)
+XULTreeGridCellAccessible::GetBounds(PRInt32* aX, PRInt32* aY,
+                                     PRInt32* aWidth, PRInt32* aHeight)
 {
   NS_ENSURE_ARG_POINTER(aX);
   *aX = 0;
   NS_ENSURE_ARG_POINTER(aY);
   *aY = 0;
   NS_ENSURE_ARG_POINTER(aWidth);
   *aWidth = 0;
   NS_ENSURE_ARG_POINTER(aHeight);
@@ -818,33 +816,33 @@ nsXULTreeGridCellAccessible::GetBounds(P
   *aY = presContext->CSSPixelsToDevPixels(y);
   *aWidth = presContext->CSSPixelsToDevPixels(width);
   *aHeight = presContext->CSSPixelsToDevPixels(height);
 
   return NS_OK;
 }
 
 PRUint8
-nsXULTreeGridCellAccessible::ActionCount()
+XULTreeGridCellAccessible::ActionCount()
 {
   bool isCycler = false;
   mColumn->GetCycler(&isCycler);
   if (isCycler)
     return 1;
 
   PRInt16 type;
   mColumn->GetType(&type);
   if (type == nsITreeColumn::TYPE_CHECKBOX && IsEditable())
     return 1;
 
   return 0;
 }
 
 NS_IMETHODIMP
-nsXULTreeGridCellAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
+XULTreeGridCellAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
 {
   aName.Truncate();
 
   if (aIndex != eAction_Click)
     return NS_ERROR_INVALID_ARG;
 
   if (IsDefunct() || !mTreeView)
     return NS_ERROR_FAILURE;
@@ -868,17 +866,17 @@ nsXULTreeGridCellAccessible::GetActionNa
 
     return NS_OK;
   }
 
   return NS_ERROR_INVALID_ARG;
 }
 
 NS_IMETHODIMP
-nsXULTreeGridCellAccessible::DoAction(PRUint8 aIndex)
+XULTreeGridCellAccessible::DoAction(PRUint8 aIndex)
 {
   if (aIndex != eAction_Click)
     return NS_ERROR_INVALID_ARG;
 
   if (IsDefunct())
     return NS_ERROR_FAILURE;
 
   bool isCycler = false;
@@ -894,80 +892,80 @@ nsXULTreeGridCellAccessible::DoAction(PR
     DoCommand();
     return NS_OK;
   }
 
   return NS_ERROR_INVALID_ARG;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsXULTreeGridCellAccessible: nsIAccessibleTableCell implementation
+// XULTreeGridCellAccessible: nsIAccessibleTableCell implementation
 
 NS_IMETHODIMP
-nsXULTreeGridCellAccessible::GetTable(nsIAccessibleTable **aTable)
+XULTreeGridCellAccessible::GetTable(nsIAccessibleTable** aTable)
 {
   NS_ENSURE_ARG_POINTER(aTable);
   *aTable = nsnull;
 
   if (IsDefunct())
     return NS_OK;
 
   Accessible* grandParent = mParent->Parent();
   if (grandParent)
     CallQueryInterface(grandParent, aTable);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsXULTreeGridCellAccessible::GetColumnIndex(PRInt32 *aColumnIndex)
+XULTreeGridCellAccessible::GetColumnIndex(PRInt32* aColumnIndex)
 {
   NS_ENSURE_ARG_POINTER(aColumnIndex);
   *aColumnIndex = -1;
 
   if (IsDefunct())
     return NS_ERROR_FAILURE;
 
   *aColumnIndex = GetColumnIndex();
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsXULTreeGridCellAccessible::GetRowIndex(PRInt32 *aRowIndex)
+XULTreeGridCellAccessible::GetRowIndex(PRInt32* aRowIndex)
 {
   NS_ENSURE_ARG_POINTER(aRowIndex);
   *aRowIndex = -1;
 
   if (IsDefunct())
     return NS_ERROR_FAILURE;
 
   *aRowIndex = mRow;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsXULTreeGridCellAccessible::GetColumnExtent(PRInt32 *aExtentCount)
+XULTreeGridCellAccessible::GetColumnExtent(PRInt32* aExtentCount)
 {
   NS_ENSURE_ARG_POINTER(aExtentCount);
   *aExtentCount = 1;
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsXULTreeGridCellAccessible::GetRowExtent(PRInt32 *aExtentCount)
+XULTreeGridCellAccessible::GetRowExtent(PRInt32* aExtentCount)
 {
   NS_ENSURE_ARG_POINTER(aExtentCount);
   *aExtentCount = 1;
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsXULTreeGridCellAccessible::GetColumnHeaderCells(nsIArray **aHeaderCells)
+XULTreeGridCellAccessible::GetColumnHeaderCells(nsIArray** aHeaderCells)
 {
   NS_ENSURE_ARG_POINTER(aHeaderCells);
   *aHeaderCells = nsnull;
 
   if (IsDefunct() || !mDoc)
     return NS_ERROR_FAILURE;
 
   nsresult rv = NS_OK;
@@ -985,17 +983,17 @@ nsXULTreeGridCellAccessible::GetColumnHe
     headerCells->AppendElement(static_cast<nsIAccessible*>(headerCell),
                                false);
 
   NS_ADDREF(*aHeaderCells = headerCells);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsXULTreeGridCellAccessible::GetRowHeaderCells(nsIArray **aHeaderCells)
+XULTreeGridCellAccessible::GetRowHeaderCells(nsIArray** aHeaderCells)
 {
   NS_ENSURE_ARG_POINTER(aHeaderCells);
   *aHeaderCells = nsnull;
 
   if (IsDefunct())
     return NS_ERROR_FAILURE;
 
   nsresult rv = NS_OK;
@@ -1003,61 +1001,61 @@ nsXULTreeGridCellAccessible::GetRowHeade
     do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
   NS_ADDREF(*aHeaderCells = headerCells);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsXULTreeGridCellAccessible::IsSelected(bool *aIsSelected)
+XULTreeGridCellAccessible::IsSelected(bool* aIsSelected)
 {
   NS_ENSURE_ARG_POINTER(aIsSelected);
   *aIsSelected = false;
 
   if (IsDefunct() || !mTreeView)
     return NS_ERROR_FAILURE;
 
   nsCOMPtr<nsITreeSelection> selection;
   nsresult rv = mTreeView->GetSelection(getter_AddRefs(selection));
   NS_ENSURE_SUCCESS(rv, rv);
 
   return selection->IsSelected(mRow, aIsSelected);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsXULTreeGridCellAccessible: nsAccessNode implementation
+// XULTreeGridCellAccessible: nsAccessNode implementation
 
 bool
-nsXULTreeGridCellAccessible::Init()
+XULTreeGridCellAccessible::Init()
 {
   if (!LeafAccessible::Init() || !mTreeView)
     return false;
 
   PRInt16 type;
   mColumn->GetType(&type);
   if (type == nsITreeColumn::TYPE_CHECKBOX)
     mTreeView->GetCellValue(mRow, mColumn, mCachedTextEquiv);
   else
     mTreeView->GetCellText(mRow, mColumn, mCachedTextEquiv);
 
   return true;
 }
 
 bool
-nsXULTreeGridCellAccessible::IsPrimaryForNode() const
+XULTreeGridCellAccessible::IsPrimaryForNode() const
 {
   return false;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsXULTreeGridCellAccessible: Accessible public implementation
+// XULTreeGridCellAccessible: Accessible public implementation
 
 nsresult
-nsXULTreeGridCellAccessible::GetAttributesInternal(nsIPersistentProperties *aAttributes)
+XULTreeGridCellAccessible::GetAttributesInternal(nsIPersistentProperties* aAttributes)
 {
   NS_ENSURE_ARG_POINTER(aAttributes);
 
   if (IsDefunct())
     return NS_ERROR_FAILURE;
 
   // "table-cell-index" attribute
   Accessible* grandParent = mParent->Parent();
@@ -1086,23 +1084,23 @@ nsXULTreeGridCellAccessible::GetAttribut
   if (NS_SUCCEEDED(rv) && isCycler)
     nsAccUtils::SetAccAttr(aAttributes, nsGkAtoms::cycles,
                            NS_LITERAL_STRING("true"));
 
   return NS_OK;
 }
 
 role
-nsXULTreeGridCellAccessible::NativeRole()
+XULTreeGridCellAccessible::NativeRole()
 {
   return roles::GRID_CELL;
 }
 
 PRUint64
-nsXULTreeGridCellAccessible::NativeState()
+XULTreeGridCellAccessible::NativeState()
 {
   if (!mTreeView)
     return states::DEFUNCT;
 
   // selectable/selected state
   PRUint64 states = states::SELECTABLE; // keep in sync with NativeInteractiveState
 
   nsCOMPtr<nsITreeSelection> selection;
@@ -1124,53 +1122,53 @@ nsXULTreeGridCellAccessible::NativeState
     if (checked.EqualsIgnoreCase("true"))
       states |= states::CHECKED;
   }
 
   return states;
 }
 
 PRUint64
-nsXULTreeGridCellAccessible::NativeInteractiveState() const
+XULTreeGridCellAccessible::NativeInteractiveState() const
 {
   return states::SELECTABLE;
 }
 
 PRInt32
-nsXULTreeGridCellAccessible::IndexInParent() const
+XULTreeGridCellAccessible::IndexInParent() const
 {
   return GetColumnIndex();
 }
 
 Relation
-nsXULTreeGridCellAccessible::RelationByType(PRUint32 aType)
+XULTreeGridCellAccessible::RelationByType(PRUint32 aType)
 {
   return Relation();
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsXULTreeGridCellAccessible: public implementation
+// XULTreeGridCellAccessible: public implementation
 
 PRInt32
-nsXULTreeGridCellAccessible::GetColumnIndex() const
+XULTreeGridCellAccessible::GetColumnIndex() const
 {
   PRInt32 index = 0;
   nsCOMPtr<nsITreeColumn> column = mColumn;
   while (true) {
     column = nsCoreUtils::GetPreviousSensibleColumn(column);
     if (!column)
       break;
     index++;
   }
 
   return index;
 }
 
 void
-nsXULTreeGridCellAccessible::CellInvalidated()
+XULTreeGridCellAccessible::CellInvalidated()
 {
   if (!mTreeView)
     return;
 
   nsAutoString textEquiv;
 
   PRInt16 type;
   mColumn->GetType(&type);
@@ -1191,21 +1189,21 @@ nsXULTreeGridCellAccessible::CellInvalid
   mTreeView->GetCellText(mRow, mColumn, textEquiv);
   if (mCachedTextEquiv != textEquiv) {
     nsEventShell::FireEvent(nsIAccessibleEvent::EVENT_NAME_CHANGE, this);
     mCachedTextEquiv = textEquiv;
   }
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsXULTreeGridCellAccessible: Accessible protected implementation
+// XULTreeGridCellAccessible: Accessible protected implementation
 
 Accessible*
-nsXULTreeGridCellAccessible::GetSiblingAtOffset(PRInt32 aOffset,
-                                                nsresult* aError) const
+XULTreeGridCellAccessible::GetSiblingAtOffset(PRInt32 aOffset,
+                                              nsresult* aError) const
 {
   if (aError)
     *aError =  NS_OK; // fail peacefully
 
   nsCOMPtr<nsITreeColumn> columnAtOffset(mColumn), column;
   if (aOffset < 0) {
     for (PRInt32 index = aOffset; index < 0 && columnAtOffset; index++) {
       column = nsCoreUtils::GetPreviousSensibleColumn(columnAtOffset);
@@ -1216,35 +1214,35 @@ nsXULTreeGridCellAccessible::GetSiblingA
       column = nsCoreUtils::GetNextSensibleColumn(columnAtOffset);
       column.swap(columnAtOffset);
     }
   }
 
   if (!columnAtOffset)
     return nsnull;
 
-  nsRefPtr<nsXULTreeItemAccessibleBase> rowAcc = do_QueryObject(Parent());
+  nsRefPtr<XULTreeItemAccessibleBase> rowAcc = do_QueryObject(Parent());
   return rowAcc->GetCellAccessible(columnAtOffset);
 }
 
 void
-nsXULTreeGridCellAccessible::DispatchClickEvent(nsIContent *aContent,
-                                                PRUint32 aActionIndex)
+XULTreeGridCellAccessible::DispatchClickEvent(nsIContent* aContent,
+                                              PRUint32 aActionIndex)
 {
   if (IsDefunct())
     return;
 
   nsCoreUtils::DispatchClickEvent(mTree, mRow, mColumn);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsXULTreeGridCellAccessible: protected implementation
+// XULTreeGridCellAccessible: protected implementation
 
 bool
-nsXULTreeGridCellAccessible::IsEditable() const
+XULTreeGridCellAccessible::IsEditable() const
 {
   if (!mTreeView)
     return false;
 
   // XXX: logic corresponds to tree.xml, it's preferable to have interface
   // method to check it.
   bool isEditable = false;
   nsresult rv = mTreeView->IsEditable(mRow, mColumn, &isEditable);
rename from accessible/src/xul/nsXULTreeGridAccessible.h
rename to accessible/src/xul/XULTreeGridAccessible.h
--- a/accessible/src/xul/nsXULTreeGridAccessible.h
+++ b/accessible/src/xul/XULTreeGridAccessible.h
@@ -1,30 +1,33 @@
 /* -*- 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/. */
 
-#ifndef __nsXULTreeGridAccessible_h__
-#define __nsXULTreeGridAccessible_h__
+#ifndef mozilla_a11y_XULTreeGridAccessible_h__
+#define mozilla_a11y_XULTreeGridAccessible_h__
 
-#include "nsXULTreeAccessible.h"
+#include "XULTreeAccessible.h"
 #include "TableAccessible.h"
 #include "xpcAccessibleTable.h"
 
+namespace mozilla {
+namespace a11y {
+
 /**
  * Represents accessible for XUL tree in the case when it has multiple columns.
  */
-class nsXULTreeGridAccessible : public nsXULTreeAccessible,
-                                public xpcAccessibleTable,
-                                public nsIAccessibleTable,
-                                public mozilla::a11y::TableAccessible
+class XULTreeGridAccessible : public XULTreeAccessible,
+                              public xpcAccessibleTable,
+                              public nsIAccessibleTable,
+                              public TableAccessible
 {
 public:
-  nsXULTreeGridAccessible(nsIContent* aContent, DocAccessible* aDoc);
+  XULTreeGridAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIAccessibleTable
   NS_DECL_OR_FORWARD_NSIACCESSIBLETABLE_WITH_XPCACCESSIBLETABLE
 
   // TableAccessible
@@ -32,96 +35,96 @@ public:
   virtual PRUint32 RowCount();
   virtual Accessible* CellAt(PRUint32 aRowIndex, PRUint32 aColumnIndex);
   virtual void UnselectRow(PRUint32 aRowIdx);
 
   // nsAccessNode
   virtual void Shutdown();
 
   // Accessible
-  virtual mozilla::a11y::TableAccessible* AsTable() { return this; }
-  virtual mozilla::a11y::role NativeRole();
+  virtual TableAccessible* AsTable() { return this; }
+  virtual a11y::role NativeRole();
 
 protected:
 
-  // nsXULTreeAccessible
+  // XULTreeAccessible
   virtual already_AddRefed<Accessible> CreateTreeItemAccessible(PRInt32 aRow);
 };
 
 
 /**
  * Represents accessible for XUL tree item in the case when XUL tree has
  * multiple columns.
  */
-class nsXULTreeGridRowAccessible : public nsXULTreeItemAccessibleBase
+class XULTreeGridRowAccessible : public XULTreeItemAccessibleBase
 {
 public:
   using Accessible::GetChildAt;
 
-  nsXULTreeGridRowAccessible(nsIContent* aContent, DocAccessible* aDoc,
-                             Accessible* aParent, nsITreeBoxObject* aTree,
-                             nsITreeView* aTreeView, PRInt32 aRow);
+  XULTreeGridRowAccessible(nsIContent* aContent, DocAccessible* aDoc,
+                           Accessible* aParent, nsITreeBoxObject* aTree,
+                           nsITreeView* aTreeView, PRInt32 aRow);
 
   // nsISupports and cycle collection
   NS_DECL_ISUPPORTS_INHERITED
-  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsXULTreeGridRowAccessible,
-                                           nsXULTreeItemAccessibleBase)
+  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(XULTreeGridRowAccessible,
+                                           XULTreeItemAccessibleBase)
 
   // nsAccessNode
   virtual void Shutdown();
 
   // Accessible
-  virtual mozilla::a11y::role NativeRole();
-  virtual mozilla::a11y::ENameValueFlag Name(nsString& aName);
+  virtual a11y::role NativeRole();
+  virtual ENameValueFlag Name(nsString& aName);
   virtual Accessible* ChildAtPoint(PRInt32 aX, PRInt32 aY,
                                    EWhichChildAtPoint aWhichChild);
 
   virtual Accessible* GetChildAt(PRUint32 aIndex);
   virtual PRUint32 ChildCount() const;
 
-  // nsXULTreeItemAccessibleBase
+  // XULTreeItemAccessibleBase
   virtual Accessible* GetCellAccessible(nsITreeColumn* aColumn);
   virtual void RowInvalidated(PRInt32 aStartColIdx, PRInt32 aEndColIdx);
 
 protected:
 
   // Accessible
   virtual void CacheChildren();
 
-  // nsXULTreeItemAccessibleBase
+  // XULTreeItemAccessibleBase
   AccessibleHashtable mAccessibleCache;
 };
 
 
 /**
  * Represents an accessible for XUL tree cell in the case when XUL tree has
  * multiple columns.
  */
 
-#define NS_XULTREEGRIDCELLACCESSIBLE_IMPL_CID         \
+#define XULTREEGRIDCELLACCESSIBLE_IMPL_CID            \
 {  /* 84588ad4-549c-4196-a932-4c5ca5de5dff */         \
   0x84588ad4,                                         \
   0x549c,                                             \
   0x4196,                                             \
   { 0xa9, 0x32, 0x4c, 0x5c, 0xa5, 0xde, 0x5d, 0xff }  \
 }
 
-class nsXULTreeGridCellAccessible : public mozilla::a11y::LeafAccessible,
-                                    public nsIAccessibleTableCell
+class XULTreeGridCellAccessible : public LeafAccessible,
+                                  public nsIAccessibleTableCell
 {
 public:
 
-  nsXULTreeGridCellAccessible(nsIContent* aContent, DocAccessible* aDoc,
-                              nsXULTreeGridRowAccessible* aRowAcc,
-                              nsITreeBoxObject* aTree, nsITreeView* aTreeView,
-                              PRInt32 aRow, nsITreeColumn* aColumn);
+  XULTreeGridCellAccessible(nsIContent* aContent, DocAccessible* aDoc,
+                            XULTreeGridRowAccessible* aRowAcc,
+                            nsITreeBoxObject* aTree, nsITreeView* aTreeView,
+                            PRInt32 aRow, nsITreeColumn* aColumn);
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
-  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsXULTreeGridCellAccessible,
+  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(XULTreeGridCellAccessible,
                                            LeafAccessible)
 
   // nsIAccessible
 
   NS_IMETHOD GetBounds(PRInt32* aX, PRInt32* aY,
                        PRInt32* aWidth, PRInt32* aHeight);
 
   NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
@@ -130,30 +133,30 @@ public:
   // nsIAccessibleTableCell
   NS_DECL_NSIACCESSIBLETABLECELL
 
   // nsAccessNode
   virtual bool Init();
   virtual bool IsPrimaryForNode() const;
 
   // Accessible
-  virtual mozilla::a11y::ENameValueFlag Name(nsString& aName);
+  virtual ENameValueFlag Name(nsString& aName);
   virtual Accessible* FocusedChild();
   virtual nsresult GetAttributesInternal(nsIPersistentProperties* aAttributes);
   virtual PRInt32 IndexInParent() const;
   virtual Relation RelationByType(PRUint32 aType);
-  virtual mozilla::a11y::role NativeRole();
+  virtual a11y::role NativeRole();
   virtual PRUint64 NativeState();
   virtual PRUint64 NativeInteractiveState() const;
 
   // ActionAccessible
   virtual PRUint8 ActionCount();
 
-  // nsXULTreeGridCellAccessible
-  NS_DECLARE_STATIC_IID_ACCESSOR(NS_XULTREEGRIDCELLACCESSIBLE_IMPL_CID)
+  // XULTreeGridCellAccessible
+  NS_DECLARE_STATIC_IID_ACCESSOR(XULTREEGRIDCELLACCESSIBLE_IMPL_CID)
 
   /**
    * Return index of the column.
    */
   PRInt32 GetColumnIndex() const;
 
   /**
    * Fire name or state change event if the accessible text or value has been
@@ -162,17 +165,17 @@ public:
   void CellInvalidated();
 
 protected:
   // Accessible
   virtual Accessible* GetSiblingAtOffset(PRInt32 aOffset,
                                          nsresult* aError = nsnull) const;
   virtual void DispatchClickEvent(nsIContent* aContent, PRUint32 aActionIndex);
 
-  // nsXULTreeGridCellAccessible
+  // XULTreeGridCellAccessible
 
   /**
    * Return true if value of cell can be modified.
    */
   bool IsEditable() const;
 
   enum { eAction_Click = 0 };
 
@@ -180,12 +183,15 @@ protected:
   nsITreeView* mTreeView;
 
   PRInt32 mRow;
   nsCOMPtr<nsITreeColumn> mColumn;
 
   nsString mCachedTextEquiv;
 };
 
-NS_DEFINE_STATIC_IID_ACCESSOR(nsXULTreeGridCellAccessible,
-                              NS_XULTREEGRIDCELLACCESSIBLE_IMPL_CID)
+NS_DEFINE_STATIC_IID_ACCESSOR(XULTreeGridCellAccessible,
+                              XULTREEGRIDCELLACCESSIBLE_IMPL_CID)
+
+} // namespace a11y
+} // namespace mozilla
 
 #endif