Bug 762754 - rename nsXULTextAccessible files to XULEelementAccessibles, r=surkov
authorMark Capella <markcapella@twcny.rr.com>
Sat, 09 Jun 2012 04:21:00 -0400
changeset 101046 e6dedc30b9c38bf2f1c397ba921205fac2665af9
parent 101045 5a24f04189b55793e97dc93b2712be958ad4ed24
child 101047 8ca3fe2207098e67385c41bd728a9abe086c648e
push id1316
push userakeybl@mozilla.com
push dateMon, 27 Aug 2012 22:37:00 +0000
treeherdermozilla-beta@db4b09302ee2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssurkov
bugs762754
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 762754 - rename nsXULTextAccessible files to XULEelementAccessibles, r=surkov
accessible/src/base/nsAccessibilityService.cpp
accessible/src/xul/Makefile.in
accessible/src/xul/XULElementAccessibles.cpp
accessible/src/xul/XULElementAccessibles.h
accessible/src/xul/nsXULTextAccessible.cpp
accessible/src/xul/nsXULTextAccessible.h
--- a/accessible/src/base/nsAccessibilityService.cpp
+++ b/accessible/src/base/nsAccessibilityService.cpp
@@ -70,17 +70,17 @@
 #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 "nsXULTextAccessible.h"
+#include "XULElementAccessibles.h"
 #include "XULTreeGridAccessibleWrap.h"
 #endif
 
 using namespace mozilla;
 using namespace mozilla::a11y;
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsAccessibilityService
@@ -1351,17 +1351,17 @@ nsAccessibilityService::CreateAccessible
                              nsGkAtoms::tooltiptext))
         return nsnull;
 
       accessible = new ImageAccessibleWrap(aContent, aDoc);
       break;
 
     }
     case nsIAccessibleProvider::XULLink:
-      accessible = new nsXULLinkAccessible(aContent, aDoc);
+      accessible = new XULLinkAccessible(aContent, aDoc);
       break;
 
     case nsIAccessibleProvider::XULListbox:
       accessible = new nsXULListboxAccessibleWrap(aContent, aDoc);
       break;
 
     case nsIAccessibleProvider::XULListCell:
       accessible = new nsXULListCellAccessibleWrap(aContent, aDoc);
@@ -1440,17 +1440,17 @@ nsAccessibilityService::CreateAccessible
       accessible = new nsXULTabsAccessible(aContent, aDoc);
       break;
 
     case nsIAccessibleProvider::XULTabpanels:
       accessible = new nsXULTabpanelsAccessible(aContent, aDoc);
       break;
 
     case nsIAccessibleProvider::XULText:
-      accessible = new nsXULTextAccessible(aContent, aDoc);
+      accessible = new XULLabelAccessible(aContent, aDoc);
       break;
 
     case nsIAccessibleProvider::XULTextBox:
       accessible = new XULTextFieldAccessible(aContent, aDoc);
       break;
 
     case nsIAccessibleProvider::XULThumb:
       accessible = new nsXULThumbAccessible(aContent, aDoc);
@@ -1471,17 +1471,17 @@ nsAccessibilityService::CreateAccessible
       accessible = new XULToolbarAccessible(aContent, aDoc);
       break;
 
     case nsIAccessibleProvider::XULToolbarSeparator:
       accessible = new XULToolbarSeparatorAccessible(aContent, aDoc);
       break;
 
     case nsIAccessibleProvider::XULTooltip:
-      accessible = new nsXULTooltipAccessible(aContent, aDoc);
+      accessible = new XULTooltipAccessible(aContent, aDoc);
       break;
 
     case nsIAccessibleProvider::XULToolbarButton:
       accessible = new XULToolbarButtonAccessible(aContent, aDoc);
       break;
 
 #endif // MOZ_XUL
 
--- a/accessible/src/xul/Makefile.in
+++ b/accessible/src/xul/Makefile.in
@@ -21,17 +21,17 @@ CPPSRCS = \
   nsXULAlertAccessible.cpp \
   nsXULColorPickerAccessible.cpp \
   nsXULComboboxAccessible.cpp \
   XULFormControlAccessible.cpp \
   nsXULListboxAccessible.cpp \
   nsXULMenuAccessible.cpp \
   nsXULSliderAccessible.cpp \
   nsXULTabAccessible.cpp \
-  nsXULTextAccessible.cpp \
+  XULElementAccessibles.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
rename from accessible/src/xul/nsXULTextAccessible.cpp
rename to accessible/src/xul/XULElementAccessibles.cpp
--- a/accessible/src/xul/nsXULTextAccessible.cpp
+++ b/accessible/src/xul/XULElementAccessibles.cpp
@@ -1,15 +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/. */
 
-// NOTE: groups are alphabetically ordered
-#include "nsXULTextAccessible.h"
+#include "XULElementAccessibles.h"
 
 #include "Accessible-inl.h"
 #include "BaseAccessibles.h"
 #include "nsAccUtils.h"
 #include "nsCoreUtils.h"
 #include "nsTextEquivUtils.h"
 #include "Relation.h"
 #include "Role.h"
