Bug 760757 - de-ns-ify nsHTMLSelectAccessible, r=surkov
authorMark Capella <markcapella@twcny.rr.com>
Wed, 06 Jun 2012 06:27:46 -0400
changeset 95975 6eb0a03905fae5c481df2aa8a48471c4b44e4361
parent 95974 4bfdebaff84cbf5e9453cfbcefc578e667b60129
child 95976 2bcb940397892214b1336614e587cd5407cd03c6
push id22869
push useremorley@mozilla.com
push dateThu, 07 Jun 2012 09:35:19 +0000
treeherdermozilla-central@3933384d8315 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssurkov
bugs760757
milestone16.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 760757 - de-ns-ify nsHTMLSelectAccessible, r=surkov
accessible/src/base/nsAccessibilityService.cpp
accessible/src/generic/DocAccessible.cpp
accessible/src/generic/RootAccessible.cpp
accessible/src/html/HTMLSelectAccessible.cpp
accessible/src/html/HTMLSelectAccessible.h
accessible/src/html/Makefile.in
accessible/src/html/nsHTMLSelectAccessible.cpp
accessible/src/html/nsHTMLSelectAccessible.h
--- a/accessible/src/base/nsAccessibilityService.cpp
+++ b/accessible/src/base/nsAccessibilityService.cpp
@@ -13,23 +13,23 @@
 #include "AtkSocketAccessible.h"
 #endif
 #include "DocAccessible-inl.h"
 #include "FocusManager.h"
 #include "HTMLElementAccessibles.h"
 #include "HTMLImageMapAccessible.h"
 #include "HTMLLinkAccessible.h"
 #include "HTMLListAccessible.h"
+#include "HTMLSelectAccessible.h"
 #include "HyperTextAccessibleWrap.h"
 #include "nsAccessiblePivot.h"
 #include "nsAccUtils.h"
 #include "nsARIAMap.h"
 #include "nsIAccessibleProvider.h"
 #include "nsHTMLCanvasAccessible.h"
-#include "nsHTMLSelectAccessible.h"
 #include "nsHTMLTableAccessibleWrap.h"
 #include "nsXFormsFormControlsAccessible.h"
 #include "nsXFormsWidgetsAccessible.h"
 #include "OuterDocAccessible.h"
 #include "Role.h"
 #include "RootAccessibleWrap.h"
 #include "States.h"
 #include "Statistics.h"
