Bug 762755 - de-ns-ify nsXULMenuAccessible and nsXULListboxAccessible classes, r=surkov
authorMark Capella <markcapella@twcny.rr.com>
Sat, 09 Jun 2012 04:21:07 -0400
changeset 96589 8ca3fe2207098e67385c41bd728a9abe086c648e
parent 96588 e6dedc30b9c38bf2f1c397ba921205fac2665af9
child 96590 38dfc0d628b41c84e7b6bf09f7160ab18e8ea8ec
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
reviewerssurkov
bugs762755
milestone16.0a1
Bug 762755 - de-ns-ify nsXULMenuAccessible and nsXULListboxAccessible classes, r=surkov
accessible/src/atk/XULListboxAccessibleWrap.h
accessible/src/atk/XULMenuAccessibleWrap.h
accessible/src/atk/nsXULListboxAccessibleWrap.h
accessible/src/atk/nsXULMenuAccessibleWrap.h
accessible/src/base/nsAccessibilityService.cpp
accessible/src/generic/RootAccessible.cpp
accessible/src/mac/XULListboxAccessibleWrap.h
accessible/src/mac/XULMenuAccessibleWrap.h
accessible/src/mac/nsXULListboxAccessibleWrap.h
accessible/src/mac/nsXULMenuAccessibleWrap.h
accessible/src/msaa/Makefile.in
accessible/src/msaa/XULListboxAccessibleWrap.cpp
accessible/src/msaa/XULListboxAccessibleWrap.h
accessible/src/msaa/XULMenuAccessibleWrap.cpp
accessible/src/msaa/XULMenuAccessibleWrap.h
accessible/src/msaa/nsXULListboxAccessibleWrap.cpp
accessible/src/msaa/nsXULListboxAccessibleWrap.h
accessible/src/msaa/nsXULMenuAccessibleWrap.cpp
accessible/src/msaa/nsXULMenuAccessibleWrap.h
accessible/src/other/XULListboxAccessibleWrap.h
accessible/src/other/XULMenuAccessibleWrap.h
accessible/src/other/nsXULListboxAccessibleWrap.h
accessible/src/other/nsXULMenuAccessibleWrap.h
accessible/src/xul/Makefile.in
accessible/src/xul/XULFormControlAccessible.cpp
accessible/src/xul/XULListboxAccessible.cpp
accessible/src/xul/XULListboxAccessible.h
accessible/src/xul/XULMenuAccessible.cpp
accessible/src/xul/XULMenuAccessible.h
accessible/src/xul/XULTreeAccessible.cpp
accessible/src/xul/XULTreeAccessible.h
accessible/src/xul/nsXULComboboxAccessible.h
accessible/src/xul/nsXULListboxAccessible.cpp
accessible/src/xul/nsXULListboxAccessible.h
accessible/src/xul/nsXULMenuAccessible.cpp
accessible/src/xul/nsXULMenuAccessible.h
accessible/src/xul/nsXULTabAccessible.h
rename from accessible/src/atk/nsXULListboxAccessibleWrap.h
rename to accessible/src/atk/XULListboxAccessibleWrap.h
--- a/accessible/src/atk/nsXULListboxAccessibleWrap.h
+++ b/accessible/src/atk/XULListboxAccessibleWrap.h
@@ -1,15 +1,21 @@
 /* -*- 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 __nsXULListboxAccessibleWrap_h__
-#define __nsXULListboxAccessibleWrap_h__
+#ifndef mozilla_a11y_XULListboxAccessibleWrap_h__
+#define mozilla_a11y_XULListboxAccessibleWrap_h__
+
+#include "XULListboxAccessible.h"
 
-#include "nsXULListboxAccessible.h"
+namespace mozilla {
+namespace a11y {
 
-typedef class nsXULListboxAccessible nsXULListboxAccessibleWrap;
-typedef class nsXULListCellAccessible nsXULListCellAccessibleWrap;
+typedef class XULListboxAccessible XULListboxAccessibleWrap;
+typedef class XULListCellAccessible XULListCellAccessibleWrap;
+
+} // namespace a11y
+} // namespace mozilla
 
 #endif
rename from accessible/src/atk/nsXULMenuAccessibleWrap.h
rename to accessible/src/atk/XULMenuAccessibleWrap.h
--- a/accessible/src/atk/nsXULMenuAccessibleWrap.h
+++ b/accessible/src/atk/XULMenuAccessibleWrap.h
@@ -1,14 +1,20 @@
 /* -*- 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 __nsXULMenuAccessibleWrap_h__
-#define __nsXULMenuAccessibleWrap_h__
+#ifndef mozilla_a11y_XULMenuAccessibleWrap_h__
+#define mozilla_a11y_XULMenuAccessibleWrap_h__
+
+#include "XULMenuAccessible.h"
 
-#include "nsXULMenuAccessible.h"
+namespace mozilla {
+namespace a11y {
 
-typedef class nsXULMenuitemAccessible nsXULMenuitemAccessibleWrap;
+typedef class XULMenuitemAccessible XULMenuitemAccessibleWrap;
+
+} // namespace a11y
+} // namespace mozilla
 
 #endif
--- a/accessible/src/base/nsAccessibilityService.cpp
+++ b/accessible/src/base/nsAccessibilityService.cpp
@@ -65,22 +65,22 @@
 #include "mozilla/dom/Element.h"
 #include "mozilla/Services.h"
 #include "mozilla/Util.h"
 
 #ifdef MOZ_XUL
 #include "nsXULAlertAccessible.h"
 #include "nsXULColorPickerAccessible.h"
 #include "nsXULComboboxAccessible.h"
-#include "XULFormControlAccessible.h"
-#include "nsXULListboxAccessibleWrap.h"
-#include "nsXULMenuAccessibleWrap.h"
 #include "nsXULSliderAccessible.h"
 #include "nsXULTabAccessible.h"
 #include "XULElementAccessibles.h"
+#include "XULFormControlAccessible.h"
+#include "XULListboxAccessibleWrap.h"
+#include "XULMenuAccessibleWrap.h"
 #include "XULTreeGridAccessibleWrap.h"
 #endif
 
 using namespace mozilla;
 using namespace mozilla::a11y;
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsAccessibilityService
@@ -1355,62 +1355,62 @@ nsAccessibilityService::CreateAccessible
       break;
 
     }
     case nsIAccessibleProvider::XULLink:
       accessible = new XULLinkAccessible(aContent, aDoc);
       break;
 
     case nsIAccessibleProvider::XULListbox:
-      accessible = new nsXULListboxAccessibleWrap(aContent, aDoc);
+      accessible = new XULListboxAccessibleWrap(aContent, aDoc);
       break;
 
     case nsIAccessibleProvider::XULListCell:
-      accessible = new nsXULListCellAccessibleWrap(aContent, aDoc);
+      accessible = new XULListCellAccessibleWrap(aContent, aDoc);
       break;
 
     case nsIAccessibleProvider::XULListHead:
-      accessible = new nsXULColumAccessible(aContent, aDoc);
+      accessible = new XULColumAccessible(aContent, aDoc);
       break;
 
     case nsIAccessibleProvider::XULListHeader:
-      accessible = new nsXULColumnItemAccessible(aContent, aDoc);
+      accessible = new XULColumnItemAccessible(aContent, aDoc);
       break;
 
     case nsIAccessibleProvider::XULListitem:
-      accessible = new nsXULListitemAccessible(aContent, aDoc);
+      accessible = new XULListitemAccessible(aContent, aDoc);
       break;
 
     case nsIAccessibleProvider::XULMenubar:
-      accessible = new nsXULMenubarAccessible(aContent, aDoc);
+      accessible = new XULMenubarAccessible(aContent, aDoc);
       break;
 
     case nsIAccessibleProvider::XULMenuitem:
-      accessible = new nsXULMenuitemAccessibleWrap(aContent, aDoc);
+      accessible = new XULMenuitemAccessibleWrap(aContent, aDoc);
       break;
 
     case nsIAccessibleProvider::XULMenupopup:
     {
 #ifdef MOZ_ACCESSIBILITY_ATK
       // ATK considers this node to be redundant when within menubars, and it makes menu
       // navigation with assistive technologies more difficult
       // XXX In the future we will should this for consistency across the nsIAccessible
       // implementations on each platform for a consistent scripting environment, but
       // then strip out redundant accessibles in the AccessibleWrap class for each platform.
       nsIContent *parent = aContent->GetParent();
       if (parent && parent->NodeInfo()->Equals(nsGkAtoms::menu,
                                                kNameSpaceID_XUL))
         return nsnull;
 #endif
-      accessible = new nsXULMenupopupAccessible(aContent, aDoc);
+      accessible = new XULMenupopupAccessible(aContent, aDoc);
       break;
 
     }
     case nsIAccessibleProvider::XULMenuSeparator:
-      accessible = new nsXULMenuSeparatorAccessible(aContent, aDoc);
+      accessible = new XULMenuSeparatorAccessible(aContent, aDoc);
       break;
 
     case nsIAccessibleProvider::XULPane:
       accessible = new EnumRoleAccessible(aContent, aDoc, roles::PANE);
       break;
 
     case nsIAccessibleProvider::XULProgressMeter:
       accessible = new XULProgressMeterAccessible(aContent, aDoc);
@@ -1459,17 +1459,17 @@ nsAccessibilityService::CreateAccessible
     case nsIAccessibleProvider::XULTree:
       return CreateAccessibleForXULTree(aContent, aDoc);
 
     case nsIAccessibleProvider::XULTreeColumns:
       accessible = new XULTreeColumAccessible(aContent, aDoc);
       break;
 
     case nsIAccessibleProvider::XULTreeColumnItem:
-      accessible = new nsXULColumnItemAccessible(aContent, aDoc);
+      accessible = new XULColumnItemAccessible(aContent, aDoc);
       break;
 
     case nsIAccessibleProvider::XULToolbar:
       accessible = new XULToolbarAccessible(aContent, aDoc);
       break;
 
     case nsIAccessibleProvider::XULToolbarSeparator:
       accessible = new XULToolbarSeparatorAccessible(aContent, aDoc);
--- a/accessible/src/generic/RootAccessible.cpp
+++ b/accessible/src/generic/RootAccessible.cpp
@@ -340,17 +340,17 @@ RootAccessible::ProcessDOMEvent(nsIDOMEv
   }
 #endif
 
   if (eventType.EqualsLiteral("RadioStateChange")) {
     PRUint64 state = accessible->State();
 
     // radiogroup in prefWindow is exposed as a list,
     // and panebutton is exposed as XULListitem in A11y.
-    // nsXULListitemAccessible::GetStateInternal uses STATE_SELECTED in this case,
+    // XULListitemAccessible::GetStateInternal uses STATE_SELECTED in this case,
     // so we need to check states::SELECTED also.
     bool isEnabled = (state & (states::CHECKED | states::SELECTED)) != 0;
 
     nsRefPtr<AccEvent> accEvent =
       new AccStateChangeEvent(accessible, states::CHECKED, isEnabled);
     nsEventShell::FireEvent(accEvent);
 
     if (isEnabled) {
rename from accessible/src/mac/nsXULListboxAccessibleWrap.h
rename to accessible/src/mac/XULListboxAccessibleWrap.h
--- a/accessible/src/mac/nsXULListboxAccessibleWrap.h
+++ b/accessible/src/mac/XULListboxAccessibleWrap.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 __nsXULListboxAccessibleWrap_h__
-#define __nsXULListboxAccessibleWrap_h__
+#ifndef mozilla_a11y_XULListboxAccessibleWrap_h__
+#define mozilla_a11y_XULListboxAccessibleWrap_h__
+
+#include "XULListboxAccessible.h"
 
-#include "nsXULListboxAccessible.h"
+namespace mozilla {
+namespace a11y {
 
-typedef class nsXULListboxAccessible nsXULListboxAccessibleWrap;
-typedef class nsXULListCellAccessible nsXULListCellAccessibleWrap;
+typedef class XULListboxAccessible XULListboxAccessibleWrap;
+typedef class XULListCellAccessible XULListCellAccessibleWrap;
+
+} // namespace a11y
+} // namespace mozilla
 
 #endif
rename from accessible/src/mac/nsXULMenuAccessibleWrap.h
rename to accessible/src/mac/XULMenuAccessibleWrap.h
--- a/accessible/src/mac/nsXULMenuAccessibleWrap.h
+++ b/accessible/src/mac/XULMenuAccessibleWrap.h
@@ -1,13 +1,19 @@
 /* -*- 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 __nsXULMenuAccessibleWrap_h__
-#define __nsXULMenuAccessibleWrap_h__
+#ifndef mozilla_a11y_XULMenuAccessibleWrap_h__
+#define mozilla_a11y_XULMenuAccessibleWrap_h__
+
+#include "XULMenuAccessible.h"
 
-#include "nsXULMenuAccessible.h"
+namespace mozilla {
+namespace a11y {
 
-typedef class nsXULMenuitemAccessible nsXULMenuitemAccessibleWrap;
+typedef class XULMenuitemAccessible XULMenuitemAccessibleWrap;
+
+} // namespace a11y
+} // namespace mozilla
 
 #endif
--- a/accessible/src/msaa/Makefile.in
+++ b/accessible/src/msaa/Makefile.in
@@ -20,18 +20,16 @@ CPPSRCS = \
   ApplicationAccessibleWrap.cpp \
   ARIAGridAccessibleWrap.cpp \
   DocAccessibleWrap.cpp \
   HTMLTableAccessibleWrap.cpp \
   HyperTextAccessibleWrap.cpp \
   ImageAccessibleWrap.cpp \
   nsAccessNodeWrap.cpp \
   nsHTMLWin32ObjectAccessible.cpp \
-  nsXULMenuAccessibleWrap.cpp \
-  nsXULListboxAccessibleWrap.cpp \
   nsWinUtils.cpp \
   CAccessibleText.cpp \
   CAccessibleEditableText.cpp \
   CAccessibleHyperlink.cpp \
   CAccessibleTable.cpp \
   CAccessibleTableCell.cpp \
   CAccessibleValue.cpp \
   Compatibility.cpp \
@@ -42,16 +40,18 @@ CPPSRCS = \
   ia2AccessibleHypertext.cpp \
   ia2AccessibleRelation.cpp \
   RootAccessibleWrap.cpp \
   TextLeafAccessibleWrap.cpp \
   $(NULL)
 
 ifdef MOZ_XUL
 CPPSRCS += \
+  XULListboxAccessibleWrap.cpp \
+  XULMenuAccessibleWrap.cpp \
   XULTreeGridAccessibleWrap.cpp \
   $(NULL)
 endif
 
 EXPORTS = \
   nsAccessNodeWrap.h \
   $(NULL)
 
rename from accessible/src/msaa/nsXULListboxAccessibleWrap.cpp
rename to accessible/src/msaa/XULListboxAccessibleWrap.cpp
--- a/accessible/src/msaa/nsXULListboxAccessibleWrap.cpp
+++ b/accessible/src/msaa/XULListboxAccessibleWrap.cpp
@@ -1,42 +1,44 @@
 /* -*- 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 "nsXULListboxAccessibleWrap.h"
+#include "XULListboxAccessibleWrap.h"
+
+using namespace mozilla::a11y;
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsXULListboxAccessibleWrap
+// XULListboxAccessibleWrap
 ////////////////////////////////////////////////////////////////////////////////
 
-nsXULListboxAccessibleWrap::
-  nsXULListboxAccessibleWrap(nsIContent* aContent, DocAccessible* aDoc) :
-  nsXULListboxAccessible(aContent, aDoc)
+XULListboxAccessibleWrap::
+  XULListboxAccessibleWrap(nsIContent* aContent, DocAccessible* aDoc) :
+  XULListboxAccessible(aContent, aDoc)
 {
 }
 
-NS_IMPL_ISUPPORTS_INHERITED0(nsXULListboxAccessibleWrap,
-                             nsXULListboxAccessible)
+NS_IMPL_ISUPPORTS_INHERITED0(XULListboxAccessibleWrap,
+                             XULListboxAccessible)
 
-IMPL_IUNKNOWN_QUERY_HEAD(nsXULListboxAccessibleWrap)
+IMPL_IUNKNOWN_QUERY_HEAD(XULListboxAccessibleWrap)
 IMPL_IUNKNOWN_QUERY_ENTRY_COND(CAccessibleTable, IsMulticolumn());
 IMPL_IUNKNOWN_QUERY_ENTRY(AccessibleWrap)
 IMPL_IUNKNOWN_QUERY_TAIL
 
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsXULListCellAccessibleWrap
+// XULListCellAccessibleWrap
 ////////////////////////////////////////////////////////////////////////////////
 
-nsXULListCellAccessibleWrap::
-  nsXULListCellAccessibleWrap(nsIContent* aContent, DocAccessible* aDoc) :
-  nsXULListCellAccessible(aContent, aDoc)
+XULListCellAccessibleWrap::
+  XULListCellAccessibleWrap(nsIContent* aContent, DocAccessible* aDoc) :
+  XULListCellAccessible(aContent, aDoc)
 {
 }
 
-NS_IMPL_ISUPPORTS_INHERITED0(nsXULListCellAccessibleWrap,
-                             nsXULListCellAccessible)
+NS_IMPL_ISUPPORTS_INHERITED0(XULListCellAccessibleWrap,
+                             XULListCellAccessible)
 
-IMPL_IUNKNOWN_INHERITED1(nsXULListCellAccessibleWrap,
+IMPL_IUNKNOWN_INHERITED1(XULListCellAccessibleWrap,
                          HyperTextAccessibleWrap,
                          CAccessibleTableCell)
rename from accessible/src/msaa/nsXULListboxAccessibleWrap.h
rename to accessible/src/msaa/XULListboxAccessibleWrap.h
--- a/accessible/src/msaa/nsXULListboxAccessibleWrap.h
+++ b/accessible/src/msaa/XULListboxAccessibleWrap.h
@@ -1,48 +1,54 @@
 /* -*- 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 __nsXULListboxAccessibleWrap_h__
-#define __nsXULListboxAccessibleWrap_h__
+#ifndef mozilla_a11y_XULListboxAccessibleWrap_h__
+#define mozilla_a11y_XULListboxAccessibleWrap_h__
 
-#include "nsXULListboxAccessible.h"
+#include "XULListboxAccessible.h"
 
 #include "CAccessibleTable.h"
 #include "CAccessibleTableCell.h"
 
+namespace mozilla {
+namespace a11y {
+
 /**
- * IA2 wrapper class for nsXULListboxAccessible class implementing
+ * IA2 wrapper class for XULListboxAccessible class implementing
  * IAccessibleTable and IAccessibleTable2 interfaces.
  */