@@ -19,50 +18,50 @@
 #include "nsIDOMXULDescriptionElement.h"
 #include "nsINameSpaceManager.h"
 #include "nsString.h"
 #include "nsNetUtil.h"
 
 using namespace mozilla::a11y;
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsXULTextAccessible
+// XULLabelAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
-nsXULTextAccessible::
-  nsXULTextAccessible(nsIContent* aContent, DocAccessible* aDoc) :
+XULLabelAccessible::
+  XULLabelAccessible(nsIContent* aContent, DocAccessible* aDoc) :
   HyperTextAccessibleWrap(aContent, aDoc)
 {
 }
 
 nsresult
-nsXULTextAccessible::GetNameInternal(nsAString& aName)
+XULLabelAccessible::GetNameInternal(nsAString& aName)
 {
   // if the value attr doesn't exist, the screen reader must get the accessible text
   // from the accessible text interface or from the children
   mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::value, aName);
   return NS_OK;
 }
 
 role
-nsXULTextAccessible::NativeRole()
+XULLabelAccessible::NativeRole()
 {
   return roles::LABEL;
 }
 
 PRUint64
-nsXULTextAccessible::NativeState()
+XULLabelAccessible::NativeState()
 {
   // Labels and description have read only state
   // They are not focusable or selectable
   return HyperTextAccessibleWrap::NativeState() | states::READONLY;
 }
 
 Relation
-nsXULTextAccessible::RelationByType(PRUint32 aType)
+XULLabelAccessible::RelationByType(PRUint32 aType)
 {
   Relation rel = HyperTextAccessibleWrap::RelationByType(aType);
   if (aType == nsIAccessibleRelation::RELATION_LABEL_FOR) {
     // Caption is the label for groupbox
     nsIContent *parent = mContent->GetParent();
     if (parent && parent->Tag() == nsGkAtoms::caption) {
       Accessible* parent = Parent();
       if (parent && parent->Role() == roles::GROUPING)
@@ -70,150 +69,150 @@ nsXULTextAccessible::RelationByType(PRUi
     }
   }
 
   return rel;
 }
 
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsXULTooltipAccessible
+// XULTooltipAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
-nsXULTooltipAccessible::
-  nsXULTooltipAccessible(nsIContent* aContent, DocAccessible* aDoc) :
+XULTooltipAccessible::
+  XULTooltipAccessible(nsIContent* aContent, DocAccessible* aDoc) :
   LeafAccessible(aContent, aDoc)
 {
 }
 
 PRUint64
-nsXULTooltipAccessible::NativeState()
+XULTooltipAccessible::NativeState()
 {
   return LeafAccessible::NativeState() | states::READONLY;
 }
 
 role
-nsXULTooltipAccessible::NativeRole()
+XULTooltipAccessible::NativeRole()
 {
   return roles::TOOLTIP;
 }
 
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsXULLinkAccessible
+// XULLinkAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
-nsXULLinkAccessible::
-  nsXULLinkAccessible(nsIContent* aContent, DocAccessible* aDoc) :
+XULLinkAccessible::
+  XULLinkAccessible(nsIContent* aContent, DocAccessible* aDoc) :
   HyperTextAccessibleWrap(aContent, aDoc)
 {
 }
 
 // Expose nsIAccessibleHyperLink unconditionally
-NS_IMPL_ISUPPORTS_INHERITED1(nsXULLinkAccessible, HyperTextAccessibleWrap,
+NS_IMPL_ISUPPORTS_INHERITED1(XULLinkAccessible, HyperTextAccessibleWrap,
                              nsIAccessibleHyperLink)
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsXULLinkAccessible. nsIAccessible
+// XULLinkAccessible. nsIAccessible
 
 void
-nsXULLinkAccessible::Value(nsString& aValue)
+XULLinkAccessible::Value(nsString& aValue)
 {
   aValue.Truncate();
 
   mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::href, aValue);
 }
 
 nsresult
-nsXULLinkAccessible::GetNameInternal(nsAString& aName)
+XULLinkAccessible::GetNameInternal(nsAString& aName)
 {
   mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::value, aName);
   if (!aName.IsEmpty())
     return NS_OK;
 
   return nsTextEquivUtils::GetNameFromSubtree(this, aName);
 }
 
 role
-nsXULLinkAccessible::NativeRole()
+XULLinkAccessible::NativeRole()
 {
   return roles::LINK;
 }
 
 
 PRUint64
-nsXULLinkAccessible::NativeLinkState() const
+XULLinkAccessible::NativeLinkState() const
 {
   return states::LINKED;
 }
 
 PRUint8
-nsXULLinkAccessible::ActionCount()
+XULLinkAccessible::ActionCount()
 {
   return 1;
 }
 
 NS_IMETHODIMP
-nsXULLinkAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
+XULLinkAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
 {
   aName.Truncate();
 
   if (aIndex != eAction_Jump)
     return NS_ERROR_INVALID_ARG;
-  
+
   aName.AssignLiteral("jump");
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsXULLinkAccessible::DoAction(PRUint8 aIndex)
+XULLinkAccessible::DoAction(PRUint8 aIndex)
 {
   if (aIndex != eAction_Jump)
     return NS_ERROR_INVALID_ARG;
 
   if (IsDefunct())
     return NS_ERROR_FAILURE;
 
   DoCommand();
   return NS_OK;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsXULLinkAccessible: HyperLinkAccessible
+// XULLinkAccessible: HyperLinkAccessible
 
 bool
-nsXULLinkAccessible::IsLink()
+XULLinkAccessible::IsLink()
 {
   // Expose HyperLinkAccessible unconditionally.
   return true;
 }
 
 PRUint32
-nsXULLinkAccessible::StartOffset()
+XULLinkAccessible::StartOffset()
 {
   // If XUL link accessible is not contained by hypertext accessible then
   // start offset matches index in parent because the parent doesn't contains
   // a text.
   // XXX: accessible parent of XUL link accessible should be a hypertext
   // accessible.
   if (Accessible::IsLink())
     return Accessible::StartOffset();
   return IndexInParent();
 }
 
 PRUint32
-nsXULLinkAccessible::EndOffset()
+XULLinkAccessible::EndOffset()
 {
   if (Accessible::IsLink())
     return Accessible::EndOffset();
   return IndexInParent() + 1;
 }
 
 already_AddRefed<nsIURI>
-nsXULLinkAccessible::AnchorURIAt(PRUint32 aAnchorIndex)
+XULLinkAccessible::AnchorURIAt(PRUint32 aAnchorIndex)
 {
   if (aAnchorIndex != 0)
     return nsnull;
 
   nsAutoString href;
   mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::href, href);
 
   nsCOMPtr<nsIURI> baseURI = mContent->GetBaseURI();
rename from accessible/src/xul/nsXULTextAccessible.h
rename to accessible/src/xul/XULElementAccessibles.h
--- a/accessible/src/xul/nsXULTextAccessible.h
+++ b/accessible/src/xul/XULElementAccessibles.h
@@ -1,73 +1,79 @@
 /* -*- 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 _nsXULTextAccessible_H_
-#define _nsXULTextAccessible_H_
+#ifndef mozilla_a11y_XULElementAccessibles_h__
+#define mozilla_a11y_XULElementAccessibles_h__
 
 #include "BaseAccessibles.h"
 #include "HyperTextAccessibleWrap.h"
 
+namespace mozilla {
+namespace a11y {
+
 /**
  * Used for XUL description and label elements.
  */
-class nsXULTextAccessible : public HyperTextAccessibleWrap
+class XULLabelAccessible : public HyperTextAccessibleWrap
 {
 public:
-  nsXULTextAccessible(nsIContent* aContent, DocAccessible* aDoc);
+  XULLabelAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
   virtual nsresult GetNameInternal(nsAString& aName);
-  virtual mozilla::a11y::role NativeRole();
+  virtual a11y::role NativeRole();
   virtual PRUint64 NativeState();
   virtual Relation RelationByType(PRUint32 aRelationType);
 };
 
 /**
  * Used for XUL tooltip element.
  */
-class nsXULTooltipAccessible : public mozilla::a11y::LeafAccessible
+class XULTooltipAccessible : public LeafAccessible
 {
 
 public:
-  nsXULTooltipAccessible(nsIContent* aContent, DocAccessible* aDoc);
+  XULTooltipAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
-  virtual mozilla::a11y::role NativeRole();
+  virtual a11y::role NativeRole();
   virtual PRUint64 NativeState();
 };
 
-class nsXULLinkAccessible : public HyperTextAccessibleWrap
+class XULLinkAccessible : public HyperTextAccessibleWrap
 {
 
 public:
-  nsXULLinkAccessible(nsIContent* aContent, DocAccessible* aDoc);
+  XULLinkAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIAccessible
   NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
   NS_IMETHOD DoAction(PRUint8 aIndex);
 
   // Accessible
   virtual void Value(nsString& aValue);
   virtual nsresult GetNameInternal(nsAString& aName);
-  virtual mozilla::a11y::role NativeRole();
+  virtual a11y::role NativeRole();
   virtual PRUint64 NativeLinkState() const;
 
   // ActionAccessible
   virtual PRUint8 ActionCount();
 
   // HyperLinkAccessible
   virtual bool IsLink();
   virtual PRUint32 StartOffset();
   virtual PRUint32 EndOffset();
   virtual already_AddRefed<nsIURI> AnchorURIAt(PRUint32 aAnchorIndex);
 
 protected:
   enum { eAction_Jump = 0 };
 
 };
 
-#endif  
+} // namespace a11y
+} // namespace mozilla
+
+#endif