@@ -221,17 +221,17 @@ nsAccessibilityService::CreateHTMLCheckb
   return accessible;
 }
 
 already_AddRefed<Accessible>
 nsAccessibilityService::CreateHTMLComboboxAccessible(nsIContent* aContent,
                                                      nsIPresShell* aPresShell)
 {
   Accessible* accessible =
-    new nsHTMLComboboxAccessible(aContent, GetDocAccessible(aPresShell));
+    new HTMLComboboxAccessible(aContent, GetDocAccessible(aPresShell));
   NS_ADDREF(accessible);
   return accessible;
 }
 
 already_AddRefed<Accessible>
 nsAccessibilityService::CreateHTMLCanvasAccessible(nsIContent* aContent,
                                                    nsIPresShell* aPresShell)
 {
@@ -281,17 +281,17 @@ nsAccessibilityService::CreateHTMLGroupb
   return accessible;
 }
 
 already_AddRefed<Accessible>
 nsAccessibilityService::CreateHTMLListboxAccessible(nsIContent* aContent,
                                                     nsIPresShell* aPresShell)
 {
   Accessible* accessible =
-    new nsHTMLSelectListAccessible(aContent, GetDocAccessible(aPresShell));
+    new HTMLSelectListAccessible(aContent, GetDocAccessible(aPresShell));
   NS_ADDREF(accessible);
   return accessible;
 }
 
 already_AddRefed<Accessible>
 nsAccessibilityService::CreateHTMLMediaAccessible(nsIContent* aContent,
                                                   nsIPresShell* aPresShell)
 {
@@ -1599,23 +1599,23 @@ nsAccessibilityService::CreateHTMLAccess
 
   if (tag == nsGkAtoms::legend) {
     Accessible* accessible = new HTMLLegendAccessible(aContent, aDoc);
     NS_IF_ADDREF(accessible);
     return accessible;
   }
 
   if (tag == nsGkAtoms::option) {
-    Accessible* accessible = new nsHTMLSelectOptionAccessible(aContent, aDoc);
+    Accessible* accessible = new HTMLSelectOptionAccessible(aContent, aDoc);
     NS_IF_ADDREF(accessible);
     return accessible;
   }
 
   if (tag == nsGkAtoms::optgroup) {
-    Accessible* accessible = new nsHTMLSelectOptGroupAccessible(aContent, aDoc);
+    Accessible* accessible = new HTMLSelectOptGroupAccessible(aContent, aDoc);
     NS_IF_ADDREF(accessible);
     return accessible;
   }
 
   if (tag == nsGkAtoms::ul || tag == nsGkAtoms::ol ||
       tag == nsGkAtoms::dl) {
     Accessible* accessible = new HTMLListAccessible(aContent, aDoc);
     NS_IF_ADDREF(accessible);
--- a/accessible/src/generic/DocAccessible.cpp
+++ b/accessible/src/generic/DocAccessible.cpp
@@ -27,17 +27,16 @@
 #include "nsIDOMDocumentType.h"
 #include "nsIDOMXULDocument.h"
 #include "nsIDOMMutationEvent.h"
 #include "nsPIDOMWindow.h"
 #include "nsIDOMXULPopupElement.h"
 #include "nsIEditingSession.h"
 #include "nsEventStateManager.h"
 #include "nsIFrame.h"
-#include "nsHTMLSelectAccessible.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsINameSpaceManager.h"
 #include "nsIPresShell.h"
 #include "nsIServiceManager.h"
 #include "nsIViewManager.h"
 #include "nsIScrollableFrame.h"
 #include "nsUnicharUtils.h"
 #include "nsIURI.h"
--- a/accessible/src/generic/RootAccessible.cpp
+++ b/accessible/src/generic/RootAccessible.cpp
@@ -15,17 +15,17 @@
 #include "nsAccessibilityService.h"
 #include "nsAccUtils.h"
 #include "nsCoreUtils.h"
 #include "Relation.h"
 #include "Role.h"
 #include "States.h"
 
 #include "mozilla/dom/Element.h"
-#include "nsHTMLSelectAccessible.h"
+
 #include "nsIAccessibleRelation.h"
 #include "nsIDocShell.h"
 #include "nsIDocShellTreeItem.h"
 #include "nsIDocShellTreeNode.h"
 #include "nsIDocShellTreeOwner.h"
 #include "nsIDOMElement.h"
 #include "nsIDOMEventListener.h"
 #include "nsIDOMEventTarget.h"
rename from accessible/src/html/nsHTMLSelectAccessible.cpp
rename to accessible/src/html/HTMLSelectAccessible.cpp
--- a/accessible/src/html/nsHTMLSelectAccessible.cpp
+++ b/accessible/src/html/HTMLSelectAccessible.cpp
@@ -1,14 +1,14 @@
 /* -*- 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 "nsHTMLSelectAccessible.h"
+#include "HTMLSelectAccessible.h"
 
 #include "Accessible-inl.h"
 #include "nsAccessibilityService.h"
 #include "nsAccUtils.h"
 #include "DocAccessible.h"
 #include "nsEventShell.h"
 #include "nsIAccessibleEvent.h"
 #include "nsTextEquivUtils.h"
@@ -24,130 +24,130 @@
 #include "nsIDOMHTMLSelectElement.h"
 #include "nsIListControlFrame.h"
 #include "nsIServiceManager.h"
 #include "nsIMutableArray.h"
 
 using namespace mozilla::a11y;
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsHTMLSelectListAccessible
+// HTMLSelectListAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
-nsHTMLSelectListAccessible::
-  nsHTMLSelectListAccessible(nsIContent* aContent, DocAccessible* aDoc) :
+HTMLSelectListAccessible::
+  HTMLSelectListAccessible(nsIContent* aContent, DocAccessible* aDoc) :
   AccessibleWrap(aContent, aDoc)
 {
   mFlags |= eListControlAccessible;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsHTMLSelectListAccessible: Accessible public
+// HTMLSelectListAccessible: Accessible public
 
 PRUint64
-nsHTMLSelectListAccessible::NativeState()
+HTMLSelectListAccessible::NativeState()
 {
   PRUint64 state = AccessibleWrap::NativeState();
   if (mContent->HasAttr(kNameSpaceID_None, nsGkAtoms::multiple))
     state |= states::MULTISELECTABLE | states::EXTSELECTABLE;
 
   return state;
 }
 
 role
-nsHTMLSelectListAccessible::NativeRole()
+HTMLSelectListAccessible::NativeRole()
 {
   return roles::LISTBOX;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsHTMLSelectListAccessible: SelectAccessible
+// HTMLSelectListAccessible: SelectAccessible
 
 bool
-nsHTMLSelectListAccessible::IsSelect()
+HTMLSelectListAccessible::IsSelect()
 {
   return true;
 }
 
 bool
-nsHTMLSelectListAccessible::SelectAll()
+HTMLSelectListAccessible::SelectAll()
 {
   return mContent->HasAttr(kNameSpaceID_None, nsGkAtoms::multiple) ?
     AccessibleWrap::SelectAll() : false;
 }
 
 bool
-nsHTMLSelectListAccessible::UnselectAll()
+HTMLSelectListAccessible::UnselectAll()
 {
   return mContent->HasAttr(kNameSpaceID_None, nsGkAtoms::multiple) ?
     AccessibleWrap::UnselectAll() : false;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsHTMLSelectListAccessible: Widgets
+// HTMLSelectListAccessible: Widgets
 
 bool
-nsHTMLSelectListAccessible::IsWidget() const
+HTMLSelectListAccessible::IsWidget() const
 {
   return true;
 }
 
 bool
-nsHTMLSelectListAccessible::IsActiveWidget() const
+HTMLSelectListAccessible::IsActiveWidget() const
 {
   return FocusMgr()->HasDOMFocus(mContent);
 }
 
 bool
-nsHTMLSelectListAccessible::AreItemsOperable() const
+HTMLSelectListAccessible::AreItemsOperable() const
 {
   return true;
 }
 
 Accessible*
-nsHTMLSelectListAccessible::CurrentItem()
+HTMLSelectListAccessible::CurrentItem()
 {
   nsIListControlFrame* listControlFrame = do_QueryFrame(GetFrame());
   if (listControlFrame) {
     nsCOMPtr<nsIContent> activeOptionNode = listControlFrame->GetCurrentOption();
     if (activeOptionNode) {
       DocAccessible* document = Document();
       if (document)
         return document->GetAccessible(activeOptionNode);
     }
   }
   return nsnull;
 }
 
 void
-nsHTMLSelectListAccessible::SetCurrentItem(Accessible* aItem)
+HTMLSelectListAccessible::SetCurrentItem(Accessible* aItem)
 {
   aItem->GetContent()->SetAttr(kNameSpaceID_None,
                                nsGkAtoms::selected, NS_LITERAL_STRING("true"),
                                true);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsHTMLSelectListAccessible: Accessible protected
+// HTMLSelectListAccessible: Accessible protected
 
 void
-nsHTMLSelectListAccessible::CacheChildren()
+HTMLSelectListAccessible::CacheChildren()
 {
   // Cache accessibles for <optgroup> and <option> DOM decendents as children,
   // as well as the accessibles for them. Avoid whitespace text nodes. We want
   // to count all the <optgroup>s and <option>s as children because we want
   // a flat tree under the Select List.
   CacheOptSiblings(mContent);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsHTMLSelectListAccessible protected
+// HTMLSelectListAccessible protected
 
 void
-nsHTMLSelectListAccessible::CacheOptSiblings(nsIContent *aParentContent)
+HTMLSelectListAccessible::CacheOptSiblings(nsIContent* aParentContent)
 {
   for (nsIContent* childContent = aParentContent->GetFirstChild(); childContent;
        childContent = childContent->GetNextSibling()) {
     if (!childContent->IsHTML()) {
       continue;
     }
 
     nsIAtom* tag = childContent->Tag();
@@ -164,39 +164,39 @@ nsHTMLSelectListAccessible::CacheOptSibl
       if (tag == nsGkAtoms::optgroup)
         CacheOptSiblings(childContent);
     }
   }
 }
 
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsHTMLSelectOptionAccessible
+// HTMLSelectOptionAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
-nsHTMLSelectOptionAccessible::
-  nsHTMLSelectOptionAccessible(nsIContent* aContent, DocAccessible* aDoc) :
+HTMLSelectOptionAccessible::
+  HTMLSelectOptionAccessible(nsIContent* aContent, DocAccessible* aDoc) :
   HyperTextAccessibleWrap(aContent, aDoc)
 {
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsHTMLSelectOptionAccessible: Accessible public
+// HTMLSelectOptionAccessible: Accessible public
 
 role
-nsHTMLSelectOptionAccessible::NativeRole()
+HTMLSelectOptionAccessible::NativeRole()
 {
   if (mParent && mParent->Role() == roles::COMBOBOX_LIST)
     return roles::COMBOBOX_OPTION;
 
   return roles::OPTION;
 }
 
 nsresult
-nsHTMLSelectOptionAccessible::GetNameInternal(nsAString& aName)
+HTMLSelectOptionAccessible::GetNameInternal(nsAString& aName)
 {
   // CASE #1 -- great majority of the cases
   // find the label attribute - this is what the W3C says we should use
   mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::label, aName);
   if (!aName.IsEmpty())
     return NS_OK;
 
   // CASE #2 -- no label parameter, get the first child, 
@@ -216,19 +216,19 @@ nsHTMLSelectOptionAccessible::GetNameInt
     aName.Assign(txtValue);
     return NS_OK;
   }
 
   return NS_OK;
 }
 
 PRUint64
-nsHTMLSelectOptionAccessible::NativeState()
+HTMLSelectOptionAccessible::NativeState()
 {
-  // As a nsHTMLSelectOptionAccessible we can have the following states:
+  // As a HTMLSelectOptionAccessible we can have the following states:
   // SELECTABLE, SELECTED, FOCUSED, FOCUSABLE, OFFSCREEN
   // Upcall to Accessible, but skip HyperTextAccessible impl
   // because we don't want EDITABLE or SELECTABLE_TEXT
   PRUint64 state = Accessible::NativeState();
 
   Accessible* select = GetSelect();
   if (!select)
     return state;
@@ -277,270 +277,271 @@ nsHTMLSelectOptionAccessible::NativeStat
       }
     }
   }
  
   return state;
 }
 
 PRUint64
-nsHTMLSelectOptionAccessible::NativeInteractiveState() const
+HTMLSelectOptionAccessible::NativeInteractiveState() const
 {
   return NativelyUnavailable() ?
     states::UNAVAILABLE : states::FOCUSABLE | states::SELECTABLE;
 }
 
 PRInt32
-nsHTMLSelectOptionAccessible::GetLevelInternal()
+HTMLSelectOptionAccessible::GetLevelInternal()
 {
   nsIContent *parentContent = mContent->GetParent();
 
   PRInt32 level =
     parentContent->NodeInfo()->Equals(nsGkAtoms::optgroup) ? 2 : 1;
 
   if (level == 1 && Role() != roles::HEADING)
     level = 0; // In a single level list, the level is irrelevant
 
   return level;
 }
 
 void
-nsHTMLSelectOptionAccessible::GetBoundsRect(nsRect& aTotalBounds,
-                                            nsIFrame** aBoundingFrame)
+HTMLSelectOptionAccessible::GetBoundsRect(nsRect& aTotalBounds,
+                                          nsIFrame** aBoundingFrame)
 {
   Accessible* combobox = GetCombobox();
   if (combobox && (combobox->State() & states::COLLAPSED))
     combobox->GetBoundsRect(aTotalBounds, aBoundingFrame);
   else
     HyperTextAccessibleWrap::GetBoundsRect(aTotalBounds, aBoundingFrame);
 }
 
-/** select us! close combo box if necessary*/
-NS_IMETHODIMP nsHTMLSelectOptionAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
+NS_IMETHODIMP
+HTMLSelectOptionAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
 {
   if (aIndex == eAction_Select) {
     aName.AssignLiteral("select"); 
     return NS_OK;
   }
   return NS_ERROR_INVALID_ARG;
 }
 
 PRUint8
-nsHTMLSelectOptionAccessible::ActionCount()
+HTMLSelectOptionAccessible::ActionCount()
 {
   return 1;
 }
 
 NS_IMETHODIMP
-nsHTMLSelectOptionAccessible::DoAction(PRUint8 aIndex)
+HTMLSelectOptionAccessible::DoAction(PRUint8 aIndex)
 {
   if (aIndex != eAction_Select)
     return NS_ERROR_INVALID_ARG;
 
   if (IsDefunct())
     return NS_ERROR_FAILURE;
 
   DoCommand();
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsHTMLSelectOptionAccessible::SetSelected(bool aSelect)
+HTMLSelectOptionAccessible::SetSelected(bool aSelect)
 {
   if (IsDefunct())
     return NS_ERROR_FAILURE;
 
   nsCOMPtr<nsIDOMHTMLOptionElement> optionElm(do_QueryInterface(mContent));
   return optionElm->SetSelected(aSelect);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsHTMLSelectOptionAccessible: Widgets
+// HTMLSelectOptionAccessible: Widgets
 
 Accessible*
-nsHTMLSelectOptionAccessible::ContainerWidget() const
+HTMLSelectOptionAccessible::ContainerWidget() const
 {
   return mParent && mParent->IsListControl() ? mParent : nsnull;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsHTMLSelectOptGroupAccessible
+// HTMLSelectOptGroupAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
-nsHTMLSelectOptGroupAccessible::
-  nsHTMLSelectOptGroupAccessible(nsIContent* aContent,
-                                 DocAccessible* aDoc) :
-  nsHTMLSelectOptionAccessible(aContent, aDoc)
+HTMLSelectOptGroupAccessible::
+  HTMLSelectOptGroupAccessible(nsIContent* aContent, DocAccessible* aDoc) :
+  HTMLSelectOptionAccessible(aContent, aDoc)
 {
 }
 
 role
-nsHTMLSelectOptGroupAccessible::NativeRole()
+HTMLSelectOptGroupAccessible::NativeRole()
 {
   return roles::HEADING;
 }
 
 PRUint64
-nsHTMLSelectOptGroupAccessible::NativeInteractiveState() const
+HTMLSelectOptGroupAccessible::NativeInteractiveState() const
 {
   return NativelyUnavailable() ? states::UNAVAILABLE : 0;
 }
 
-NS_IMETHODIMP nsHTMLSelectOptGroupAccessible::DoAction(PRUint8 index)
+NS_IMETHODIMP
+HTMLSelectOptGroupAccessible::DoAction(PRUint8 index)
 {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
-NS_IMETHODIMP nsHTMLSelectOptGroupAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
+NS_IMETHODIMP
+HTMLSelectOptGroupAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
 {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 PRUint8
-nsHTMLSelectOptGroupAccessible::ActionCount()
+HTMLSelectOptGroupAccessible::ActionCount()
 {
   return 0;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsHTMLSelectOptGroupAccessible: Accessible protected
+// HTMLSelectOptGroupAccessible: Accessible protected
 
 void
-nsHTMLSelectOptGroupAccessible::CacheChildren()
+HTMLSelectOptGroupAccessible::CacheChildren()
 {
   // XXX To do (bug 378612) - create text child for the anonymous attribute
   // content, so that nsIAccessibleText is supported for the <optgroup> as it is
   // for an <option>. Attribute content is what layout creates for
   // the label="foo" on the <optgroup>. See eStyleContentType_Attr and
   // CreateAttributeContent() in nsCSSFrameConstructor
 }
 
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsHTMLComboboxAccessible
+// HTMLComboboxAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
-nsHTMLComboboxAccessible::
-  nsHTMLComboboxAccessible(nsIContent* aContent, DocAccessible* aDoc) :
+HTMLComboboxAccessible::
+  HTMLComboboxAccessible(nsIContent* aContent, DocAccessible* aDoc) :
   AccessibleWrap(aContent, aDoc)
 {
   mFlags |= eComboboxAccessible;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsHTMLComboboxAccessible: Accessible
+// HTMLComboboxAccessible: Accessible
 
 role
-nsHTMLComboboxAccessible::NativeRole()
+HTMLComboboxAccessible::NativeRole()
 {
   return roles::COMBOBOX;
 }
 
 void
-nsHTMLComboboxAccessible::InvalidateChildren()
+HTMLComboboxAccessible::InvalidateChildren()
 {
   AccessibleWrap::InvalidateChildren();
 
   if (mListAccessible)
     mListAccessible->InvalidateChildren();
 }
 
 void
-nsHTMLComboboxAccessible::CacheChildren()
+HTMLComboboxAccessible::CacheChildren()
 {
   nsIFrame* frame = GetFrame();
   if (!frame)
     return;
 
   nsIComboboxControlFrame *comboFrame = do_QueryFrame(frame);
   if (!comboFrame)
     return;
 
   nsIFrame *listFrame = comboFrame->GetDropDown();
   if (!listFrame)
     return;
 
   if (!mListAccessible) {
     mListAccessible = 
-      new nsHTMLComboboxListAccessible(mParent, mContent, mDoc);
+      new HTMLComboboxListAccessible(mParent, mContent, mDoc);
 
     // Initialize and put into cache.
     if (!Document()->BindToDocument(mListAccessible, nsnull))
       return;
   }
 
   if (AppendChild(mListAccessible)) {
     // Cache combobox option accessibles so that we build complete accessible
     // tree for combobox.
     mListAccessible->EnsureChildren();
   }
 }
 
 void
-nsHTMLComboboxAccessible::Shutdown()
+HTMLComboboxAccessible::Shutdown()
 {
   AccessibleWrap::Shutdown();
 
   if (mListAccessible) {
     mListAccessible->Shutdown();
     mListAccessible = nsnull;
   }
 }
 
 PRUint64
-nsHTMLComboboxAccessible::NativeState()
+HTMLComboboxAccessible::NativeState()
 {
-  // As a nsHTMLComboboxAccessible we can have the following states:
+  // As a HTMLComboboxAccessible we can have the following states:
   // FOCUSED, FOCUSABLE, HASPOPUP, EXPANDED, COLLAPSED
   // Get focus status from base class
   PRUint64 state = Accessible::NativeState();
 
   nsIComboboxControlFrame* comboFrame = do_QueryFrame(GetFrame());
   if (comboFrame && comboFrame->IsDroppedDown())
     state |= states::EXPANDED;
   else
     state |= states::COLLAPSED;
 
   state |= states::HASPOPUP;
   return state;
 }
 
 void
-nsHTMLComboboxAccessible::Description(nsString& aDescription)
+HTMLComboboxAccessible::Description(nsString& aDescription)
 {
   aDescription.Truncate();
   // First check to see if combo box itself has a description, perhaps through
   // tooltip (title attribute) or via aria-describedby
   Accessible::Description(aDescription);
   if (!aDescription.IsEmpty())
     return;
 
   // Otherwise use description of selected option.
   Accessible* option = SelectedOption();
   if (option)
     option->Description(aDescription);
 }
 
 void
-nsHTMLComboboxAccessible::Value(nsString& aValue)
+HTMLComboboxAccessible::Value(nsString& aValue)
 {
   // Use accessible name of selected option.
   Accessible* option = SelectedOption();
   if (option)
     option->Name(aValue);
 }
 
 PRUint8
-nsHTMLComboboxAccessible::ActionCount()
+HTMLComboboxAccessible::ActionCount()
 {
   return 1;
 }
 
 NS_IMETHODIMP
-nsHTMLComboboxAccessible::DoAction(PRUint8 aIndex)
+HTMLComboboxAccessible::DoAction(PRUint8 aIndex)
 {
   if (aIndex != eAction_Click)
     return NS_ERROR_INVALID_ARG;
 
   if (IsDefunct())
     return NS_ERROR_FAILURE;
 
   DoCommand();
@@ -548,19 +549,20 @@ nsHTMLComboboxAccessible::DoAction(PRUin
 }
 
 /**
   * Our action name is the reverse of our state: 
   *     if we are closed -> open is our name.
   *     if we are open -> closed is our name.
   * Uses the frame to get the state, updated on every click
   */
-NS_IMETHODIMP nsHTMLComboboxAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
+NS_IMETHODIMP
+HTMLComboboxAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
 {
-  if (aIndex != nsHTMLComboboxAccessible::eAction_Click) {
+  if (aIndex != HTMLComboboxAccessible::eAction_Click) {
     return NS_ERROR_INVALID_ARG;
   }
   nsIFrame *frame = GetFrame();
   if (!frame) {
     return NS_ERROR_FAILURE;
   }
   nsIComboboxControlFrame *comboFrame = do_QueryFrame(frame);
   if (!comboFrame) {
@@ -570,55 +572,55 @@ NS_IMETHODIMP nsHTMLComboboxAccessible::
     aName.AssignLiteral("close"); 
   else
     aName.AssignLiteral("open"); 
 
   return NS_OK;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsHTMLComboboxAccessible: Widgets
+// HTMLComboboxAccessible: Widgets
 
 bool
-nsHTMLComboboxAccessible::IsWidget() const
+HTMLComboboxAccessible::IsWidget() const
 {
   return true;
 }
 
 bool
-nsHTMLComboboxAccessible::IsActiveWidget() const
+HTMLComboboxAccessible::IsActiveWidget() const
 {
   return FocusMgr()->HasDOMFocus(mContent);
 }
 
 bool
-nsHTMLComboboxAccessible::AreItemsOperable() const
+HTMLComboboxAccessible::AreItemsOperable() const
 {
   nsIComboboxControlFrame* comboboxFrame = do_QueryFrame(GetFrame());
   return comboboxFrame && comboboxFrame->IsDroppedDown();
 }
 
 Accessible*
-nsHTMLComboboxAccessible::CurrentItem()
+HTMLComboboxAccessible::CurrentItem()
 {
   return AreItemsOperable() ? mListAccessible->CurrentItem() : nsnull;
 }
 
 void
-nsHTMLComboboxAccessible::SetCurrentItem(Accessible* aItem)
+HTMLComboboxAccessible::SetCurrentItem(Accessible* aItem)
 {
   if (AreItemsOperable())
     mListAccessible->SetCurrentItem(aItem);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsHTMLComboboxAccessible: protected
+// HTMLComboboxAccessible: protected
 
 Accessible*
-nsHTMLComboboxAccessible::SelectedOption() const
+HTMLComboboxAccessible::SelectedOption() const
 {
   nsIFrame* frame = GetFrame();
   nsIComboboxControlFrame* comboboxFrame = do_QueryFrame(frame);
   if (!comboboxFrame)
     return nsnull;
 
   nsIListControlFrame* listControlFrame =
     do_QueryFrame(comboboxFrame->GetDropDown());
@@ -631,63 +633,63 @@ nsHTMLComboboxAccessible::SelectedOption
     }
   }
 
   return nsnull;
 }
 
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsHTMLComboboxListAccessible
+// HTMLComboboxListAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
-nsHTMLComboboxListAccessible::
-  nsHTMLComboboxListAccessible(nsIAccessible* aParent, nsIContent* aContent,
-                               DocAccessible* aDoc) :
-  nsHTMLSelectListAccessible(aContent, aDoc)
+HTMLComboboxListAccessible::
+  HTMLComboboxListAccessible(nsIAccessible* aParent, nsIContent* aContent,
+                             DocAccessible* aDoc) :
+  HTMLSelectListAccessible(aContent, aDoc)
 {
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsHTMLComboboxAccessible: nsAccessNode
+// HTMLComboboxAccessible: nsAccessNode
 
 nsIFrame*
-nsHTMLComboboxListAccessible::GetFrame() const
+HTMLComboboxListAccessible::GetFrame() const
 {
-  nsIFrame* frame = nsHTMLSelectListAccessible::GetFrame();
+  nsIFrame* frame = HTMLSelectListAccessible::GetFrame();
 
   if (frame) {
     nsIComboboxControlFrame* comboBox = do_QueryFrame(frame);
     if (comboBox) {
       return comboBox->GetDropDown();
     }
   }
 
   return nsnull;
 }
 
 bool
-nsHTMLComboboxListAccessible::IsPrimaryForNode() const
+HTMLComboboxListAccessible::IsPrimaryForNode() const
 {
   return false;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsHTMLComboboxAccessible: Accessible
+// HTMLComboboxAccessible: Accessible
 
 role
-nsHTMLComboboxListAccessible::NativeRole()
+HTMLComboboxListAccessible::NativeRole()
 {
   return roles::COMBOBOX_LIST;
 }
 
 PRUint64
-nsHTMLComboboxListAccessible::NativeState()
+HTMLComboboxListAccessible::NativeState()
 {
-  // As a nsHTMLComboboxListAccessible we can have the following states:
+  // As a HTMLComboboxListAccessible we can have the following states:
   // FOCUSED, FOCUSABLE, FLOATING, INVISIBLE
   // Get focus status from base class
   PRUint64 state = Accessible::NativeState();
 
   nsIComboboxControlFrame* comboFrame = do_QueryFrame(mParent->GetFrame());
   if (comboFrame && comboFrame->IsDroppedDown())
     state |= states::FLOATING;
   else
@@ -695,26 +697,27 @@ nsHTMLComboboxListAccessible::NativeStat
 
   return state;
 }
 
 /**
   * Gets the bounds for the areaFrame.
   *     Walks the Frame tree and checks for proper frames.
   */
-void nsHTMLComboboxListAccessible::GetBoundsRect(nsRect& aBounds, nsIFrame** aBoundingFrame)
+void
+HTMLComboboxListAccessible::GetBoundsRect(nsRect& aBounds, nsIFrame** aBoundingFrame)
 {
   *aBoundingFrame = nsnull;
 
   Accessible* comboAcc = Parent();
   if (!comboAcc)
     return;
 
   if (0 == (comboAcc->State() & states::COLLAPSED)) {
-    nsHTMLSelectListAccessible::GetBoundsRect(aBounds, aBoundingFrame);
+    HTMLSelectListAccessible::GetBoundsRect(aBounds, aBoundingFrame);
     return;
   }
 
   // Get the first option.
   nsIContent* content = mContent->GetFirstChild();
   if (!content) {
     return;
   }
@@ -724,22 +727,22 @@ void nsHTMLComboboxListAccessible::GetBo
     return;
   }
 
   *aBoundingFrame = frame->GetParent();
   aBounds = (*aBoundingFrame)->GetRect();
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsHTMLComboboxListAccessible: Widgets
+// HTMLComboboxListAccessible: Widgets
 
 bool
-nsHTMLComboboxListAccessible::IsActiveWidget() const
+HTMLComboboxListAccessible::IsActiveWidget() const
 {
   return mParent && mParent->IsActiveWidget();
 }
 
 bool
-nsHTMLComboboxListAccessible::AreItemsOperable() const
+HTMLComboboxListAccessible::AreItemsOperable() const
 {
   return mParent && mParent->AreItemsOperable();
 }
 
rename from accessible/src/html/nsHTMLSelectAccessible.h
rename to accessible/src/html/HTMLSelectAccessible.h
--- a/accessible/src/html/nsHTMLSelectAccessible.h
+++ b/accessible/src/html/HTMLSelectAccessible.h
@@ -1,49 +1,53 @@
 /* -*- 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 __nsHTMLSelectAccessible_h__
-#define __nsHTMLSelectAccessible_h__
+
+#ifndef mozilla_a11y_HTMLSelectAccessible_h__
+#define mozilla_a11y_HTMLSelectAccessible_h__
 
 #include "HTMLFormControlAccessible.h"
 #include "nsIDOMHTMLOptionsCollection.h"
 #include "nsIDOMHTMLOptionElement.h"
 #include "nsIDOMNode.h"
 
 class nsIMutableArray;
 
+namespace mozilla {
+namespace a11y {
+
 /**
   *  Selects, Listboxes and Comboboxes, are made up of a number of different
   *  widgets, some of which are shared between the two. This file contains
-	*  all of the widgets for both of the Selects, for HTML only.
+  *  all of the widgets for both of the Selects, for HTML only.
   *
   *  Listbox:
-  *     - nsHTMLSelectListAccessible
-  *        - nsHTMLSelectOptionAccessible
+  *     - HTMLSelectListAccessible
+  *        - HTMLSelectOptionAccessible
   *
   *  Comboboxes:
-  *     - nsHTMLComboboxAccessible
-  *        - nsHTMLComboboxListAccessible  [ inserted in accessible tree ]
-  *           - nsHTMLSelectOptionAccessible(s)
+  *     - HTMLComboboxAccessible
+  *        - HTMLComboboxListAccessible  [ inserted in accessible tree ]
+  *           - HTMLSelectOptionAccessible(s)
   */
 
 /*
  * The list that contains all the options in the select.
  */
-class nsHTMLSelectListAccessible : public AccessibleWrap
+class HTMLSelectListAccessible : public AccessibleWrap
 {
 public:
-  
-  nsHTMLSelectListAccessible(nsIContent* aContent, DocAccessible* aDoc);
-  virtual ~nsHTMLSelectListAccessible() {}
+
+  HTMLSelectListAccessible(nsIContent* aContent, DocAccessible* aDoc);
+  virtual ~HTMLSelectListAccessible() {}
 
   // Accessible
-  virtual mozilla::a11y::role NativeRole();
+  virtual a11y::role NativeRole();
   virtual PRUint64 NativeState();
 
   // SelectAccessible
   virtual bool IsSelect();
   virtual bool SelectAll();
   virtual bool UnselectAll();
 
   // Widgets
@@ -53,60 +57,60 @@ public:
   virtual Accessible* CurrentItem();
   virtual void SetCurrentItem(Accessible* aItem);
 
 protected:
 
   // Accessible
   virtual void CacheChildren();
 
-  // nsHTMLSelectListAccessible
+  // HTMLSelectListAccessible
 
   /**
    * Recursive helper for CacheChildren().
    */
-  void CacheOptSiblings(nsIContent *aParentContent);
+  void CacheOptSiblings(nsIContent* aParentContent);
 };
 
 /*
  * Options inside the select, contained within the list
  */
-class nsHTMLSelectOptionAccessible : public HyperTextAccessibleWrap
+class HTMLSelectOptionAccessible : public HyperTextAccessibleWrap
 {
 public:
-  enum { eAction_Select = 0 };  
-  
-  nsHTMLSelectOptionAccessible(nsIContent* aContent, DocAccessible* aDoc);
-  virtual ~nsHTMLSelectOptionAccessible() {}
+  enum { eAction_Select = 0 };
+
+  HTMLSelectOptionAccessible(nsIContent* aContent, DocAccessible* aDoc);
+  virtual ~HTMLSelectOptionAccessible() {}
 
   // nsIAccessible
   NS_IMETHOD DoAction(PRUint8 index);
   NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
   NS_IMETHOD SetSelected(bool aSelect);
 
   // Accessible
   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 void GetBoundsRect(nsRect& aTotalBounds, nsIFrame** aBoundingFrame);
 
   // ActionAccessible
   virtual PRUint8 ActionCount();
 
   // Widgets
   virtual Accessible* ContainerWidget() const;
 
 private:
-  
+
   /**
    * Return a select accessible the option belongs to if any.
-   */ 
+   */
   Accessible* GetSelect() const
   {
     if (mParent && mParent->IsListControl()) {
       Accessible* combobox = mParent->Parent();
       return combobox && combobox->IsCombobox() ? combobox : mParent.get();
     }
 
     return nsnull;
@@ -124,67 +128,67 @@ private:
 
     return nsnull;
   }
 };
 
 /*
  * Opt Groups inside the select, contained within the list
  */
-class nsHTMLSelectOptGroupAccessible : public nsHTMLSelectOptionAccessible
+class HTMLSelectOptGroupAccessible : public HTMLSelectOptionAccessible
 {
 public:
 
-  nsHTMLSelectOptGroupAccessible(nsIContent* aContent, DocAccessible* aDoc);
-  virtual ~nsHTMLSelectOptGroupAccessible() {}
+  HTMLSelectOptGroupAccessible(nsIContent* aContent, DocAccessible* aDoc);
+  virtual ~HTMLSelectOptGroupAccessible() {}
 
   // nsIAccessible
-  NS_IMETHOD DoAction(PRUint8 index);  
+  NS_IMETHOD DoAction(PRUint8 index);
   NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
 
   // Accessible
-  virtual mozilla::a11y::role NativeRole();
+  virtual a11y::role NativeRole();
   virtual PRUint64 NativeInteractiveState() const;
 
   // ActionAccessible
   virtual PRUint8 ActionCount();
 
 protected:
   // Accessible
   virtual void CacheChildren();
 };
 
 /** ------------------------------------------------------ */
 /**  Finally, the Combobox widgets                         */
 /** ------------------------------------------------------ */
 
-class nsHTMLComboboxListAccessible;
+class HTMLComboboxListAccessible;
 
 /*
  * A class the represents the HTML Combobox widget.
  */
-class nsHTMLComboboxAccessible : public AccessibleWrap
+class HTMLComboboxAccessible : public AccessibleWrap
 {
 public:
   enum { eAction_Click = 0 };
 
-  nsHTMLComboboxAccessible(nsIContent* aContent, DocAccessible* aDoc);
-  virtual ~nsHTMLComboboxAccessible() {}
+  HTMLComboboxAccessible(nsIContent* aContent, DocAccessible* aDoc);
+  virtual ~HTMLComboboxAccessible() {}
 
   // nsIAccessible
   NS_IMETHOD DoAction(PRUint8 index);
   NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
 
   // nsAccessNode
   virtual void Shutdown();
 
   // Accessible
   virtual void Description(nsString& aDescription);
   virtual void Value(nsString& aValue);
-  virtual mozilla::a11y::role NativeRole();
+  virtual a11y::role NativeRole();
   virtual PRUint64 NativeState();
   virtual void InvalidateChildren();
 
   // ActionAccessible
   virtual PRUint8 ActionCount();
 
   // Widgets
   virtual bool IsWidget() const;
@@ -198,40 +202,42 @@ protected:
   virtual void CacheChildren();
 
   /**
    * Return selected option.
    */
   Accessible* SelectedOption() const;
 
 private:
-  nsRefPtr<nsHTMLComboboxListAccessible> mListAccessible;
+  nsRefPtr<HTMLComboboxListAccessible> mListAccessible;
 };
 
 /*
  * A class that represents the window that lives to the right
  * of the drop down button inside the Select. This is the window
  * that is made visible when the button is pressed.
  */
-class nsHTMLComboboxListAccessible : public nsHTMLSelectListAccessible
+class HTMLComboboxListAccessible : public HTMLSelectListAccessible
 {
 public:
 
-  nsHTMLComboboxListAccessible(nsIAccessible* aParent, 
-                               nsIContent* aContent, 
-                               DocAccessible* aDoc);
-  virtual ~nsHTMLComboboxListAccessible() {}
+  HTMLComboboxListAccessible(nsIAccessible* aParent, nsIContent* aContent,
+                             DocAccessible* aDoc);
+  virtual ~HTMLComboboxListAccessible() {}
 
   // nsAccessNode
   virtual nsIFrame* GetFrame() const;
   virtual bool IsPrimaryForNode() const;
 
   // Accessible
-  virtual mozilla::a11y::role NativeRole();
+  virtual a11y::role NativeRole();
   virtual PRUint64 NativeState();
   virtual void GetBoundsRect(nsRect& aBounds, nsIFrame** aBoundingFrame);
 
   // Widgets
   virtual bool IsActiveWidget() const;
   virtual bool AreItemsOperable() const;
 };
 
+} // namespace a11y
+} // namespace mozilla
+
 #endif
--- a/accessible/src/html/Makefile.in
+++ b/accessible/src/html/Makefile.in
@@ -17,18 +17,18 @@ LIBXUL_LIBRARY = 1
 
 
 CPPSRCS = \
   HTMLElementAccessibles.cpp \
   HTMLFormControlAccessible.cpp \
   HTMLImageMapAccessible.cpp \
   HTMLLinkAccessible.cpp \
   HTMLListAccessible.cpp \
+  HTMLSelectAccessible.cpp \
   nsHTMLCanvasAccessible.cpp \
-  nsHTMLSelectAccessible.cpp \
   nsHTMLTableAccessible.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