-class nsXULListboxAccessibleWrap : public nsXULListboxAccessible,
-                                   public CAccessibleTable
+class XULListboxAccessibleWrap : public XULListboxAccessible,
+                                 public CAccessibleTable
 {
 public:
-  nsXULListboxAccessibleWrap(nsIContent* aContent, DocAccessible* aDoc);
+  XULListboxAccessibleWrap(nsIContent* aContent, DocAccessible* aDoc);
 
   // IUnknown
   DECL_IUNKNOWN_INHERITED
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 };
 
 /**
- * IA2 wrapper class for nsXULListCellAccessible class, implements
+ * IA2 wrapper class for XULListCellAccessible class, implements
  * IAccessibleTableCell interface.
  */
-class nsXULListCellAccessibleWrap : public nsXULListCellAccessible,
-                                    public CAccessibleTableCell
+class XULListCellAccessibleWrap : public XULListCellAccessible,
+                                  public CAccessibleTableCell
 {
 public:
-  nsXULListCellAccessibleWrap(nsIContent* aContent, DocAccessible* aDoc);
+  XULListCellAccessibleWrap(nsIContent* aContent, DocAccessible* aDoc);
 
   // IUnknown
   DECL_IUNKNOWN_INHERITED
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 };
 
+} // namespace a11y
+} // namespace mozilla
+
 #endif
rename from accessible/src/msaa/nsXULMenuAccessibleWrap.cpp
rename to accessible/src/msaa/XULMenuAccessibleWrap.cpp
--- a/accessible/src/msaa/nsXULMenuAccessibleWrap.cpp
+++ b/accessible/src/msaa/XULMenuAccessibleWrap.cpp
@@ -1,34 +1,34 @@
 /* -*- 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 "nsXULMenuAccessibleWrap.h"
+#include "XULMenuAccessibleWrap.h"
 #include "nsINameSpaceManager.h"
 
 using namespace mozilla::a11y;
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsXULMenuAccessibleWrap
+// XULMenuAccessibleWrap
 ////////////////////////////////////////////////////////////////////////////////
 
-nsXULMenuitemAccessibleWrap::
-  nsXULMenuitemAccessibleWrap(nsIContent* aContent, DocAccessible* aDoc) :
-  nsXULMenuitemAccessible(aContent, aDoc)
+XULMenuitemAccessibleWrap::
+  XULMenuitemAccessibleWrap(nsIContent* aContent, DocAccessible* aDoc) :
+  XULMenuitemAccessible(aContent, aDoc)
 {
 }
 
 ENameValueFlag
-nsXULMenuitemAccessibleWrap::Name(nsString& aName)
+XULMenuitemAccessibleWrap::Name(nsString& aName)
 {
   // XXX This should be done in get_accName() so that nsIAccessible::GetName()]
   // provides the same results on all platforms
-  nsXULMenuitemAccessible::Name(aName);
+  XULMenuitemAccessible::Name(aName);
   if (aName.IsEmpty())
     return eNameOK;
   
   nsAutoString accel;
   mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::acceltext, accel);
   if (!accel.IsEmpty())
     aName += NS_LITERAL_STRING("\t") + accel;
 
rename from accessible/src/msaa/nsXULMenuAccessibleWrap.h
rename to accessible/src/msaa/XULMenuAccessibleWrap.h
--- a/accessible/src/msaa/nsXULMenuAccessibleWrap.h
+++ b/accessible/src/msaa/XULMenuAccessibleWrap.h
@@ -1,21 +1,27 @@
 /* -*- 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 __nsXULMenuAccessibleWrap_h__
-#define __nsXULMenuAccessibleWrap_h__
+#ifndef mozilla_a11y_XULMenuAccessibleWrap_h__
+#define mozilla_a11y_XULMenuAccessibleWrap_h__
+
+#include "XULMenuAccessible.h"
 
-#include "nsXULMenuAccessible.h"
+namespace mozilla {
+namespace a11y {
 
-class nsXULMenuitemAccessibleWrap : public nsXULMenuitemAccessible
+class XULMenuitemAccessibleWrap : public XULMenuitemAccessible
 {
 public:
-  nsXULMenuitemAccessibleWrap(nsIContent* aContent, DocAccessible* aDoc);
-  virtual ~nsXULMenuitemAccessibleWrap() {}
+  XULMenuitemAccessibleWrap(nsIContent* aContent, DocAccessible* aDoc);
+  virtual ~XULMenuitemAccessibleWrap() {}
 
   // nsIAccessible
   virtual mozilla::a11y::ENameValueFlag Name(nsString& aName);
 };
 
+} // namespace a11y
+} // namespace mozilla
+
 #endif
new file mode 100644
--- /dev/null
+++ b/accessible/src/other/XULListboxAccessibleWrap.h
@@ -0,0 +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 mozilla_a11y_XULListboxAccessibleWrap_h__
+#define mozilla_a11y_XULListboxAccessibleWrap_h__
+
+#include "XULListboxAccessible.h"
+
+namespace mozilla {
+namespace a11y {
+
+typedef class XULListboxAccessible XULListboxAccessibleWrap;
+typedef class XULListCellAccessible XULListCellAccessibleWrap;
+
+} // namespace a11y
+} // namespace mozilla
+
+#endif
rename from accessible/src/other/nsXULMenuAccessibleWrap.h
rename to accessible/src/other/XULMenuAccessibleWrap.h
--- a/accessible/src/other/nsXULMenuAccessibleWrap.h
+++ b/accessible/src/other/XULMenuAccessibleWrap.h
@@ -1,13 +1,19 @@
 /* -*- 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 __nsXULMenuAccessibleWrap_h__
-#define __nsXULMenuAccessibleWrap_h__
+#ifndef mozilla_a11y_XULMenuAccessibleWrap_h__
+#define mozilla_a11y_XULMenuAccessibleWrap_h__
+
+#include "XULMenuAccessible.h"
 
-#include "nsXULMenuAccessible.h"
+namespace mozilla {
+namespace a11y {
 
-typedef class nsXULMenuitemAccessible nsXULMenuitemAccessibleWrap;
+typedef class XULMenuitemAccessible XULMenuitemAccessibleWrap;
+
+} // namespace a11y
+} // namespace mozilla
 
 #endif
deleted file mode 100644
--- a/accessible/src/other/nsXULListboxAccessibleWrap.h
+++ /dev/null
@@ -1,14 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef __nsXULListboxAccessibleWrap_h__
-#define __nsXULListboxAccessibleWrap_h__
-
-#include "nsXULListboxAccessible.h"
-
-typedef class nsXULListboxAccessible nsXULListboxAccessibleWrap;
-typedef class nsXULListCellAccessible nsXULListCellAccessibleWrap;
-
-#endif
--- a/accessible/src/xul/Makefile.in
+++ b/accessible/src/xul/Makefile.in
@@ -12,26 +12,26 @@ include $(DEPTH)/config/autoconf.mk
 
 MODULE = accessibility
 LIBRARY_NAME = accessibility_xul_s
 LIBXUL_LIBRARY = 1
 
 
 
 CPPSRCS = \
-  XULSelectControlAccessible.cpp \
   nsXULAlertAccessible.cpp \
   nsXULColorPickerAccessible.cpp \
   nsXULComboboxAccessible.cpp \
-  XULFormControlAccessible.cpp \
-  nsXULListboxAccessible.cpp \
-  nsXULMenuAccessible.cpp \
   nsXULSliderAccessible.cpp \
   nsXULTabAccessible.cpp \
   XULElementAccessibles.cpp \
+  XULFormControlAccessible.cpp \
+  XULListboxAccessible.cpp \
+  XULMenuAccessible.cpp \
+  XULSelectControlAccessible.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
--- a/accessible/src/xul/XULFormControlAccessible.cpp
+++ b/accessible/src/xul/XULFormControlAccessible.cpp
@@ -7,20 +7,20 @@
 
 #include "Accessible-inl.h"
 #include "HTMLFormControlAccessible.h"
 #include "nsAccUtils.h"
 #include "nsAccTreeWalker.h"
 #include "nsCoreUtils.h"
 #include "DocAccessible.h"
 #include "nsIAccessibleRelation.h"
-#include "nsXULMenuAccessible.h"
 #include "Relation.h"
 #include "Role.h"
 #include "States.h"
+#include "XULMenuAccessible.h"
 
 #include "nsIDOMHTMLInputElement.h"
 #include "nsIDOMNSEditableElement.h"
 #include "nsIDOMXULButtonElement.h"
 #include "nsIDOMXULCheckboxElement.h"
 #include "nsIDOMXULMenuListElement.h"
 #include "nsIDOMXULSelectCntrlItemEl.h"
 #include "nsIDOMXULTextboxElement.h"
new file mode 100644
--- /dev/null
+++ b/accessible/src/xul/XULListboxAccessible.cpp
@@ -0,0 +1,1177 @@
+/* -*- Mode: C++; tab-width: 4; 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 "XULListboxAccessible.h"
+
+#include "Accessible-inl.h"
+#include "nsAccessibilityService.h"
+#include "nsAccUtils.h"
+#include "DocAccessible.h"
+#include "Role.h"
+#include "States.h"
+
+#include "nsComponentManagerUtils.h"
+#include "nsIAutoCompleteInput.h"
+#include "nsIAutoCompletePopup.h"
+#include "nsIDOMXULMenuListElement.h"
+#include "nsIDOMXULMultSelectCntrlEl.h"
+#include "nsIDOMNodeList.h"
+#include "nsIDOMXULPopupElement.h"
+#include "nsIDOMXULSelectCntrlItemEl.h"
+
+using namespace mozilla::a11y;
+
+////////////////////////////////////////////////////////////////////////////////
+// XULColumAccessible
+////////////////////////////////////////////////////////////////////////////////
+
+XULColumAccessible::
+  XULColumAccessible(nsIContent* aContent, DocAccessible* aDoc) :
+  AccessibleWrap(aContent, aDoc)
+{
+}
+
+role
+XULColumAccessible::NativeRole()
+{
+  return roles::LIST;
+}
+
+PRUint64
+XULColumAccessible::NativeState()
+{
+  return states::READONLY;
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// XULColumnItemAccessible
+////////////////////////////////////////////////////////////////////////////////
+
+XULColumnItemAccessible::
+  XULColumnItemAccessible(nsIContent* aContent, DocAccessible* aDoc) :
+  LeafAccessible(aContent, aDoc)
+{
+}
+
+role
+XULColumnItemAccessible::NativeRole()
+{
+  return roles::COLUMNHEADER;
+}
+
+PRUint64
+XULColumnItemAccessible::NativeState()
+{
+  return states::READONLY;
+}
+
+PRUint8
+XULColumnItemAccessible::ActionCount()
+{
+  return 1;
+}
+
+NS_IMETHODIMP
+XULColumnItemAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
+{
+  if (aIndex != eAction_Click)
+    return NS_ERROR_INVALID_ARG;
+
+  aName.AssignLiteral("click");
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+XULColumnItemAccessible::DoAction(PRUint8 aIndex)
+{
+  if (aIndex != eAction_Click)
+    return NS_ERROR_INVALID_ARG;
+
+  DoCommand();
+  return NS_OK;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// XULListboxAccessible
+////////////////////////////////////////////////////////////////////////////////
+
+XULListboxAccessible::
+  XULListboxAccessible(nsIContent* aContent, DocAccessible* aDoc) :
+  XULSelectControlAccessible(aContent, aDoc), xpcAccessibleTable(this)
+{
+  nsIContent* parentContent = mContent->GetParent();
+  if (parentContent) {
+    nsCOMPtr<nsIAutoCompletePopup> autoCompletePopupElm =
+      do_QueryInterface(parentContent);
+    if (autoCompletePopupElm)
+      mFlags |= eAutoCompletePopupAccessible;
+  }
+}
+
+NS_IMPL_ADDREF_INHERITED(XULListboxAccessible, XULSelectControlAccessible)
+NS_IMPL_RELEASE_INHERITED(XULListboxAccessible, XULSelectControlAccessible)
+
+nsresult
+XULListboxAccessible::QueryInterface(REFNSIID aIID, void** aInstancePtr)
+{
+  nsresult rv = XULSelectControlAccessible::QueryInterface(aIID, aInstancePtr);
+  if (*aInstancePtr)
+    return rv;
+
+  if (aIID.Equals(NS_GET_IID(nsIAccessibleTable)) && IsMulticolumn()) {
+    *aInstancePtr = static_cast<nsIAccessibleTable*>(this);
+    NS_ADDREF_THIS();
+    return NS_OK;
+  }
+
+  return NS_ERROR_NO_INTERFACE;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+//nsAccessNode
+
+void
+XULListboxAccessible::Shutdown()
+{
+  mTable = nsnull;
+  XULSelectControlAccessible::Shutdown();
+}
+
+bool
+XULListboxAccessible::IsMulticolumn()
+{
+  PRInt32 numColumns = 0;
+  nsresult rv = GetColumnCount(&numColumns);
+  if (NS_FAILED(rv))
+    return false;
+
+  return numColumns > 1;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// XULListboxAccessible. nsIAccessible
+
+PRUint64
+XULListboxAccessible::NativeState()
+{
+  // As a XULListboxAccessible we can have the following states:
+  //   FOCUSED, READONLY, FOCUSABLE
+
+  // Get focus status from base class
+  PRUint64 states = Accessible::NativeState();
+
+  // see if we are multiple select if so set ourselves as such
+
+  if (mContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::seltype,
+                            nsGkAtoms::multiple, eCaseMatters)) {
+      states |= states::MULTISELECTABLE | states::EXTSELECTABLE;
+  }
+
+  return states;
+}
+
+/**
+  * Our value is the label of our ( first ) selected child.
+  */
+void
+XULListboxAccessible::Value(nsString& aValue)
+{
+  aValue.Truncate();
+
+  nsCOMPtr<nsIDOMXULSelectControlElement> select(do_QueryInterface(mContent));
+  if (select) {
+    nsCOMPtr<nsIDOMXULSelectControlItemElement> selectedItem;
+    select->GetSelectedItem(getter_AddRefs(selectedItem));
+    if (selectedItem)
+      selectedItem->GetLabel(aValue);
+  }
+}
+
+role
+XULListboxAccessible::NativeRole()
+{
+  // A richlistbox is used with the new autocomplete URL bar, and has a parent
+  // popup <panel>.
+  nsCOMPtr<nsIDOMXULPopupElement> xulPopup =
+    do_QueryInterface(mContent->GetParent());
+  if (xulPopup)
+    return roles::COMBOBOX_LIST;
+
+  return IsMulticolumn() ? roles::TABLE : roles::LISTBOX;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// XULListboxAccessible. nsIAccessibleTable
+
+PRUint32
+XULListboxAccessible::ColCount()
+{
+  nsIContent* headContent = nsnull;
+  for (nsIContent* childContent = mContent->GetFirstChild(); childContent;
+       childContent = childContent->GetNextSibling()) {
+    if (childContent->NodeInfo()->Equals(nsGkAtoms::listcols,
+                                         kNameSpaceID_XUL)) {
+      headContent = childContent;
+    }
+  }
+  if (!headContent)
+    return 0;
+
+  PRUint32 columnCount = 0;
+  for (nsIContent* childContent = headContent->GetFirstChild(); childContent;
+       childContent = childContent->GetNextSibling()) {
+    if (childContent->NodeInfo()->Equals(nsGkAtoms::listcol,
+                                         kNameSpaceID_XUL)) {
+      columnCount++;
+    }
+  }
+
+  return columnCount;
+}
+
+PRUint32
+XULListboxAccessible::RowCount()
+{
+  nsCOMPtr<nsIDOMXULSelectControlElement> element(do_QueryInterface(mContent));
+
+  PRUint32 itemCount = 0;
+  if(element)
+    element->GetItemCount(&itemCount);
+
+  return itemCount;
+}
+
+Accessible*
+XULListboxAccessible::CellAt(PRUint32 aRowIndex, PRUint32 aColumnIndex)
+{ 
+  nsCOMPtr<nsIDOMXULSelectControlElement> control =
+    do_QueryInterface(mContent);
+  NS_ENSURE_TRUE(control, nsnull);
+
+  nsCOMPtr<nsIDOMXULSelectControlItemElement> item;
+  control->GetItemAtIndex(aRowIndex, getter_AddRefs(item));
+  if (!item)
+    return nsnull;
+
+  nsCOMPtr<nsIContent> itemContent(do_QueryInterface(item));
+  if (!itemContent)
+    return nsnull;
+
+  Accessible* row = mDoc->GetAccessible(itemContent);
+  NS_ENSURE_TRUE(row, nsnull);
+
+  return row->GetChildAt(aColumnIndex);
+}
+
+NS_IMETHODIMP
+XULListboxAccessible::GetColumnIndexAt(PRInt32 aIndex, PRInt32* aColumn)
+{
+  NS_ENSURE_ARG_POINTER(aColumn);
+  *aColumn = -1;
+
+  PRInt32 columnCount = 0;
+  nsresult rv = GetColumnCount(&columnCount);
+  NS_ENSURE_SUCCESS(rv, rv);
+
+  *aColumn = aIndex % columnCount;
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+XULListboxAccessible::GetRowIndexAt(PRInt32 aIndex, PRInt32* aRow)
+{
+  NS_ENSURE_ARG_POINTER(aRow);
+  *aRow = -1;
+
+  PRInt32 columnCount = 0;
+  nsresult rv = GetColumnCount(&columnCount);
+  NS_ENSURE_SUCCESS(rv, rv);
+
+  *aRow = aIndex / columnCount;
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+XULListboxAccessible::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;
+
+  PRInt32 columnCount = 0;
+  nsresult rv = GetColumnCount(&columnCount);
+  NS_ENSURE_SUCCESS(rv, rv);
+
+  *aColumnIndex = aCellIndex % columnCount;
+  *aRowIndex = aCellIndex / columnCount;
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+XULListboxAccessible::GetColumnDescription(PRInt32 aColumn,
+                                           nsAString& aDescription)
+{
+  aDescription.Truncate();
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+XULListboxAccessible::GetRowDescription(PRInt32 aRow, nsAString& aDescription)
+{
+  aDescription.Truncate();
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+XULListboxAccessible::IsColumnSelected(PRInt32 aColumn, bool* aIsSelected)
+{
+  NS_ENSURE_ARG_POINTER(aIsSelected);
+  *aIsSelected = false;
+
+  if (IsDefunct())
+    return NS_ERROR_FAILURE;
+
+  nsCOMPtr<nsIDOMXULMultiSelectControlElement> control =
+    do_QueryInterface(mContent);
+  NS_ASSERTION(control,
+               "Doesn't implement nsIDOMXULMultiSelectControlElement.");
+
+  PRInt32 selectedrowCount = 0;
+  nsresult rv = control->GetSelectedCount(&selectedrowCount);
+  NS_ENSURE_SUCCESS(rv, rv);
+
+  PRInt32 rowCount = 0;
+  rv = GetRowCount(&rowCount);
+  NS_ENSURE_SUCCESS(rv, rv);
+
+  *aIsSelected = (selectedrowCount == rowCount);
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+XULListboxAccessible::IsRowSelected(PRInt32 aRow, bool* aIsSelected)
+{
+  NS_ENSURE_ARG_POINTER(aIsSelected);
+  *aIsSelected = false;
+
+  if (IsDefunct())
+    return NS_ERROR_FAILURE;
+
+  nsCOMPtr<nsIDOMXULSelectControlElement> control =
+    do_QueryInterface(mContent);
+  NS_ASSERTION(control,
+               "Doesn't implement nsIDOMXULSelectControlElement.");
+
+  nsCOMPtr<nsIDOMXULSelectControlItemElement> item;
+  control->GetItemAtIndex(aRow, getter_AddRefs(item));
+  NS_ENSURE_TRUE(item, NS_ERROR_INVALID_ARG);
+
+  return item->GetSelected(aIsSelected);
+}
+
+NS_IMETHODIMP
+XULListboxAccessible::IsCellSelected(PRInt32 aRowIndex, PRInt32 aColumnIndex,
+                                     bool* aIsSelected)
+{
+  return IsRowSelected(aRowIndex, aIsSelected);
+}
+
+NS_IMETHODIMP
+XULListboxAccessible::GetSelectedCellCount(PRUint32* aCount)
+{
+  NS_ENSURE_ARG_POINTER(aCount);
+  *aCount = 0;
+
+  nsCOMPtr<nsIDOMXULMultiSelectControlElement> control =
+    do_QueryInterface(mContent);
+  NS_ASSERTION(control,
+               "Doesn't implement nsIDOMXULMultiSelectControlElement.");
+
+  nsCOMPtr<nsIDOMNodeList> selectedItems;
+  control->GetSelectedItems(getter_AddRefs(selectedItems));
+  if (!selectedItems)
+    return NS_OK;
+
+  PRUint32 selectedItemsCount = 0;
+  nsresult rv = selectedItems->GetLength(&selectedItemsCount);
+  NS_ENSURE_SUCCESS(rv, rv);
+
+  if (!selectedItemsCount)
+    return NS_OK;
+
+  PRInt32 columnCount = 0;
+  rv = GetColumnCount(&columnCount);
+  NS_ENSURE_SUCCESS(rv, rv);
+
+  *aCount = selectedItemsCount * columnCount;
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+XULListboxAccessible::GetSelectedColumnCount(PRUint32* aCount)
+{
+  NS_ENSURE_ARG_POINTER(aCount);
+  *aCount = 0;
+
+  if (IsDefunct())
+    return NS_ERROR_FAILURE;
+
+  nsCOMPtr<nsIDOMXULMultiSelectControlElement> control =
+    do_QueryInterface(mContent);
+  NS_ASSERTION(control,
+               "Doesn't implement nsIDOMXULMultiSelectControlElement.");
+
+  PRInt32 selectedrowCount = 0;
+  nsresult rv = control->GetSelectedCount(&selectedrowCount);
+  NS_ENSURE_SUCCESS(rv, rv);
+
+  PRInt32 rowCount = 0;
+  rv = GetRowCount(&rowCount);
+  NS_ENSURE_SUCCESS(rv, rv);
+
+  if (selectedrowCount != rowCount)
+    return NS_OK;
+
+  PRInt32 columnCount = 0;
+  rv = GetColumnCount(&columnCount);
+  NS_ENSURE_SUCCESS(rv, rv);
+
+  *aCount = columnCount;
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+XULListboxAccessible::GetSelectedRowCount(PRUint32* aCount)
+{
+  NS_ENSURE_ARG_POINTER(aCount);
+  *aCount = 0;
+
+  if (IsDefunct())
+    return NS_ERROR_FAILURE;
+
+  nsCOMPtr<nsIDOMXULMultiSelectControlElement> control =
+    do_QueryInterface(mContent);
+  NS_ASSERTION(control,
+               "Doesn't implement nsIDOMXULMultiSelectControlElement.");
+
+  PRInt32 selectedrowCount = 0;
+  nsresult rv = control->GetSelectedCount(&selectedrowCount);
+  NS_ENSURE_SUCCESS(rv, rv);
+
+  *aCount = selectedrowCount;
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+XULListboxAccessible::GetSelectedCells(nsIArray** aCells)
+{
+  NS_ENSURE_ARG_POINTER(aCells);
+  *aCells = nsnull;
+
+  if (IsDefunct())
+    return NS_ERROR_FAILURE;
+
+  nsresult rv = NS_OK;
+  nsCOMPtr<nsIMutableArray> selCells =
+    do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
+  NS_ENSURE_SUCCESS(rv, rv);
+
+  nsCOMPtr<nsIDOMXULMultiSelectControlElement> control =
+    do_QueryInterface(mContent);
+  NS_ASSERTION(control,
+               "Doesn't implement nsIDOMXULMultiSelectControlElement.");
+
+  nsCOMPtr<nsIDOMNodeList> selectedItems;
+  control->GetSelectedItems(getter_AddRefs(selectedItems));
+  if (!selectedItems)
+    return NS_OK;
+
+  PRUint32 selectedItemsCount = 0;
+  rv = selectedItems->GetLength(&selectedItemsCount);
+  NS_ENSURE_SUCCESS(rv, rv);
+
+  NS_ENSURE_TRUE(mDoc, NS_ERROR_FAILURE);
+  PRUint32 index = 0;
+  for (; index < selectedItemsCount; index++) {
+    nsCOMPtr<nsIDOMNode> itemNode;
+    selectedItems->Item(index, getter_AddRefs(itemNode));
+    nsCOMPtr<nsIContent> itemContent(do_QueryInterface(itemNode));
+    Accessible* item = mDoc->GetAccessible(itemContent);
+
+    if (item) {
+      PRUint32 cellCount = item->ChildCount();
+      for (PRUint32 cellIdx = 0; cellIdx < cellCount; cellIdx++) {
+        Accessible* cell = mChildren[cellIdx];
+        if (cell->Role() == roles::CELL)
+          selCells->AppendElement(static_cast<nsIAccessible*>(cell), false);
+      }
+    }
+  }
+
+  NS_ADDREF(*aCells = selCells);
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+XULListboxAccessible::GetSelectedCellIndices(PRUint32* aNumCells,
+                                             PRInt32** aCells)
+{
+  NS_ENSURE_ARG_POINTER(aNumCells);
+  *aNumCells = 0;
+  NS_ENSURE_ARG_POINTER(aCells);
+  *aCells = nsnull;
+
+  if (IsDefunct())
+    return NS_ERROR_FAILURE;
+
+  nsCOMPtr<nsIDOMXULMultiSelectControlElement> control =
+    do_QueryInterface(mContent);
+  NS_ASSERTION(control,
+               "Doesn't implement nsIDOMXULMultiSelectControlElement.");
+
+  nsCOMPtr<nsIDOMNodeList> selectedItems;
+  control->GetSelectedItems(getter_AddRefs(selectedItems));
+  if (!selectedItems)
+    return NS_OK;
+
+  PRUint32 selectedItemsCount = 0;
+  nsresult rv = selectedItems->GetLength(&selectedItemsCount);
+  NS_ENSURE_SUCCESS(rv, rv);
+
+  PRInt32 columnCount = 0;
+  rv = GetColumnCount(&columnCount);
+  NS_ENSURE_SUCCESS(rv, rv);
+
+  PRUint32 cellsCount = selectedItemsCount * columnCount;
+
+  PRInt32 *cellsIdxArray =
+    static_cast<PRInt32*>(nsMemory::Alloc((cellsCount) * sizeof(PRInt32)));
+  NS_ENSURE_TRUE(cellsIdxArray, NS_ERROR_OUT_OF_MEMORY);
+
+  PRUint32 index = 0, cellsIdx = 0;
+  for (; index < selectedItemsCount; index++) {
+    nsCOMPtr<nsIDOMNode> itemNode;
+    selectedItems->Item(index, getter_AddRefs(itemNode));
+    nsCOMPtr<nsIDOMXULSelectControlItemElement> item =
+      do_QueryInterface(itemNode);
+
+    if (item) {
+      PRInt32 itemIdx = -1;
+      control->GetIndexOfItem(item, &itemIdx);
+      if (itemIdx != -1) {
+        PRInt32 colIdx = 0;
+        for (; colIdx < columnCount; colIdx++)
+          cellsIdxArray[cellsIdx++] = itemIdx * columnCount + colIdx;
+      }
+    }
+  }
+
+  *aNumCells = cellsCount;
+  *aCells = cellsIdxArray;
+
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+XULListboxAccessible::GetSelectedColumnIndices(PRUint32* aNumColumns,
+                                               PRInt32** aColumns)
+{
+  NS_ENSURE_ARG_POINTER(aNumColumns);
+  *aNumColumns = 0;
+  NS_ENSURE_ARG_POINTER(aColumns);
+  *aColumns = nsnull;
+
+  if (IsDefunct())
+    return NS_ERROR_FAILURE;
+
+  PRUint32 columnCount = 0;
+  nsresult rv = GetSelectedColumnCount(&columnCount);
+  NS_ENSURE_SUCCESS(rv, rv);
+
+  if (!columnCount)
+    return NS_OK;
+
+  PRInt32 *colsIdxArray =
+    static_cast<PRInt32*>(nsMemory::Alloc((columnCount) * sizeof(PRInt32)));
+  NS_ENSURE_TRUE(colsIdxArray, NS_ERROR_OUT_OF_MEMORY);
+
+  PRUint32 colIdx = 0;
+  for (; colIdx < columnCount; colIdx++)
+    colsIdxArray[colIdx] = colIdx;
+
+  *aNumColumns = columnCount;
+  *aColumns = colsIdxArray;
+
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+XULListboxAccessible::GetSelectedRowIndices(PRUint32* aNumRows,
+                                            PRInt32** aRows)
+{
+  NS_ENSURE_ARG_POINTER(aNumRows);
+  *aNumRows = 0;
+  NS_ENSURE_ARG_POINTER(aRows);
+  *aRows = nsnull;
+
+  if (IsDefunct())
+    return NS_ERROR_FAILURE;
+
+  nsCOMPtr<nsIDOMXULMultiSelectControlElement> control =
+    do_QueryInterface(mContent);
+  NS_ASSERTION(control,
+               "Doesn't implement nsIDOMXULMultiSelectControlElement.");
+
+  nsCOMPtr<nsIDOMNodeList> selectedItems;
+  control->GetSelectedItems(getter_AddRefs(selectedItems));
+  if (!selectedItems)
+    return NS_OK;
+
+  PRUint32 selectedItemsCount = 0;
+  nsresult rv = selectedItems->GetLength(&selectedItemsCount);
+  NS_ENSURE_SUCCESS(rv, rv);
+
+  if (!selectedItemsCount)
+    return NS_OK;
+
+  PRInt32 *rowsIdxArray =
+    static_cast<PRInt32*>(nsMemory::Alloc((selectedItemsCount) * sizeof(PRInt32)));
+  NS_ENSURE_TRUE(rowsIdxArray, NS_ERROR_OUT_OF_MEMORY);
+
+  PRUint32 index = 0;
+  for (; index < selectedItemsCount; index++) {
+    nsCOMPtr<nsIDOMNode> itemNode;
+    selectedItems->Item(index, getter_AddRefs(itemNode));
+    nsCOMPtr<nsIDOMXULSelectControlItemElement> item =
+      do_QueryInterface(itemNode);
+
+    if (item) {
+      PRInt32 itemIdx = -1;
+      control->GetIndexOfItem(item, &itemIdx);
+      if (itemIdx != -1)
+        rowsIdxArray[index] = itemIdx;
+    }
+  }
+
+  *aNumRows = selectedItemsCount;
+  *aRows = rowsIdxArray;
+
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+XULListboxAccessible::SelectRow(PRInt32 aRow)
+{
+  if (IsDefunct())
+    return NS_ERROR_FAILURE;
+
+  nsCOMPtr<nsIDOMXULMultiSelectControlElement> control =
+    do_QueryInterface(mContent);
+  NS_ASSERTION(control,
+               "Doesn't implement nsIDOMXULMultiSelectControlElement.");
+
+  nsCOMPtr<nsIDOMXULSelectControlItemElement> item;
+  control->GetItemAtIndex(aRow, getter_AddRefs(item));
+  NS_ENSURE_TRUE(item, NS_ERROR_INVALID_ARG);
+
+  return control->SelectItem(item);
+}
+
+NS_IMETHODIMP
+XULListboxAccessible::SelectColumn(PRInt32 aColumn)
+{
+  // xul:listbox and xul:richlistbox support row selection only.
+  return NS_OK;
+}
+
+void
+XULListboxAccessible::UnselectRow(PRUint32 aRowIdx)
+{
+  nsCOMPtr<nsIDOMXULMultiSelectControlElement> control =
+    do_QueryInterface(mContent);
+  NS_ASSERTION(control,
+               "Doesn't implement nsIDOMXULMultiSelectControlElement.");
+
+  if (control) {
+    nsCOMPtr<nsIDOMXULSelectControlItemElement> item;
+    control->GetItemAtIndex(aRowIdx, getter_AddRefs(item));
+    control->RemoveItemFromSelection(item);
+  }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// XULListboxAccessible: Widgets
+
+bool
+XULListboxAccessible::IsWidget() const
+{
+  return true;
+}
+
+bool
+XULListboxAccessible::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
+XULListboxAccessible::AreItemsOperable() const
+{
+  if (IsAutoCompletePopup()) {
+    nsCOMPtr<nsIAutoCompletePopup> autoCompletePopupElm =
+      do_QueryInterface(mContent->GetParent());
+
+    if (autoCompletePopupElm) {
+      bool isOpen = false;
+      autoCompletePopupElm->GetPopupOpen(&isOpen);
+      return isOpen;
+    }
+  }
+  return true;
+}
+
+Accessible*
+XULListboxAccessible::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());
+    if (menuListElm) {
+      nsCOMPtr<nsIDOMNode> inputElm;
+      menuListElm->GetInputField(getter_AddRefs(inputElm));
+      if (inputElm) {
+        nsCOMPtr<nsINode> inputNode = do_QueryInterface(inputElm);
+        if (inputNode) {
+          Accessible* input = 
+            mDoc->GetAccessible(inputNode);
+          return input ? input->ContainerWidget() : nsnull;
+        }
+      }
+    }
+  }
+  return nsnull;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// XULListitemAccessible
+////////////////////////////////////////////////////////////////////////////////
+
+XULListitemAccessible::
+  XULListitemAccessible(nsIContent* aContent, DocAccessible* aDoc) :
+  XULMenuitemAccessible(aContent, aDoc)
+{
+  mIsCheckbox = mContent->AttrValueIs(kNameSpaceID_None,
+                                      nsGkAtoms::type,
+                                      nsGkAtoms::checkbox,
+                                      eCaseMatters);
+}
+
+NS_IMPL_ISUPPORTS_INHERITED0(XULListitemAccessible, Accessible)
+
+Accessible* 
+XULListitemAccessible::GetListAccessible()
+{
+  if (IsDefunct())
+    return nsnull;
+  
+  nsCOMPtr<nsIDOMXULSelectControlItemElement> listItem =
+    do_QueryInterface(mContent);
+  if (!listItem)
+    return nsnull;
+
+  nsCOMPtr<nsIDOMXULSelectControlElement> list;
+  listItem->GetControl(getter_AddRefs(list));
+
+  nsCOMPtr<nsIContent> listContent(do_QueryInterface(list));
+  if (!listContent)
+    return nsnull;
+
+  return mDoc->GetAccessible(listContent);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// XULListitemAccessible Accessible
+
+void
+XULListitemAccessible::Description(nsString& aDesc)
+{
+  AccessibleWrap::Description(aDesc);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// XULListitemAccessible. nsIAccessible
+
+/**
+  * If there is a Listcell as a child ( not anonymous ) use it, otherwise
+  *   default to getting the name from GetXULName
+  */
+nsresult
+XULListitemAccessible::GetNameInternal(nsAString& aName)
+{
+  nsIContent* childContent = mContent->GetFirstChild();
+  if (childContent) {
+    if (childContent->NodeInfo()->Equals(nsGkAtoms::listcell,
+                                         kNameSpaceID_XUL)) {
+      childContent->GetAttr(kNameSpaceID_None, nsGkAtoms::label, aName);
+      return NS_OK;
+    }
+  }
+  return GetXULName(aName);
+}
+
+role
+XULListitemAccessible::NativeRole()
+{
+  Accessible* list = GetListAccessible();
+  if (!list) {
+    NS_ERROR("No list accessible for listitem accessible!");
+    return roles::NOTHING;
+  }
+
+  if (list->Role() == roles::TABLE)
+    return roles::ROW;
+
+  if (mIsCheckbox)
+    return roles::CHECK_RICH_OPTION;
+
+  if (mParent && mParent->Role() == roles::COMBOBOX_LIST)
+    return roles::COMBOBOX_OPTION;
+
+  return roles::RICH_OPTION;
+}
+
+PRUint64
+XULListitemAccessible::NativeState()
+{
+  if (mIsCheckbox)
+    return XULMenuitemAccessible::NativeState();
+
+  PRUint64 states = NativeInteractiveState();
+
+  nsCOMPtr<nsIDOMXULSelectControlItemElement> listItem =
+    do_QueryInterface(mContent);
+
+  if (listItem) {
+    bool isSelected;
+    listItem->GetSelected(&isSelected);
+    if (isSelected)
+      states |= states::SELECTED;
+
+    if (FocusMgr()->IsFocused(this))
+      states |= states::FOCUSED;
+  }
+
+  return states;
+}
+
+PRUint64
+XULListitemAccessible::NativeInteractiveState() const
+{
+  return NativelyUnavailable() || (mParent && mParent->NativelyUnavailable()) ?
+    states::UNAVAILABLE : states::FOCUSABLE | states::SELECTABLE;
+}
+
+NS_IMETHODIMP
+XULListitemAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
+{
+  if (aIndex == eAction_Click && mIsCheckbox) {
+    // check or uncheck
+    PRUint64 states = NativeState();
+
+    if (states & states::CHECKED)
+      aName.AssignLiteral("uncheck");
+    else
+      aName.AssignLiteral("check");
+
+    return NS_OK;
+  }
+  return NS_ERROR_INVALID_ARG;
+}
+
+bool
+XULListitemAccessible::CanHaveAnonChildren()
+{
+  // That indicates we should walk anonymous children for listitems
+  return true;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// XULListitemAccessible: Widgets
+
+Accessible*
+XULListitemAccessible::ContainerWidget() const
+{
+  return Parent();
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// XULListCellAccessible
+////////////////////////////////////////////////////////////////////////////////
+
+XULListCellAccessible::
+  XULListCellAccessible(nsIContent* aContent, DocAccessible* aDoc) :
+  HyperTextAccessibleWrap(aContent, aDoc)
+{
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// nsISupports
+
+NS_IMPL_ISUPPORTS_INHERITED1(XULListCellAccessible,
+                             HyperTextAccessible,
+                             nsIAccessibleTableCell)
+
+////////////////////////////////////////////////////////////////////////////////
+// XULListCellAccessible: nsIAccessibleTableCell implementation
+
+NS_IMETHODIMP
+XULListCellAccessible::GetTable(nsIAccessibleTable** aTable)
+{
+  NS_ENSURE_ARG_POINTER(aTable);
+  *aTable = nsnull;
+
+  if (IsDefunct())
+    return NS_ERROR_FAILURE;
+
+  Accessible* thisRow = Parent();
+  if (!thisRow || thisRow->Role() != roles::ROW)
+    return NS_OK;
+
+  Accessible* table = thisRow->Parent();
+  if (!table || table->Role() != roles::TABLE)
+    return NS_OK;
+
+  CallQueryInterface(table, aTable);
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+XULListCellAccessible::GetColumnIndex(PRInt32* aColumnIndex)
+{
+  NS_ENSURE_ARG_POINTER(aColumnIndex);
+  *aColumnIndex = -1;
+
+  if (IsDefunct())
+    return NS_ERROR_FAILURE;
+
+  Accessible* row = Parent();
+  if (!row)
+    return NS_OK;
+
+  *aColumnIndex = 0;
+
+  PRInt32 indexInRow = IndexInParent();
+  for (PRInt32 idx = 0; idx < indexInRow; idx++) {
+    Accessible* cell = row->GetChildAt(idx);
+    roles::Role role = cell->Role();
+    if (role == roles::CELL || role == roles::GRID_CELL ||
+        role == roles::ROWHEADER || role == roles::COLUMNHEADER)
+      (*aColumnIndex)++;
+  }
+
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+XULListCellAccessible::GetRowIndex(PRInt32* aRowIndex)
+{
+  NS_ENSURE_ARG_POINTER(aRowIndex);
+  *aRowIndex = -1;
+
+  if (IsDefunct())
+    return NS_ERROR_FAILURE;
+
+  Accessible* row = Parent();
+  if (!row)
+    return NS_OK;
+
+  Accessible* table = row->Parent();
+  if (!table)
+    return NS_OK;
+
+  *aRowIndex = 0;
+
+  PRInt32 indexInTable = row->IndexInParent();
+  for (PRInt32 idx = 0; idx < indexInTable; idx++) {
+    row = table->GetChildAt(idx);
+    if (row->Role() == roles::ROW)
+      (*aRowIndex)++;
+  }
+
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+XULListCellAccessible::GetColumnExtent(PRInt32* aExtentCount)
+{
+  NS_ENSURE_ARG_POINTER(aExtentCount);
+  *aExtentCount = 0;
+
+  if (IsDefunct())
+    return NS_ERROR_FAILURE;
+
+  *aExtentCount = 1;
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+XULListCellAccessible::GetRowExtent(PRInt32* aExtentCount)
+{
+  NS_ENSURE_ARG_POINTER(aExtentCount);
+  *aExtentCount = 0;
+
+  if (IsDefunct())
+    return NS_ERROR_FAILURE;
+
+  *aExtentCount = 1;
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+XULListCellAccessible::GetColumnHeaderCells(nsIArray** aHeaderCells)
+{
+  NS_ENSURE_ARG_POINTER(aHeaderCells);
+  *aHeaderCells = nsnull;
+
+  if (IsDefunct())
+    return NS_ERROR_FAILURE;
+
+  nsCOMPtr<nsIAccessibleTable> table;
+  GetTable(getter_AddRefs(table));
+  NS_ENSURE_STATE(table); // we expect to be in a listbox (table)
+
+  // Get column header cell from XUL listhead.
+  Accessible* list = nsnull;
+
+  nsRefPtr<Accessible> tableAcc(do_QueryObject(table));
+  PRUint32 tableChildCount = tableAcc->ChildCount();
+  for (PRUint32 childIdx = 0; childIdx < tableChildCount; childIdx++) {
+    Accessible* child = tableAcc->GetChildAt(childIdx);
+    if (child->Role() == roles::LIST) {
+      list = child;
+      break;
+    }
+  }
+
+  if (list) {
+    PRInt32 colIdx = -1;
+    GetColumnIndex(&colIdx);
+
+    nsIAccessible *headerCell = list->GetChildAt(colIdx);
+    if (headerCell) {
+      nsresult rv = NS_OK;
+      nsCOMPtr<nsIMutableArray> headerCells =
+        do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
+      NS_ENSURE_SUCCESS(rv, rv);
+
+      headerCells->AppendElement(headerCell, false);
+      NS_ADDREF(*aHeaderCells = headerCells);
+      return NS_OK;
+    }
+  }
+
+  // No column header cell from XUL markup, try to get it from ARIA markup.
+  return nsAccUtils::GetHeaderCellsFor(table, this,
+                                       nsAccUtils::eColumnHeaderCells,
+                                       aHeaderCells);
+}
+
+NS_IMETHODIMP
+XULListCellAccessible::GetRowHeaderCells(nsIArray** aHeaderCells)
+{
+  NS_ENSURE_ARG_POINTER(aHeaderCells);
+  *aHeaderCells = nsnull;
+
+  if (IsDefunct())
+    return NS_ERROR_FAILURE;
+
+  nsCOMPtr<nsIAccessibleTable> table;
+  GetTable(getter_AddRefs(table));
+  NS_ENSURE_STATE(table); // we expect to be in a listbox (table)
+
+  // Calculate row header cells from ARIA markup.
+  return nsAccUtils::GetHeaderCellsFor(table, this,
+                                       nsAccUtils::eRowHeaderCells,
+                                       aHeaderCells);
+}
+
+NS_IMETHODIMP
+XULListCellAccessible::IsSelected(bool* aIsSelected)
+{
+  NS_ENSURE_ARG_POINTER(aIsSelected);
+  *aIsSelected = false;
+
+  if (IsDefunct())
+    return NS_ERROR_FAILURE;
+
+  nsCOMPtr<nsIAccessibleTable> table;
+  GetTable(getter_AddRefs(table));
+  NS_ENSURE_STATE(table); // we expect to be in a listbox (table)
+
+  PRInt32 rowIdx = -1;
+  GetRowIndex(&rowIdx);
+
+  return table->IsRowSelected(rowIdx, aIsSelected);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// XULListCellAccessible. Accessible implementation
+
+role
+XULListCellAccessible::NativeRole()
+{
+  return roles::CELL;
+}
+
+nsresult
+XULListCellAccessible::GetAttributesInternal(nsIPersistentProperties* aAttributes)
+{
+  NS_ENSURE_ARG_POINTER(aAttributes);
+
+  if (IsDefunct())
+    return NS_ERROR_FAILURE;
+
+  // "table-cell-index" attribute
+  nsCOMPtr<nsIAccessibleTable> table;
+  GetTable(getter_AddRefs(table));
+  NS_ENSURE_STATE(table); // we expect to be in a listbox (table)
+
+  PRInt32 rowIdx = -1;
+  GetRowIndex(&rowIdx);
+  PRInt32 colIdx = -1;
+  GetColumnIndex(&colIdx);
+
+  PRInt32 cellIdx = -1;
+  table->GetCellIndexAt(rowIdx, colIdx, &cellIdx);
+
+  nsAutoString stringIdx;
+  stringIdx.AppendInt(cellIdx);
+  nsAccUtils::SetAccAttr(aAttributes, nsGkAtoms::tableCellIndex,
+                         stringIdx);
+
+  return NS_OK;
+}
new file mode 100644
--- /dev/null
+++ b/accessible/src/xul/XULListboxAccessible.h
@@ -0,0 +1,162 @@
+/* -*- Mode: C++; tab-width: 4; 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 mozilla_a11y_XULListboxAccessible_h__
+#define mozilla_a11y_XULListboxAccessible_h__
+
+#include "BaseAccessibles.h"
+#include "nsIAccessibleTable.h"
+#include "TableAccessible.h"
+#include "xpcAccessibleTable.h"
+#include "XULMenuAccessible.h"
+#include "XULSelectControlAccessible.h"
+
+class nsIWeakReference;
+
+namespace mozilla {
+namespace a11y {
+
+/**
+ * XULColumAccessible are accessible for list and tree columns elements
+ * (xul:treecols and xul:listcols).
+ */
+class XULColumAccessible : public AccessibleWrap
+{
+public:
+  XULColumAccessible(nsIContent* aContent, DocAccessible* aDoc);
+
+  // Accessible
+  virtual a11y::role NativeRole();
+  virtual PRUint64 NativeState();
+};
+
+/**
+ * XULColumnItemAccessible are accessibles for list and tree column elements
+ * (xul:listcol and xul:treecol).
+ */
+class XULColumnItemAccessible : public LeafAccessible
+{
+public:
+  XULColumnItemAccessible(nsIContent* aContent, DocAccessible* aDoc);
+
+  // nsIAccessible
+  NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
+  NS_IMETHOD DoAction(PRUint8 aIndex);
+
+  // Accessible
+  virtual a11y::role NativeRole();
+  virtual PRUint64 NativeState();
+
+  // ActionAccessible
+  virtual PRUint8 ActionCount();
+
+  enum { eAction_Click = 0 };
+};
+
+/*
+ * A class the represents the XUL Listbox widget.
+ */
+class XULListboxAccessible : public XULSelectControlAccessible,
+                             public xpcAccessibleTable,
+                             public nsIAccessibleTable,
+                             public TableAccessible
+{
+public:
+  XULListboxAccessible(nsIContent* aContent, DocAccessible* aDoc);
+  virtual ~XULListboxAccessible() {}
+
+  NS_DECL_ISUPPORTS_INHERITED
+
+  // nsIAccessibleTable
+  NS_DECL_OR_FORWARD_NSIACCESSIBLETABLE_WITH_XPCACCESSIBLETABLE
+
+  // TableAccessible
+  virtual PRUint32 ColCount();
+  virtual PRUint32 RowCount();
+  virtual Accessible* CellAt(PRUint32 aRowIndex, PRUint32 aColumnIndex);
+  virtual void UnselectRow(PRUint32 aRowIdx);
+
+  // nsAccessNode
+  virtual void Shutdown();
+
+  // Accessible
+  virtual void Value(nsString& aValue);
+  virtual TableAccessible* AsTable() { return this; }
+  virtual a11y::role NativeRole();
+  virtual PRUint64 NativeState();
+
+  // Widgets
+  virtual bool IsWidget() const;
+  virtual bool IsActiveWidget() const;
+  virtual bool AreItemsOperable() const;
+
+  virtual Accessible* ContainerWidget() const;
+
+protected:
+  bool IsMulticolumn();
+};
+
+/**
+  * Listitems -- used in listboxes
+  */
+class XULListitemAccessible : public XULMenuitemAccessible
+{
+public:
+  enum { eAction_Click = 0 };
+
+  NS_DECL_ISUPPORTS_INHERITED
+
+  XULListitemAccessible(nsIContent* aContent, DocAccessible* aDoc);
+  virtual ~XULListitemAccessible() {}
+
+  // nsIAccessible
+  NS_IMETHOD GetActionName(PRUint8 index, nsAString& aName);
+  // Don't use XUL menuitems's description attribute
+
+  // Accessible
+  virtual void Description(nsString& aDesc);
+  virtual nsresult GetNameInternal(nsAString& aName);
+  virtual a11y::role NativeRole();
+  virtual PRUint64 NativeState();
+  virtual PRUint64 NativeInteractiveState() const;
+  virtual bool CanHaveAnonChildren();
+
+  // Widgets
+  virtual Accessible* ContainerWidget() const;
+
+protected:
+  /**
+   * Return listbox accessible for the listitem.
+   */
+  Accessible* GetListAccessible();
+
+private:
+  bool mIsCheckbox;
+};
+
+/**
+ * Class represents xul:listcell.
+ */
+class XULListCellAccessible : public HyperTextAccessibleWrap,
+                              public nsIAccessibleTableCell
+{
+public:
+  XULListCellAccessible(nsIContent* aContent, DocAccessible* aDoc);
+
+  // nsISupports
+  NS_DECL_ISUPPORTS_INHERITED
+
+  // nsIAccessibleTableCell
+  NS_DECL_NSIACCESSIBLETABLECELL
+
+  // Accessible
+  virtual nsresult GetAttributesInternal(nsIPersistentProperties *aAttributes);
+  virtual a11y::role NativeRole();
+};
+
+} // namespace a11y
+} // namespace mozilla
+
+#endif
rename from accessible/src/xul/nsXULMenuAccessible.cpp
rename to accessible/src/xul/XULMenuAccessible.cpp
--- a/accessible/src/xul/nsXULMenuAccessible.cpp
+++ b/accessible/src/xul/XULMenuAccessible.cpp
@@ -1,14 +1,14 @@
 /* -*- 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 "nsXULMenuAccessible.h"
+#include "XULMenuAccessible.h"
 
 #include "Accessible-inl.h"
 #include "nsAccessibilityService.h"
 #include "nsAccUtils.h"
 #include "DocAccessible.h"
 #include "Role.h"
 #include "States.h"
 #include "XULFormControlAccessible.h"
@@ -30,27 +30,27 @@
 #include "mozilla/Preferences.h"
 #include "mozilla/LookAndFeel.h"
 #include "mozilla/dom/Element.h"
 
 using namespace mozilla;
 using namespace mozilla::a11y;
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsXULMenuitemAccessible
+// XULMenuitemAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
-nsXULMenuitemAccessible::
-  nsXULMenuitemAccessible(nsIContent* aContent, DocAccessible* aDoc) :
+XULMenuitemAccessible::
+  XULMenuitemAccessible(nsIContent* aContent, DocAccessible* aDoc) :
   AccessibleWrap(aContent, aDoc)
 {
 }
 
 PRUint64
-nsXULMenuitemAccessible::NativeState()
+XULMenuitemAccessible::NativeState()
 {
   PRUint64 state = Accessible::NativeState();
 
   // Has Popup?
   if (mContent->NodeInfo()->Equals(nsGkAtoms::menu, kNameSpaceID_XUL)) {
     state |= states::HASPOPUP;
     if (mContent->HasAttr(kNameSpaceID_None, nsGkAtoms::open))
       state |= states::EXPANDED;
@@ -109,17 +109,17 @@ nsXULMenuitemAccessible::NativeState()
       } // isCollapsed
     } // isSelected
   } // ROLE_COMBOBOX_OPTION
 
   return state;
 }
 
 PRUint64
-nsXULMenuitemAccessible::NativeInteractiveState() const
+XULMenuitemAccessible::NativeInteractiveState() const
 {
   if (NativelyUnavailable()) {
     // Note: keep in sinc with nsXULPopupManager::IsValidMenuItem() logic.
     bool skipNavigatingDisabledMenuItem = true;
     nsMenuFrame* menuFrame = do_QueryFrame(GetFrame());
     if (!menuFrame->IsOnMenuBar()) {
       skipNavigatingDisabledMenuItem = LookAndFeel::
         GetInt(LookAndFeel::eIntID_SkipNavigatingDisabledMenuItem, 0) != 0;
@@ -130,31 +130,31 @@ nsXULMenuitemAccessible::NativeInteracti
 
     return states::UNAVAILABLE | states::FOCUSABLE | states::SELECTABLE;
   }
 
   return states::FOCUSABLE | states::SELECTABLE;
 }
 
 nsresult
-nsXULMenuitemAccessible::GetNameInternal(nsAString& aName)
+XULMenuitemAccessible::GetNameInternal(nsAString& aName)
 {
   mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::label, aName);
   return NS_OK;
 }
 
 void
-nsXULMenuitemAccessible::Description(nsString& aDescription)
+XULMenuitemAccessible::Description(nsString& aDescription)
 {
   mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::description,
                     aDescription);
 }
 
 KeyBinding
-nsXULMenuitemAccessible::AccessKey() const
+XULMenuitemAccessible::AccessKey() const
 {
   // Return menu accesskey: N or Alt+F.
   static PRInt32 gMenuAccesskeyModifier = -1;  // magic value of -1 indicates unitialized state
 
   // We do not use nsCoreUtils::GetAccesskeyFor() because accesskeys for
   // menu are't registered by nsEventStateManager.
   nsAutoString accesskey;
   mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::accesskey,
@@ -187,17 +187,17 @@ nsXULMenuitemAccessible::AccessKey() con
       }
     }
   }
 
   return KeyBinding(accesskey[0], modifierKey);
 }
 
 KeyBinding
-nsXULMenuitemAccessible::KeyboardShortcut() const
+XULMenuitemAccessible::KeyboardShortcut() const
 {
   nsAutoString keyElmId;
   mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::key, keyElmId);
   if (keyElmId.IsEmpty())
     return KeyBinding();
 
   nsIContent* keyElm = mContent->OwnerDoc()->GetElementById(keyElmId);
   if (!keyElm)
@@ -251,17 +251,17 @@ nsXULMenuitemAccessible::KeyboardShortcu
 #endif
     }
   }
 
   return KeyBinding(key, modifierMask);
 }
 
 role
-nsXULMenuitemAccessible::NativeRole()
+XULMenuitemAccessible::NativeRole()
 {
   nsCOMPtr<nsIDOMXULContainerElement> xulContainer(do_QueryInterface(mContent));
   if (xulContainer)
     return roles::PARENT_MENUITEM;
 
   if (mParent && mParent->Role() == roles::COMBOBOX_LIST)
     return roles::COMBOBOX_OPTION;
 
@@ -273,85 +273,87 @@ nsXULMenuitemAccessible::NativeRole()
                             nsGkAtoms::checkbox,
                             eCaseMatters)) 
     return roles::CHECK_MENU_ITEM;
 
   return roles::MENUITEM;
 }
 
 PRInt32
-nsXULMenuitemAccessible::GetLevelInternal()
+XULMenuitemAccessible::GetLevelInternal()
 {
   return nsAccUtils::GetLevelForXULContainerItem(mContent);
 }
 
 bool
-nsXULMenuitemAccessible::CanHaveAnonChildren()
+XULMenuitemAccessible::CanHaveAnonChildren()
 {
   // That indicates we don't walk anonymous children for menuitems
   return false;
 }
 
-NS_IMETHODIMP nsXULMenuitemAccessible::DoAction(PRUint8 index)
+NS_IMETHODIMP
+XULMenuitemAccessible::DoAction(PRUint8 index)
 {
   if (index == eAction_Click) {   // default action
     DoCommand();
     return NS_OK;
   }
 
   return NS_ERROR_INVALID_ARG;
 }
 
 /** select us! close combo box if necessary*/
-NS_IMETHODIMP nsXULMenuitemAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
+NS_IMETHODIMP
+XULMenuitemAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
 {
   if (aIndex == eAction_Click) {
     aName.AssignLiteral("click"); 
     return NS_OK;
   }
   return NS_ERROR_INVALID_ARG;
 }
 
 PRUint8
-nsXULMenuitemAccessible::ActionCount()
+XULMenuitemAccessible::ActionCount()
 {
   return 1;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsXULMenuitemAccessible: Widgets
+// XULMenuitemAccessible: Widgets
 
 bool
-nsXULMenuitemAccessible::IsActiveWidget() const
+XULMenuitemAccessible::IsActiveWidget() const
 {
   // Parent menu item is a widget, it's active when its popup is open.
   nsIContent* menuPopupContent = mContent->GetFirstChild();
   if (menuPopupContent) {
     nsMenuPopupFrame* menuPopupFrame =
       do_QueryFrame(menuPopupContent->GetPrimaryFrame());
     return menuPopupFrame && menuPopupFrame->IsOpen();
   }
   return false;
 }
 
 bool
-nsXULMenuitemAccessible::AreItemsOperable() const
+XULMenuitemAccessible::AreItemsOperable() const
 {
   // Parent menu item is a widget, its items are operable when its popup is open.
   nsIContent* menuPopupContent = mContent->GetFirstChild();
   if (menuPopupContent) {
     nsMenuPopupFrame* menuPopupFrame =
       do_QueryFrame(menuPopupContent->GetPrimaryFrame());
     return menuPopupFrame && menuPopupFrame->IsOpen();
   }
   return false;
 }
 
 Accessible*
-nsXULMenuitemAccessible::ContainerWidget() const
+XULMenuitemAccessible::ContainerWidget() const
 {
   nsMenuFrame* menuFrame = do_QueryFrame(GetFrame());
   if (menuFrame) {
     nsMenuParent* menuParent = menuFrame->GetMenuParent();
     if (menuParent) {
       if (menuParent->IsMenuBar()) // menubar menu
         return mParent;
 
@@ -363,79 +365,81 @@ nsXULMenuitemAccessible::ContainerWidget
       // shouldn't be a real case.
     }
   }
   return nsnull;
 }
 
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsXULMenuSeparatorAccessible
+// XULMenuSeparatorAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
-nsXULMenuSeparatorAccessible::
-  nsXULMenuSeparatorAccessible(nsIContent* aContent, DocAccessible* aDoc) :
-  nsXULMenuitemAccessible(aContent, aDoc)
+XULMenuSeparatorAccessible::
+  XULMenuSeparatorAccessible(nsIContent* aContent, DocAccessible* aDoc) :
+  XULMenuitemAccessible(aContent, aDoc)
 {
 }
 
 PRUint64
-nsXULMenuSeparatorAccessible::NativeState()
+XULMenuSeparatorAccessible::NativeState()
 {
   // Isn't focusable, but can be offscreen/invisible -- only copy those states
-  return nsXULMenuitemAccessible::NativeState() &
+  return XULMenuitemAccessible::NativeState() &
     (states::OFFSCREEN | states::INVISIBLE);
 }
 
 nsresult
-nsXULMenuSeparatorAccessible::GetNameInternal(nsAString& aName)
+XULMenuSeparatorAccessible::GetNameInternal(nsAString& aName)
 {
   return NS_OK;
 }
 
 role
-nsXULMenuSeparatorAccessible::NativeRole()
+XULMenuSeparatorAccessible::NativeRole()
 {
   return roles::SEPARATOR;
 }
 
-NS_IMETHODIMP nsXULMenuSeparatorAccessible::DoAction(PRUint8 index)
+NS_IMETHODIMP
+XULMenuSeparatorAccessible::DoAction(PRUint8 index)
 {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
-NS_IMETHODIMP nsXULMenuSeparatorAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
+NS_IMETHODIMP
+XULMenuSeparatorAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
 {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 PRUint8
-nsXULMenuSeparatorAccessible::ActionCount()
+XULMenuSeparatorAccessible::ActionCount()
 {
   return 0;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsXULMenupopupAccessible
+// XULMenupopupAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
-nsXULMenupopupAccessible::
-  nsXULMenupopupAccessible(nsIContent* aContent, DocAccessible* aDoc) :
+XULMenupopupAccessible::
+  XULMenupopupAccessible(nsIContent* aContent, DocAccessible* aDoc) :
   XULSelectControlAccessible(aContent, aDoc)
 {
   nsMenuPopupFrame* menuPopupFrame = do_QueryFrame(GetFrame());
   if (menuPopupFrame && menuPopupFrame->IsMenu())
     mFlags |= eMenuPopupAccessible;
 
   // May be the anonymous <menupopup> inside <menulist> (a combobox)
   mSelectControl = do_QueryInterface(mContent->GetParent());
 }
 
 PRUint64
-nsXULMenupopupAccessible::NativeState()
+XULMenupopupAccessible::NativeState()
 {
   PRUint64 state = Accessible::NativeState();
 
 #ifdef DEBUG
   // We are onscreen if our parent is active
   bool isActive = mContent->HasAttr(kNameSpaceID_None, nsGkAtoms::menuactive);
   if (!isActive) {
     Accessible* parent = Parent();
@@ -452,29 +456,29 @@ nsXULMenupopupAccessible::NativeState()
 
   if (state & states::INVISIBLE)
     state |= states::OFFSCREEN | states::COLLAPSED;
 
   return state;
 }
 
 nsresult
-nsXULMenupopupAccessible::GetNameInternal(nsAString& aName)
+XULMenupopupAccessible::GetNameInternal(nsAString& aName)
 {
   nsIContent *content = mContent;
   while (content && aName.IsEmpty()) {
     content->GetAttr(kNameSpaceID_None, nsGkAtoms::label, aName);
     content = content->GetParent();
   }
 
   return NS_OK;
 }
 
 role
-nsXULMenupopupAccessible::NativeRole()
+XULMenupopupAccessible::NativeRole()
 {
   // If accessible is not bound to the tree (this happens while children are
   // cached) return general role.
   if (mParent) {
     roles::Role role = mParent->Role();
     if (role == roles::COMBOBOX || role == roles::AUTOCOMPLETE)
       return roles::COMBOBOX_LIST;
 
@@ -485,41 +489,41 @@ nsXULMenupopupAccessible::NativeRole()
         return roles::COMBOBOX_LIST;
     }
   }
 
   return roles::MENUPOPUP;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsXULMenupopupAccessible: Widgets
+// XULMenupopupAccessible: Widgets
 
 bool
-nsXULMenupopupAccessible::IsWidget() const
+XULMenupopupAccessible::IsWidget() const
 {
   return true;
 }
 
 bool
-nsXULMenupopupAccessible::IsActiveWidget() const
+XULMenupopupAccessible::IsActiveWidget() const
 {
   // If menupopup is a widget (the case of context menus) then active when open.
   nsMenuPopupFrame* menuPopupFrame = do_QueryFrame(GetFrame());
   return menuPopupFrame && menuPopupFrame->IsOpen();
 }
 
 bool
-nsXULMenupopupAccessible::AreItemsOperable() const
+XULMenupopupAccessible::AreItemsOperable() const
 {
   nsMenuPopupFrame* menuPopupFrame = do_QueryFrame(GetFrame());
   return menuPopupFrame && menuPopupFrame->IsOpen();
 }
 
 Accessible*
-nsXULMenupopupAccessible::ContainerWidget() const
+XULMenupopupAccessible::ContainerWidget() const
 {
   DocAccessible* document = Document();
 
   nsMenuPopupFrame* menuPopupFrame = do_QueryFrame(GetFrame());
   while (menuPopupFrame) {
     Accessible* menuPopup =
       document->GetAccessible(menuPopupFrame->GetContent());
     if (!menuPopup) // shouldn't be a real case
@@ -545,65 +549,65 @@ nsXULMenupopupAccessible::ContainerWidge
     menuPopupFrame = static_cast<nsMenuPopupFrame*>(menuParent);
   }
 
   NS_NOTREACHED("Shouldn't be a real case.");
   return nsnull;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsXULMenubarAccessible
+// XULMenubarAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
-nsXULMenubarAccessible::
-  nsXULMenubarAccessible(nsIContent* aContent, DocAccessible* aDoc) :
+XULMenubarAccessible::
+  XULMenubarAccessible(nsIContent* aContent, DocAccessible* aDoc) :
   AccessibleWrap(aContent, aDoc)
 {
 }
 
 nsresult
-nsXULMenubarAccessible::GetNameInternal(nsAString& aName)
+XULMenubarAccessible::GetNameInternal(nsAString& aName)
 {
   aName.AssignLiteral("Application");
   return NS_OK;
 }
 
 role
-nsXULMenubarAccessible::NativeRole()
+XULMenubarAccessible::NativeRole()
 {
   return roles::MENUBAR;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsXULMenubarAccessible: Widgets
+// XULMenubarAccessible: Widgets
 
 bool
-nsXULMenubarAccessible::IsActiveWidget() const
+XULMenubarAccessible::IsActiveWidget() const
 {
   nsMenuBarFrame* menuBarFrame = do_QueryFrame(GetFrame());
   return menuBarFrame && menuBarFrame->IsActive();
 }
 
 bool
-nsXULMenubarAccessible::AreItemsOperable() const
+XULMenubarAccessible::AreItemsOperable() const
 {
   return true;
 }
 
 Accessible*
-nsXULMenubarAccessible::CurrentItem()
+XULMenubarAccessible::CurrentItem()
 {
   nsMenuBarFrame* menuBarFrame = do_QueryFrame(GetFrame());
   if (menuBarFrame) {
     nsMenuFrame* menuFrame = menuBarFrame->GetCurrentMenuItem();
     if (menuFrame) {
       nsIContent* menuItemNode = menuFrame->GetContent();
       return mDoc->GetAccessible(menuItemNode);
     }
   }
   return nsnull;
 }
 
 void
-nsXULMenubarAccessible::SetCurrentItem(Accessible* aItem)
+XULMenubarAccessible::SetCurrentItem(Accessible* aItem)
 {
-  NS_ERROR("nsXULMenubarAccessible::SetCurrentItem not implemented");
+  NS_ERROR("XULMenubarAccessible::SetCurrentItem not implemented");
 }
rename from accessible/src/xul/nsXULMenuAccessible.h
rename to accessible/src/xul/XULMenuAccessible.h
--- a/accessible/src/xul/nsXULMenuAccessible.h
+++ b/accessible/src/xul/XULMenuAccessible.h
@@ -1,38 +1,41 @@
 /* -*- 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 _nsXULMenuAccessible_H_
-#define _nsXULMenuAccessible_H_
+#ifndef mozilla_a11y_XULMenuAccessible_h__
+#define mozilla_a11y_XULMenuAccessible_h__
 
 #include "AccessibleWrap.h"
 #include "nsIDOMXULSelectCntrlEl.h"
 #include "XULSelectControlAccessible.h"
 
+namespace mozilla {
+namespace a11y {
+
 /**
  * Used for XUL menu, menuitem elements.
  */
-class nsXULMenuitemAccessible : public AccessibleWrap
+class XULMenuitemAccessible : public AccessibleWrap
 {
 public:
   enum { eAction_Click = 0 };
 
-  nsXULMenuitemAccessible(nsIContent* aContent, DocAccessible* aDoc);
+  XULMenuitemAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // nsIAccessible
   NS_IMETHOD DoAction(PRUint8 index);
   NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
 
   // Accessible
   virtual void Description(nsString& aDescription);
   virtual nsresult GetNameInternal(nsAString& aName);
-  virtual mozilla::a11y::role NativeRole();
+  virtual a11y::role NativeRole();
   virtual PRUint64 NativeState();
   virtual PRUint64 NativeInteractiveState() const;
   virtual PRInt32 GetLevelInternal();
 
   virtual bool CanHaveAnonChildren();
 
   // ActionAccessible
   virtual PRUint8 ActionCount();
@@ -43,68 +46,71 @@ public:
   virtual bool IsActiveWidget() const;
   virtual bool AreItemsOperable() const;
   virtual Accessible* ContainerWidget() const;
 };
 
 /**
  * Used for XUL menuseparator element.
  */
-class nsXULMenuSeparatorAccessible : public nsXULMenuitemAccessible
+class XULMenuSeparatorAccessible : public XULMenuitemAccessible
 {
 public:
-  nsXULMenuSeparatorAccessible(nsIContent* aContent, DocAccessible* aDoc);
+  XULMenuSeparatorAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // nsIAccessible
   NS_IMETHOD DoAction(PRUint8 index);
   NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
 
   // Accessible
   virtual nsresult GetNameInternal(nsAString& aName);
-  virtual mozilla::a11y::role NativeRole();
+  virtual a11y::role NativeRole();
   virtual PRUint64 NativeState();
 
   // ActionAccessible
   virtual PRUint8 ActionCount();
 };
 
 
 /**
  * Used for XUL menupopup and panel.
  */
-class nsXULMenupopupAccessible : public XULSelectControlAccessible
+class XULMenupopupAccessible : public XULSelectControlAccessible
 {
 public:
-  nsXULMenupopupAccessible(nsIContent* aContent, DocAccessible* aDoc);
+  XULMenupopupAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
   virtual nsresult GetNameInternal(nsAString& aName);
-  virtual mozilla::a11y::role NativeRole();
+  virtual a11y::role NativeRole();
   virtual PRUint64 NativeState();
 
   // Widgets
   virtual bool IsWidget() const;
   virtual bool IsActiveWidget() const;
   virtual bool AreItemsOperable() const;
 
   virtual Accessible* ContainerWidget() const;
 };
 
 /**
  * Used for XUL menubar element.
  */
-class nsXULMenubarAccessible : public AccessibleWrap
+class XULMenubarAccessible : public AccessibleWrap
 {
 public:
-  nsXULMenubarAccessible(nsIContent* aContent, DocAccessible* aDoc);
+  XULMenubarAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
   virtual nsresult GetNameInternal(nsAString& aName);
-  virtual mozilla::a11y::role NativeRole();
+  virtual a11y::role NativeRole();
 
   // Widget
   virtual bool IsActiveWidget() const;
   virtual bool AreItemsOperable() const;
   virtual Accessible* CurrentItem();
   virtual void SetCurrentItem(Accessible* aItem);
 };
 
+} // namespace a11y
+} // namespace mozilla
+
 #endif
--- a/accessible/src/xul/XULTreeAccessible.cpp
+++ b/accessible/src/xul/XULTreeAccessible.cpp
@@ -1200,26 +1200,26 @@ XULTreeItemAccessible::CacheChildren()
 
 
 ////////////////////////////////////////////////////////////////////////////////
 //  XULTreeColumAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
 XULTreeColumAccessible::
   XULTreeColumAccessible(nsIContent* aContent, DocAccessible* aDoc) :
-  nsXULColumAccessible(aContent, aDoc)
+  XULColumAccessible(aContent, aDoc)
 {
 }
 
 Accessible*
 XULTreeColumAccessible::GetSiblingAtOffset(PRInt32 aOffset,
                                            nsresult* aError) const
 {
   if (aOffset < 0)
-    return nsXULColumAccessible::GetSiblingAtOffset(aOffset, aError);
+    return XULColumAccessible::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));
--- a/accessible/src/xul/XULTreeAccessible.h
+++ b/accessible/src/xul/XULTreeAccessible.h
@@ -4,17 +4,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_a11y_XULTreeAccessible_h__
 #define mozilla_a11y_XULTreeAccessible_h__
 
 #include "nsITreeBoxObject.h"
 #include "nsITreeView.h"
 #include "nsITreeColumns.h"
-#include "nsXULListboxAccessible.h"
+#include "XULListboxAccessible.h"
 
 namespace mozilla {
 namespace a11y {
 
 /*
  * A class the represents the XUL Tree widget.
  */
 const PRUint32 kMaxTreeColumns = 100;
@@ -254,17 +254,17 @@ protected:
   nsCOMPtr<nsITreeColumn> mColumn;
   nsString mCachedName;
 };
 
 
 /**
  * Accessible class for columns element of XUL tree.
  */
-class XULTreeColumAccessible : public nsXULColumAccessible
+class XULTreeColumAccessible : public XULColumAccessible
 {
 public:
   XULTreeColumAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
 protected:
 
   // Accessible
   virtual Accessible* GetSiblingAtOffset(PRInt32 aOffset,
--- a/accessible/src/xul/nsXULComboboxAccessible.h
+++ b/accessible/src/xul/nsXULComboboxAccessible.h
@@ -1,17 +1,17 @@
 /* -*- Mode: C++; tab-width: 4; 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 __nsXULComboboxAccessible_h__
 #define __nsXULComboboxAccessible_h__
 
-#include "nsXULMenuAccessible.h"
+#include "XULMenuAccessible.h"
 
 /**
  * Used for XUL comboboxes like xul:menulist and autocomplete textbox.
  */
 class nsXULComboboxAccessible : public AccessibleWrap
 {
 public:
   enum { eAction_Click = 0 };
deleted file mode 100644
--- a/accessible/src/xul/nsXULListboxAccessible.cpp
+++ /dev/null
@@ -1,1176 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; 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 "nsXULListboxAccessible.h"
-
-#include "Accessible-inl.h"
-#include "nsAccessibilityService.h"
-#include "nsAccUtils.h"
-#include "DocAccessible.h"
-#include "Role.h"
-#include "States.h"
-
-#include "nsComponentManagerUtils.h"
-#include "nsIAutoCompleteInput.h"
-#include "nsIAutoCompletePopup.h"
-#include "nsIDOMXULMenuListElement.h"
-#include "nsIDOMXULMultSelectCntrlEl.h"
-#include "nsIDOMNodeList.h"
-#include "nsIDOMXULPopupElement.h"
-#include "nsIDOMXULSelectCntrlItemEl.h"
-
-using namespace mozilla::a11y;
-
-////////////////////////////////////////////////////////////////////////////////
-// nsXULColumAccessible
-////////////////////////////////////////////////////////////////////////////////
-
-nsXULColumAccessible::
-  nsXULColumAccessible(nsIContent* aContent, DocAccessible* aDoc) :
-  AccessibleWrap(aContent, aDoc)
-{
-}
-
-role
-nsXULColumAccessible::NativeRole()
-{
-  return roles::LIST;
-}
-
-PRUint64
-nsXULColumAccessible::NativeState()
-{
-  return states::READONLY;
-}
-
-
-////////////////////////////////////////////////////////////////////////////////
-// nsXULColumnItemAccessible
-////////////////////////////////////////////////////////////////////////////////
-
-nsXULColumnItemAccessible::
-  nsXULColumnItemAccessible(nsIContent* aContent, DocAccessible* aDoc) :
-  LeafAccessible(aContent, aDoc)
-{
-}
-
-role
-nsXULColumnItemAccessible::NativeRole()
-{
-  return roles::COLUMNHEADER;
-}
-
-PRUint64
-nsXULColumnItemAccessible::NativeState()
-{
-  return states::READONLY;
-}
-
-PRUint8
-nsXULColumnItemAccessible::ActionCount()
-{
-  return 1;
-}
-
-NS_IMETHODIMP
-nsXULColumnItemAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
-{
-  if (aIndex != eAction_Click)
-    return NS_ERROR_INVALID_ARG;
-
-  aName.AssignLiteral("click");
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsXULColumnItemAccessible::DoAction(PRUint8 aIndex)
-{
-  if (aIndex != eAction_Click)
-    return NS_ERROR_INVALID_ARG;
-
-  DoCommand();
-  return NS_OK;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-// nsXULListboxAccessible
-////////////////////////////////////////////////////////////////////////////////
-
-nsXULListboxAccessible::
-  nsXULListboxAccessible(nsIContent* aContent, DocAccessible* aDoc) :
-  XULSelectControlAccessible(aContent, aDoc), xpcAccessibleTable(this)
-{
-  nsIContent* parentContent = mContent->GetParent();
-  if (parentContent) {
-    nsCOMPtr<nsIAutoCompletePopup> autoCompletePopupElm =
-      do_QueryInterface(parentContent);
-    if (autoCompletePopupElm)
-      mFlags |= eAutoCompletePopupAccessible;
-  }
-}
-
-NS_IMPL_ADDREF_INHERITED(nsXULListboxAccessible, XULSelectControlAccessible)
-NS_IMPL_RELEASE_INHERITED(nsXULListboxAccessible, XULSelectControlAccessible)
-
-nsresult
-nsXULListboxAccessible::QueryInterface(REFNSIID aIID, void** aInstancePtr)
-{
-  nsresult rv = XULSelectControlAccessible::QueryInterface(aIID, aInstancePtr);
-  if (*aInstancePtr)
-    return rv;
-
-  if (aIID.Equals(NS_GET_IID(nsIAccessibleTable)) && IsMulticolumn()) {
-    *aInstancePtr = static_cast<nsIAccessibleTable*>(this);
-    NS_ADDREF_THIS();
-    return NS_OK;
-  }
-
-  return NS_ERROR_NO_INTERFACE;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-//nsAccessNode
-
-void
-nsXULListboxAccessible::Shutdown()
-{
-  mTable = nsnull;
-  XULSelectControlAccessible::Shutdown();
-}
-
-bool
-nsXULListboxAccessible::IsMulticolumn()
-{
-  PRInt32 numColumns = 0;
-  nsresult rv = GetColumnCount(&numColumns);
-  if (NS_FAILED(rv))
-    return false;
-
-  return numColumns > 1;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-// nsXULListboxAccessible. nsIAccessible
-
-PRUint64
-nsXULListboxAccessible::NativeState()
-{
-  // As a nsXULListboxAccessible we can have the following states:
-  //   FOCUSED, READONLY, FOCUSABLE
-
-  // Get focus status from base class
-  PRUint64 states = Accessible::NativeState();
-
-  // see if we are multiple select if so set ourselves as such
-
-  if (mContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::seltype,
-                            nsGkAtoms::multiple, eCaseMatters)) {
-      states |= states::MULTISELECTABLE | states::EXTSELECTABLE;
-  }
-
-  return states;
-}
-
-/**
-  * Our value is the label of our ( first ) selected child.
-  */
-void
-nsXULListboxAccessible::Value(nsString& aValue)
-{
-  aValue.Truncate();
-
-  nsCOMPtr<nsIDOMXULSelectControlElement> select(do_QueryInterface(mContent));
-  if (select) {
-    nsCOMPtr<nsIDOMXULSelectControlItemElement> selectedItem;
-    select->GetSelectedItem(getter_AddRefs(selectedItem));
-    if (selectedItem)
-      selectedItem->GetLabel(aValue);
-  }
-}
-
-role
-nsXULListboxAccessible::NativeRole()
-{
-  // A richlistbox is used with the new autocomplete URL bar, and has a parent
-  // popup <panel>.
-  nsCOMPtr<nsIDOMXULPopupElement> xulPopup =
-    do_QueryInterface(mContent->GetParent());
-  if (xulPopup)
-    return roles::COMBOBOX_LIST;
-
-  return IsMulticolumn() ? roles::TABLE : roles::LISTBOX;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-// nsXULListboxAccessible. nsIAccessibleTable
-
-PRUint32
-nsXULListboxAccessible::ColCount()
-{
-  nsIContent* headContent = nsnull;
-  for (nsIContent* childContent = mContent->GetFirstChild(); childContent;
-       childContent = childContent->GetNextSibling()) {
-    if (childContent->NodeInfo()->Equals(nsGkAtoms::listcols,
-                                         kNameSpaceID_XUL)) {
-      headContent = childContent;
-    }
-  }
-  if (!headContent)
-    return 0;
-
-  PRUint32 columnCount = 0;
-  for (nsIContent* childContent = headContent->GetFirstChild(); childContent;
-       childContent = childContent->GetNextSibling()) {
-    if (childContent->NodeInfo()->Equals(nsGkAtoms::listcol,
-                                         kNameSpaceID_XUL)) {
-      columnCount++;
-    }
-  }
-
-  return columnCount;
-}
-
-PRUint32
-nsXULListboxAccessible::RowCount()
-{
-  nsCOMPtr<nsIDOMXULSelectControlElement> element(do_QueryInterface(mContent));
-
-  PRUint32 itemCount = 0;
-  if(element)
-    element->GetItemCount(&itemCount);
-
-  return itemCount;
-}
-
-Accessible*
-nsXULListboxAccessible::CellAt(PRUint32 aRowIndex, PRUint32 aColumnIndex)
-{ 
-  nsCOMPtr<nsIDOMXULSelectControlElement> control =
-    do_QueryInterface(mContent);
-  NS_ENSURE_TRUE(control, nsnull);
-
-  nsCOMPtr<nsIDOMXULSelectControlItemElement> item;
-  control->GetItemAtIndex(aRowIndex, getter_AddRefs(item));
-  if (!item)
-    return nsnull;
-
-  nsCOMPtr<nsIContent> itemContent(do_QueryInterface(item));
-  if (!itemContent)
-    return nsnull;
-
-  Accessible* row = mDoc->GetAccessible(itemContent);
-  NS_ENSURE_TRUE(row, nsnull);
-
-  return row->GetChildAt(aColumnIndex);
-}
-
-NS_IMETHODIMP
-nsXULListboxAccessible::GetColumnIndexAt(PRInt32 aIndex, PRInt32 *aColumn)
-{
-  NS_ENSURE_ARG_POINTER(aColumn);
-  *aColumn = -1;
-
-  PRInt32 columnCount = 0;
-  nsresult rv = GetColumnCount(&columnCount);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  *aColumn = aIndex % columnCount;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsXULListboxAccessible::GetRowIndexAt(PRInt32 aIndex, PRInt32 *aRow)
-{
-  NS_ENSURE_ARG_POINTER(aRow);
-  *aRow = -1;
-
-  PRInt32 columnCount = 0;
-  nsresult rv = GetColumnCount(&columnCount);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  *aRow = aIndex / columnCount;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsXULListboxAccessible::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;
-
-  PRInt32 columnCount = 0;
-  nsresult rv = GetColumnCount(&columnCount);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  *aColumnIndex = aCellIndex % columnCount;
-  *aRowIndex = aCellIndex / columnCount;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsXULListboxAccessible::GetColumnDescription(PRInt32 aColumn,
-                                             nsAString& aDescription)
-{
-  aDescription.Truncate();
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsXULListboxAccessible::GetRowDescription(PRInt32 aRow, nsAString& aDescription)
-{
-  aDescription.Truncate();
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsXULListboxAccessible::IsColumnSelected(PRInt32 aColumn, bool *aIsSelected)
-{
-  NS_ENSURE_ARG_POINTER(aIsSelected);
-  *aIsSelected = false;
-
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
-  nsCOMPtr<nsIDOMXULMultiSelectControlElement> control =
-    do_QueryInterface(mContent);
-  NS_ASSERTION(control,
-               "Doesn't implement nsIDOMXULMultiSelectControlElement.");
-
-  PRInt32 selectedrowCount = 0;
-  nsresult rv = control->GetSelectedCount(&selectedrowCount);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  PRInt32 rowCount = 0;
-  rv = GetRowCount(&rowCount);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  *aIsSelected = (selectedrowCount == rowCount);
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsXULListboxAccessible::IsRowSelected(PRInt32 aRow, bool *aIsSelected)
-{
-  NS_ENSURE_ARG_POINTER(aIsSelected);
-  *aIsSelected = false;
-
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
-  nsCOMPtr<nsIDOMXULSelectControlElement> control =
-    do_QueryInterface(mContent);
-  NS_ASSERTION(control,
-               "Doesn't implement nsIDOMXULSelectControlElement.");
-
-  nsCOMPtr<nsIDOMXULSelectControlItemElement> item;
-  control->GetItemAtIndex(aRow, getter_AddRefs(item));
-  NS_ENSURE_TRUE(item, NS_ERROR_INVALID_ARG);
-
-  return item->GetSelected(aIsSelected);
-}
-
-NS_IMETHODIMP
-nsXULListboxAccessible::IsCellSelected(PRInt32 aRowIndex, PRInt32 aColumnIndex,
-                                       bool *aIsSelected)
-{
-  return IsRowSelected(aRowIndex, aIsSelected);
-}
-
-NS_IMETHODIMP
-nsXULListboxAccessible::GetSelectedCellCount(PRUint32* aCount)
-{
-  NS_ENSURE_ARG_POINTER(aCount);
-  *aCount = 0;
-
-  nsCOMPtr<nsIDOMXULMultiSelectControlElement> control =
-    do_QueryInterface(mContent);
-  NS_ASSERTION(control,
-               "Doesn't implement nsIDOMXULMultiSelectControlElement.");
-
-  nsCOMPtr<nsIDOMNodeList> selectedItems;
-  control->GetSelectedItems(getter_AddRefs(selectedItems));
-  if (!selectedItems)
-    return NS_OK;
-
-  PRUint32 selectedItemsCount = 0;
-  nsresult rv = selectedItems->GetLength(&selectedItemsCount);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  if (!selectedItemsCount)
-    return NS_OK;
-
-  PRInt32 columnCount = 0;
-  rv = GetColumnCount(&columnCount);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  *aCount = selectedItemsCount * columnCount;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsXULListboxAccessible::GetSelectedColumnCount(PRUint32* aCount)
-{
-  NS_ENSURE_ARG_POINTER(aCount);
-  *aCount = 0;
-
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
-  nsCOMPtr<nsIDOMXULMultiSelectControlElement> control =
-    do_QueryInterface(mContent);
-  NS_ASSERTION(control,
-               "Doesn't implement nsIDOMXULMultiSelectControlElement.");
-
-  PRInt32 selectedrowCount = 0;
-  nsresult rv = control->GetSelectedCount(&selectedrowCount);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  PRInt32 rowCount = 0;
-  rv = GetRowCount(&rowCount);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  if (selectedrowCount != rowCount)
-    return NS_OK;
-
-  PRInt32 columnCount = 0;
-  rv = GetColumnCount(&columnCount);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  *aCount = columnCount;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsXULListboxAccessible::GetSelectedRowCount(PRUint32* aCount)
-{
-  NS_ENSURE_ARG_POINTER(aCount);
-  *aCount = 0;
-
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
-  nsCOMPtr<nsIDOMXULMultiSelectControlElement> control =
-    do_QueryInterface(mContent);
-  NS_ASSERTION(control,
-               "Doesn't implement nsIDOMXULMultiSelectControlElement.");
-
-  PRInt32 selectedrowCount = 0;
-  nsresult rv = control->GetSelectedCount(&selectedrowCount);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  *aCount = selectedrowCount;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsXULListboxAccessible::GetSelectedCells(nsIArray **aCells)
-{
-  NS_ENSURE_ARG_POINTER(aCells);
-  *aCells = nsnull;
-
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
-  nsresult rv = NS_OK;
-  nsCOMPtr<nsIMutableArray> selCells =
-    do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  nsCOMPtr<nsIDOMXULMultiSelectControlElement> control =
-    do_QueryInterface(mContent);
-  NS_ASSERTION(control,
-               "Doesn't implement nsIDOMXULMultiSelectControlElement.");
-
-  nsCOMPtr<nsIDOMNodeList> selectedItems;
-  control->GetSelectedItems(getter_AddRefs(selectedItems));
-  if (!selectedItems)
-    return NS_OK;
-
-  PRUint32 selectedItemsCount = 0;
-  rv = selectedItems->GetLength(&selectedItemsCount);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  NS_ENSURE_TRUE(mDoc, NS_ERROR_FAILURE);
-  PRUint32 index = 0;
-  for (; index < selectedItemsCount; index++) {
-    nsCOMPtr<nsIDOMNode> itemNode;
-    selectedItems->Item(index, getter_AddRefs(itemNode));
-    nsCOMPtr<nsIContent> itemContent(do_QueryInterface(itemNode));
-    Accessible* item = mDoc->GetAccessible(itemContent);
-
-    if (item) {
-      PRUint32 cellCount = item->ChildCount();
-      for (PRUint32 cellIdx = 0; cellIdx < cellCount; cellIdx++) {
-        Accessible* cell = mChildren[cellIdx];
-        if (cell->Role() == roles::CELL)
-          selCells->AppendElement(static_cast<nsIAccessible*>(cell), false);
-      }
-    }
-  }
-
-  NS_ADDREF(*aCells = selCells);
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsXULListboxAccessible::GetSelectedCellIndices(PRUint32 *aNumCells,
-                                               PRInt32 **aCells)
-{
-  NS_ENSURE_ARG_POINTER(aNumCells);
-  *aNumCells = 0;
-  NS_ENSURE_ARG_POINTER(aCells);
-  *aCells = nsnull;
-
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
-  nsCOMPtr<nsIDOMXULMultiSelectControlElement> control =
-    do_QueryInterface(mContent);
-  NS_ASSERTION(control,
-               "Doesn't implement nsIDOMXULMultiSelectControlElement.");
-
-  nsCOMPtr<nsIDOMNodeList> selectedItems;
-  control->GetSelectedItems(getter_AddRefs(selectedItems));
-  if (!selectedItems)
-    return NS_OK;
-
-  PRUint32 selectedItemsCount = 0;
-  nsresult rv = selectedItems->GetLength(&selectedItemsCount);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  PRInt32 columnCount = 0;
-  rv = GetColumnCount(&columnCount);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  PRUint32 cellsCount = selectedItemsCount * columnCount;
-
-  PRInt32 *cellsIdxArray =
-    static_cast<PRInt32*>(nsMemory::Alloc((cellsCount) * sizeof(PRInt32)));
-  NS_ENSURE_TRUE(cellsIdxArray, NS_ERROR_OUT_OF_MEMORY);
-
-  PRUint32 index = 0, cellsIdx = 0;
-  for (; index < selectedItemsCount; index++) {
-    nsCOMPtr<nsIDOMNode> itemNode;
-    selectedItems->Item(index, getter_AddRefs(itemNode));
-    nsCOMPtr<nsIDOMXULSelectControlItemElement> item =
-      do_QueryInterface(itemNode);
-
-    if (item) {
-      PRInt32 itemIdx = -1;
-      control->GetIndexOfItem(item, &itemIdx);
-      if (itemIdx != -1) {
-        PRInt32 colIdx = 0;
-        for (; colIdx < columnCount; colIdx++)
-          cellsIdxArray[cellsIdx++] = itemIdx * columnCount + colIdx;
-      }
-    }
-  }
-
-  *aNumCells = cellsCount;
-  *aCells = cellsIdxArray;
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsXULListboxAccessible::GetSelectedColumnIndices(PRUint32 *aNumColumns,
-                                                 PRInt32 **aColumns)
-{
-  NS_ENSURE_ARG_POINTER(aNumColumns);
-  *aNumColumns = 0;
-  NS_ENSURE_ARG_POINTER(aColumns);
-  *aColumns = nsnull;
-
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
-  PRUint32 columnCount = 0;
-  nsresult rv = GetSelectedColumnCount(&columnCount);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  if (!columnCount)
-    return NS_OK;
-
-  PRInt32 *colsIdxArray =
-    static_cast<PRInt32*>(nsMemory::Alloc((columnCount) * sizeof(PRInt32)));
-  NS_ENSURE_TRUE(colsIdxArray, NS_ERROR_OUT_OF_MEMORY);
-
-  PRUint32 colIdx = 0;
-  for (; colIdx < columnCount; colIdx++)
-    colsIdxArray[colIdx] = colIdx;
-
-  *aNumColumns = columnCount;
-  *aColumns = colsIdxArray;
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsXULListboxAccessible::GetSelectedRowIndices(PRUint32 *aNumRows,
-                                              PRInt32 **aRows)
-{
-  NS_ENSURE_ARG_POINTER(aNumRows);
-  *aNumRows = 0;
-  NS_ENSURE_ARG_POINTER(aRows);
-  *aRows = nsnull;
-
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
-  nsCOMPtr<nsIDOMXULMultiSelectControlElement> control =
-    do_QueryInterface(mContent);
-  NS_ASSERTION(control,
-               "Doesn't implement nsIDOMXULMultiSelectControlElement.");
-
-  nsCOMPtr<nsIDOMNodeList> selectedItems;
-  control->GetSelectedItems(getter_AddRefs(selectedItems));
-  if (!selectedItems)
-    return NS_OK;
-
-  PRUint32 selectedItemsCount = 0;
-  nsresult rv = selectedItems->GetLength(&selectedItemsCount);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  if (!selectedItemsCount)
-    return NS_OK;
-
-  PRInt32 *rowsIdxArray =
-    static_cast<PRInt32*>(nsMemory::Alloc((selectedItemsCount) * sizeof(PRInt32)));
-  NS_ENSURE_TRUE(rowsIdxArray, NS_ERROR_OUT_OF_MEMORY);
-
-  PRUint32 index = 0;
-  for (; index < selectedItemsCount; index++) {
-    nsCOMPtr<nsIDOMNode> itemNode;
-    selectedItems->Item(index, getter_AddRefs(itemNode));
-    nsCOMPtr<nsIDOMXULSelectControlItemElement> item =
-      do_QueryInterface(itemNode);
-
-    if (item) {
-      PRInt32 itemIdx = -1;
-      control->GetIndexOfItem(item, &itemIdx);
-      if (itemIdx != -1)
-        rowsIdxArray[index] = itemIdx;
-    }
-  }
-
-  *aNumRows = selectedItemsCount;
-  *aRows = rowsIdxArray;
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsXULListboxAccessible::SelectRow(PRInt32 aRow)
-{
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
-  nsCOMPtr<nsIDOMXULMultiSelectControlElement> control =
-    do_QueryInterface(mContent);
-  NS_ASSERTION(control,
-               "Doesn't implement nsIDOMXULMultiSelectControlElement.");
-
-  nsCOMPtr<nsIDOMXULSelectControlItemElement> item;
-  control->GetItemAtIndex(aRow, getter_AddRefs(item));
-  NS_ENSURE_TRUE(item, NS_ERROR_INVALID_ARG);
-
-  return control->SelectItem(item);
-}
-
-NS_IMETHODIMP
-nsXULListboxAccessible::SelectColumn(PRInt32 aColumn)
-{
-  // xul:listbox and xul:richlistbox support row selection only.
-  return NS_OK;
-}
-
-void
-nsXULListboxAccessible::UnselectRow(PRUint32 aRowIdx)
-{
-  nsCOMPtr<nsIDOMXULMultiSelectControlElement> control =
-    do_QueryInterface(mContent);
-  NS_ASSERTION(control,
-               "Doesn't implement nsIDOMXULMultiSelectControlElement.");
-
-  if (control) {
-    nsCOMPtr<nsIDOMXULSelectControlItemElement> item;
-    control->GetItemAtIndex(aRowIdx, getter_AddRefs(item));
-    control->RemoveItemFromSelection(item);
-  }
-}
-
-////////////////////////////////////////////////////////////////////////////////
-// nsXULListboxAccessible: Widgets
-
-bool
-nsXULListboxAccessible::IsWidget() const
-{
-  return true;
-}
-
-bool
-nsXULListboxAccessible::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
-nsXULListboxAccessible::AreItemsOperable() const
-{
-  if (IsAutoCompletePopup()) {
-    nsCOMPtr<nsIAutoCompletePopup> autoCompletePopupElm =
-      do_QueryInterface(mContent->GetParent());
-
-    if (autoCompletePopupElm) {
-      bool isOpen = false;
-      autoCompletePopupElm->GetPopupOpen(&isOpen);
-      return isOpen;
-    }
-  }
-  return true;
-}
-
-Accessible*
-nsXULListboxAccessible::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());
-    if (menuListElm) {
-      nsCOMPtr<nsIDOMNode> inputElm;
-      menuListElm->GetInputField(getter_AddRefs(inputElm));
-      if (inputElm) {
-        nsCOMPtr<nsINode> inputNode = do_QueryInterface(inputElm);
-        if (inputNode) {
-          Accessible* input = 
-            mDoc->GetAccessible(inputNode);
-          return input ? input->ContainerWidget() : nsnull;
-        }
-      }
-    }
-  }
-  return nsnull;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-// nsXULListitemAccessible
-////////////////////////////////////////////////////////////////////////////////
-
-nsXULListitemAccessible::
-  nsXULListitemAccessible(nsIContent* aContent, DocAccessible* aDoc) :
-  nsXULMenuitemAccessible(aContent, aDoc)
-{
-  mIsCheckbox = mContent->AttrValueIs(kNameSpaceID_None,
-                                      nsGkAtoms::type,
-                                      nsGkAtoms::checkbox,
-                                      eCaseMatters);
-}
-
-NS_IMPL_ISUPPORTS_INHERITED0(nsXULListitemAccessible, Accessible)
-
-Accessible* 
-nsXULListitemAccessible::GetListAccessible()
-{
-  if (IsDefunct())
-    return nsnull;
-  
-  nsCOMPtr<nsIDOMXULSelectControlItemElement> listItem =
-    do_QueryInterface(mContent);
-  if (!listItem)
-    return nsnull;
-
-  nsCOMPtr<nsIDOMXULSelectControlElement> list;
-  listItem->GetControl(getter_AddRefs(list));
-
-  nsCOMPtr<nsIContent> listContent(do_QueryInterface(list));
-  if (!listContent)
-    return nsnull;
-
-  return mDoc->GetAccessible(listContent);
-}
-
-////////////////////////////////////////////////////////////////////////////////
-// nsXULListitemAccessible Accessible
-
-void
-nsXULListitemAccessible::Description(nsString& aDesc)
-{
-  AccessibleWrap::Description(aDesc);
-}
-
-////////////////////////////////////////////////////////////////////////////////
-// nsXULListitemAccessible. nsIAccessible
-
-/**
-  * If there is a Listcell as a child ( not anonymous ) use it, otherwise
-  *   default to getting the name from GetXULName
-  */
-nsresult
-nsXULListitemAccessible::GetNameInternal(nsAString& aName)
-{
-  nsIContent* childContent = mContent->GetFirstChild();
-  if (childContent) {
-    if (childContent->NodeInfo()->Equals(nsGkAtoms::listcell,
-                                         kNameSpaceID_XUL)) {
-      childContent->GetAttr(kNameSpaceID_None, nsGkAtoms::label, aName);
-      return NS_OK;
-    }
-  }
-  return GetXULName(aName);
-}
-
-role
-nsXULListitemAccessible::NativeRole()
-{
-  Accessible* list = GetListAccessible();
-  if (!list) {
-    NS_ERROR("No list accessible for listitem accessible!");
-    return roles::NOTHING;
-  }
-
-  if (list->Role() == roles::TABLE)
-    return roles::ROW;
-
-  if (mIsCheckbox)
-    return roles::CHECK_RICH_OPTION;
-
-  if (mParent && mParent->Role() == roles::COMBOBOX_LIST)
-    return roles::COMBOBOX_OPTION;
-
-  return roles::RICH_OPTION;
-}
-
-PRUint64
-nsXULListitemAccessible::NativeState()
-{
-  if (mIsCheckbox)
-    return nsXULMenuitemAccessible::NativeState();
-
-  PRUint64 states = NativeInteractiveState();
-
-  nsCOMPtr<nsIDOMXULSelectControlItemElement> listItem =
-    do_QueryInterface(mContent);
-
-  if (listItem) {
-    bool isSelected;
-    listItem->GetSelected(&isSelected);
-    if (isSelected)
-      states |= states::SELECTED;
-
-    if (FocusMgr()->IsFocused(this))
-      states |= states::FOCUSED;
-  }
-
-  return states;
-}
-
-PRUint64
-nsXULListitemAccessible::NativeInteractiveState() const
-{
-  return NativelyUnavailable() || (mParent && mParent->NativelyUnavailable()) ?
-    states::UNAVAILABLE : states::FOCUSABLE | states::SELECTABLE;
-}
-
-NS_IMETHODIMP nsXULListitemAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
-{
-  if (aIndex == eAction_Click && mIsCheckbox) {
-    // check or uncheck
-    PRUint64 states = NativeState();
-
-    if (states & states::CHECKED)
-      aName.AssignLiteral("uncheck");
-    else
-      aName.AssignLiteral("check");
-
-    return NS_OK;
-  }
-  return NS_ERROR_INVALID_ARG;
-}
-
-bool
-nsXULListitemAccessible::CanHaveAnonChildren()
-{
-  // That indicates we should walk anonymous children for listitems
-  return true;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-// nsXULListitemAccessible: Widgets
-
-Accessible*
-nsXULListitemAccessible::ContainerWidget() const
-{
-  return Parent();
-}
-
-
-////////////////////////////////////////////////////////////////////////////////
-// nsXULListCellAccessible
-////////////////////////////////////////////////////////////////////////////////
-
-nsXULListCellAccessible::
-  nsXULListCellAccessible(nsIContent* aContent, DocAccessible* aDoc) :
-  HyperTextAccessibleWrap(aContent, aDoc)
-{
-}
-
-////////////////////////////////////////////////////////////////////////////////
-// nsISupports
-
-NS_IMPL_ISUPPORTS_INHERITED1(nsXULListCellAccessible,
-                             HyperTextAccessible,
-                             nsIAccessibleTableCell)
-
-////////////////////////////////////////////////////////////////////////////////
-// nsXULListCellAccessible: nsIAccessibleTableCell implementation
-
-NS_IMETHODIMP
-nsXULListCellAccessible::GetTable(nsIAccessibleTable **aTable)
-{
-  NS_ENSURE_ARG_POINTER(aTable);
-  *aTable = nsnull;
-
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
-  Accessible* thisRow = Parent();
-  if (!thisRow || thisRow->Role() != roles::ROW)
-    return NS_OK;
-
-  Accessible* table = thisRow->Parent();
-  if (!table || table->Role() != roles::TABLE)
-    return NS_OK;
-
-  CallQueryInterface(table, aTable);
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsXULListCellAccessible::GetColumnIndex(PRInt32 *aColumnIndex)
-{
-  NS_ENSURE_ARG_POINTER(aColumnIndex);
-  *aColumnIndex = -1;
-
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
-  Accessible* row = Parent();
-  if (!row)
-    return NS_OK;
-
-  *aColumnIndex = 0;
-
-  PRInt32 indexInRow = IndexInParent();
-  for (PRInt32 idx = 0; idx < indexInRow; idx++) {
-    Accessible* cell = row->GetChildAt(idx);
-    roles::Role role = cell->Role();
-    if (role == roles::CELL || role == roles::GRID_CELL ||
-        role == roles::ROWHEADER || role == roles::COLUMNHEADER)
-      (*aColumnIndex)++;
-  }
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsXULListCellAccessible::GetRowIndex(PRInt32 *aRowIndex)
-{
-  NS_ENSURE_ARG_POINTER(aRowIndex);
-  *aRowIndex = -1;
-
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
-  Accessible* row = Parent();
-  if (!row)
-    return NS_OK;
-
-  Accessible* table = row->Parent();
-  if (!table)
-    return NS_OK;
-
-  *aRowIndex = 0;
-
-  PRInt32 indexInTable = row->IndexInParent();
-  for (PRInt32 idx = 0; idx < indexInTable; idx++) {
-    row = table->GetChildAt(idx);
-    if (row->Role() == roles::ROW)
-      (*aRowIndex)++;
-  }
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsXULListCellAccessible::GetColumnExtent(PRInt32 *aExtentCount)
-{
-  NS_ENSURE_ARG_POINTER(aExtentCount);
-  *aExtentCount = 0;
-
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
-  *aExtentCount = 1;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsXULListCellAccessible::GetRowExtent(PRInt32 *aExtentCount)
-{
-  NS_ENSURE_ARG_POINTER(aExtentCount);
-  *aExtentCount = 0;
-
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
-  *aExtentCount = 1;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsXULListCellAccessible::GetColumnHeaderCells(nsIArray **aHeaderCells)
-{
-  NS_ENSURE_ARG_POINTER(aHeaderCells);
-  *aHeaderCells = nsnull;
-
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
-  nsCOMPtr<nsIAccessibleTable> table;
-  GetTable(getter_AddRefs(table));
-  NS_ENSURE_STATE(table); // we expect to be in a listbox (table)
-
-  // Get column header cell from XUL listhead.
-  Accessible* list = nsnull;
-
-  nsRefPtr<Accessible> tableAcc(do_QueryObject(table));
-  PRUint32 tableChildCount = tableAcc->ChildCount();
-  for (PRUint32 childIdx = 0; childIdx < tableChildCount; childIdx++) {
-    Accessible* child = tableAcc->GetChildAt(childIdx);
-    if (child->Role() == roles::LIST) {
-      list = child;
-      break;
-    }
-  }
-
-  if (list) {
-    PRInt32 colIdx = -1;
-    GetColumnIndex(&colIdx);
-
-    nsIAccessible *headerCell = list->GetChildAt(colIdx);
-    if (headerCell) {
-      nsresult rv = NS_OK;
-      nsCOMPtr<nsIMutableArray> headerCells =
-        do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
-      NS_ENSURE_SUCCESS(rv, rv);
-
-      headerCells->AppendElement(headerCell, false);
-      NS_ADDREF(*aHeaderCells = headerCells);
-      return NS_OK;
-    }
-  }
-
-  // No column header cell from XUL markup, try to get it from ARIA markup.
-  return nsAccUtils::GetHeaderCellsFor(table, this,
-                                       nsAccUtils::eColumnHeaderCells,
-                                       aHeaderCells);
-}
-
-NS_IMETHODIMP
-nsXULListCellAccessible::GetRowHeaderCells(nsIArray **aHeaderCells)
-{
-  NS_ENSURE_ARG_POINTER(aHeaderCells);
-  *aHeaderCells = nsnull;
-
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
-  nsCOMPtr<nsIAccessibleTable> table;
-  GetTable(getter_AddRefs(table));
-  NS_ENSURE_STATE(table); // we expect to be in a listbox (table)
-
-  // Calculate row header cells from ARIA markup.
-  return nsAccUtils::GetHeaderCellsFor(table, this,
-                                       nsAccUtils::eRowHeaderCells,
-                                       aHeaderCells);
-}
-
-NS_IMETHODIMP
-nsXULListCellAccessible::IsSelected(bool *aIsSelected)
-{
-  NS_ENSURE_ARG_POINTER(aIsSelected);
-  *aIsSelected = false;
-
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
-  nsCOMPtr<nsIAccessibleTable> table;
-  GetTable(getter_AddRefs(table));
-  NS_ENSURE_STATE(table); // we expect to be in a listbox (table)
-
-  PRInt32 rowIdx = -1;
-  GetRowIndex(&rowIdx);
-
-  return table->IsRowSelected(rowIdx, aIsSelected);
-}
-
-////////////////////////////////////////////////////////////////////////////////
-// nsXULListCellAccessible. Accessible implementation
-
-role
-nsXULListCellAccessible::NativeRole()
-{
-  return roles::CELL;
-}
-
-nsresult
-nsXULListCellAccessible::GetAttributesInternal(nsIPersistentProperties *aAttributes)
-{
-  NS_ENSURE_ARG_POINTER(aAttributes);
-
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
-  // "table-cell-index" attribute
-  nsCOMPtr<nsIAccessibleTable> table;
-  GetTable(getter_AddRefs(table));
-  NS_ENSURE_STATE(table); // we expect to be in a listbox (table)
-
-  PRInt32 rowIdx = -1;
-  GetRowIndex(&rowIdx);
-  PRInt32 colIdx = -1;
-  GetColumnIndex(&colIdx);
-
-  PRInt32 cellIdx = -1;
-  table->GetCellIndexAt(rowIdx, colIdx, &cellIdx);
-
-  nsAutoString stringIdx;
-  stringIdx.AppendInt(cellIdx);
-  nsAccUtils::SetAccAttr(aAttributes, nsGkAtoms::tableCellIndex,
-                         stringIdx);
-
-  return NS_OK;
-}
deleted file mode 100644
--- a/accessible/src/xul/nsXULListboxAccessible.h
+++ /dev/null
@@ -1,155 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; 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 __nsXULListboxAccessible_h__
-#define __nsXULListboxAccessible_h__
-
-#include "BaseAccessibles.h"
-#include "nsXULMenuAccessible.h"
-#include "nsIAccessibleTable.h"
-#include "TableAccessible.h"
-#include "xpcAccessibleTable.h"
-#include "XULSelectControlAccessible.h"
-
-class nsIWeakReference;
-
-/**
- * nsXULColumAccessible are accessible for list and tree columns elements
- * (xul:treecols and xul:listcols).
- */
-class nsXULColumAccessible : public AccessibleWrap
-{
-public:
-  nsXULColumAccessible(nsIContent* aContent, DocAccessible* aDoc);
-
-  // Accessible
-  virtual mozilla::a11y::role NativeRole();
-  virtual PRUint64 NativeState();
-};
-
-/**
- * nsXULColumnAccessible are accessibles for list and tree column elements
- * (xul:listcol and xul:treecol).
- */
-class nsXULColumnItemAccessible : public mozilla::a11y::LeafAccessible
-{
-public:
-  nsXULColumnItemAccessible(nsIContent* aContent, DocAccessible* aDoc);
-
-  // nsIAccessible
-  NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
-  NS_IMETHOD DoAction(PRUint8 aIndex);
-
-  // Accessible
-  virtual mozilla::a11y::role NativeRole();
-  virtual PRUint64 NativeState();
-
-  // ActionAccessible
-  virtual PRUint8 ActionCount();
-
-  enum { eAction_Click = 0 };
-};
-
-/*
- * A class the represents the XUL Listbox widget.
- */
-class nsXULListboxAccessible : public XULSelectControlAccessible,
-                               public xpcAccessibleTable,
-                               public nsIAccessibleTable,
-                               public mozilla::a11y::TableAccessible
-{
-public:
-  nsXULListboxAccessible(nsIContent* aContent, DocAccessible* aDoc);
-  virtual ~nsXULListboxAccessible() {}
-
-  NS_DECL_ISUPPORTS_INHERITED
-
-  // nsIAccessibleTable
-  NS_DECL_OR_FORWARD_NSIACCESSIBLETABLE_WITH_XPCACCESSIBLETABLE
-
-  // TableAccessible
-  virtual PRUint32 ColCount();
-  virtual PRUint32 RowCount();
-  virtual Accessible* CellAt(PRUint32 aRowIndex, PRUint32 aColumnIndex);
-  virtual void UnselectRow(PRUint32 aRowIdx);
-
-  // nsAccessNode
-  virtual void Shutdown();
-
-  // Accessible
-  virtual void Value(nsString& aValue);
-  virtual mozilla::a11y::TableAccessible* AsTable() { return this; }
-  virtual mozilla::a11y::role NativeRole();
-  virtual PRUint64 NativeState();
-
-  // Widgets
-  virtual bool IsWidget() const;
-  virtual bool IsActiveWidget() const;
-  virtual bool AreItemsOperable() const;
-
-  virtual Accessible* ContainerWidget() const;
-
-protected:
-  bool IsMulticolumn();
-};
-
-/**
-  * Listitems -- used in listboxes 
-  */
-class nsXULListitemAccessible : public nsXULMenuitemAccessible
-{
-public:
-  enum { eAction_Click = 0 };
-
-  NS_DECL_ISUPPORTS_INHERITED
-  
-  nsXULListitemAccessible(nsIContent* aContent, DocAccessible* aDoc);
-  virtual ~nsXULListitemAccessible() {}
-
-  // nsIAccessible
-  NS_IMETHOD GetActionName(PRUint8 index, nsAString& aName);
-  // Don't use XUL menuitems's description attribute
-
-  // Accessible
-  virtual void Description(nsString& aDesc);
-  virtual nsresult GetNameInternal(nsAString& aName);
-  virtual mozilla::a11y::role NativeRole();
-  virtual PRUint64 NativeState();
-  virtual PRUint64 NativeInteractiveState() const;
-  virtual bool CanHaveAnonChildren();
-
-  // Widgets
-  virtual Accessible* ContainerWidget() const;
-
-protected:
-  /**
-   * Return listbox accessible for the listitem.
-   */
-  Accessible* GetListAccessible();
-
-private:
-  bool mIsCheckbox;
-};
-
-/**
- * Class represents xul:listcell.
- */
-class nsXULListCellAccessible : public HyperTextAccessibleWrap,
-                                public nsIAccessibleTableCell
-{
-public:
-  nsXULListCellAccessible(nsIContent* aContent, DocAccessible* aDoc);
-
-  // nsISupports
-  NS_DECL_ISUPPORTS_INHERITED
-
-  // nsIAccessibleTableCell
-  NS_DECL_NSIACCESSIBLETABLECELL
-
-  // Accessible
-  virtual nsresult GetAttributesInternal(nsIPersistentProperties *aAttributes);
-  virtual mozilla::a11y::role NativeRole();
-};
-
-#endif
--- a/accessible/src/xul/nsXULTabAccessible.h
+++ b/accessible/src/xul/nsXULTabAccessible.h
@@ -2,17 +2,17 @@
 /* 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 _nsXULTabAccessible_H_
 #define _nsXULTabAccessible_H_
 
 // NOTE: alphabetically ordered
-#include "nsXULMenuAccessible.h"
+#include "XULMenuAccessible.h"
 #include "XULSelectControlAccessible.h"
 
 /**
  * An individual tab, xul:tab element.
  */
 class nsXULTabAccessible : public AccessibleWrap
 {
 public: