Bug 759307 - rename nsHTMLImageAccessible to ImageAccessible, r=surkov
authorMark Capella <markcapella@twcny.rr.com>
Sat, 02 Jun 2012 07:30:34 -0400
changeset 97889 d2624fac9886a6b7d1606115514620f5cc2c754b
parent 97888 b3856cc3e4317d4fe7d66db35d6064c1e70711dc
child 97890 6bf12a1bc5f01a7f9d542bd76d16bbed0eff48c1
push idunknown
push userunknown
push dateunknown
reviewerssurkov
bugs759307
milestone15.0a1
Bug 759307 - rename nsHTMLImageAccessible to ImageAccessible, r=surkov
accessible/src/atk/ImageAccessibleWrap.h
accessible/src/atk/nsHTMLImageAccessibleWrap.h
accessible/src/atk/nsMaiInterfaceImage.cpp
accessible/src/base/nsAccessibilityService.cpp
accessible/src/generic/Accessible.h
accessible/src/generic/ImageAccessible.cpp
accessible/src/generic/ImageAccessible.h
accessible/src/generic/Makefile.in
accessible/src/html/Makefile.in
accessible/src/html/nsHTMLImageAccessible.cpp
accessible/src/html/nsHTMLImageAccessible.h
accessible/src/html/nsHTMLImageMapAccessible.cpp
accessible/src/html/nsHTMLImageMapAccessible.h
accessible/src/mac/ImageAccessibleWrap.h
accessible/src/mac/nsHTMLImageAccessibleWrap.h
accessible/src/msaa/ImageAccessibleWrap.cpp
accessible/src/msaa/ImageAccessibleWrap.h
accessible/src/msaa/Makefile.in
accessible/src/msaa/ia2AccessibleImage.cpp
accessible/src/msaa/nsHTMLImageAccessibleWrap.cpp
accessible/src/msaa/nsHTMLImageAccessibleWrap.h
accessible/src/other/ImageAccessibleWrap.h
accessible/src/other/nsHTMLImageAccessibleWrap.h
rename from accessible/src/atk/nsHTMLImageAccessibleWrap.h
rename to accessible/src/atk/ImageAccessibleWrap.h
--- a/accessible/src/atk/nsHTMLImageAccessibleWrap.h
+++ b/accessible/src/atk/ImageAccessibleWrap.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 _NSHTMLIMAGEACCESSIBLEWRAP_H
-#define _NSHTMLIMAGEACCESSIBLEWRAP_H
+#ifndef mozilla_a11y_ImageAccessibleWrap_h__
+#define mozilla_a11y_ImageAccessibleWrap_h__
+
+#include "ImageAccessible.h"
 
-#include "nsHTMLImageAccessible.h"
+namespace mozilla {
+namespace a11y {
 
-typedef class nsHTMLImageAccessible nsHTMLImageAccessibleWrap;
+typedef class ImageAccessible ImageAccessibleWrap;
+
+} // namespace a11y
+} // namespace mozilla
 
 #endif
 
--- a/accessible/src/atk/nsMaiInterfaceImage.cpp
+++ b/accessible/src/atk/nsMaiInterfaceImage.cpp
@@ -2,31 +2,34 @@
 /* vim: set ts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "InterfaceInitFuncs.h"
 
 #include "AccessibleWrap.h"
-#include "nsHTMLImageAccessible.h"
+#include "ImageAccessible.h"
 #include "nsMai.h"
 
+using namespace mozilla;
+using namespace mozilla::a11y;
+
 extern "C" {
 const gchar* getDescriptionCB(AtkObject* aAtkObj);
 
 static void
 getImagePositionCB(AtkImage* aImage, gint* aAccX, gint* aAccY,
                    AtkCoordType aCoordType)
 {
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aImage));
   if (!accWrap || !accWrap->IsImage())
     return;
 
-  nsHTMLImageAccessible* image = accWrap->AsImage();
+  ImageAccessible* image = accWrap->AsImage();
   PRUint32 geckoCoordType = (aCoordType == ATK_XY_WINDOW) ?
     nsIAccessibleCoordinateType::COORDTYPE_WINDOW_RELATIVE :
     nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE;
   // Returned in screen coordinates
   image->GetImagePosition(geckoCoordType, aAccX, aAccY);
 }
 
 static const gchar*
--- a/accessible/src/base/nsAccessibilityService.cpp
+++ b/accessible/src/base/nsAccessibilityService.cpp
@@ -251,17 +251,17 @@ nsAccessibilityService::CreateHTMLFileIn
   return accessible;
 }
 
 already_AddRefed<Accessible>
 nsAccessibilityService::CreateHTMLImageAccessible(nsIContent* aContent,
                                                   nsIPresShell* aPresShell)
 {
   Accessible* accessible =
-    new nsHTMLImageAccessibleWrap(aContent, GetDocAccessible(aPresShell));
+    new ImageAccessibleWrap(aContent, GetDocAccessible(aPresShell));
   NS_ADDREF(accessible);
   return accessible;
 }
 
 already_AddRefed<Accessible>
 nsAccessibilityService::CreateHTMLImageMapAccessible(nsIContent* aContent,
                                                      nsIPresShell* aPresShell)
 {
@@ -1012,17 +1012,17 @@ nsAccessibilityService::GetOrCreateAcces
   if (isHTML && content->Tag() == nsGkAtoms::map) {
     // Create hyper text accessible for HTML map if it is used to group links
     // (see http://www.w3.org/TR/WCAG10-HTML-TECHS/#group-bypass). If the HTML
     // map rect is empty then it is used for links grouping. Otherwise it should
     // be used in conjunction with HTML image element and in this case we don't
     // create any accessible for it and don't walk into it. The accessibles for
     // HTML area (nsHTMLAreaAccessible) the map contains are attached as
     // children of the appropriate accessible for HTML image
-    // (nsHTMLImageAccessible).
+    // (ImageAccessible).
     if (nsLayoutUtils::GetAllInFlowRectsUnion(weakFrame,
                                               weakFrame->GetParent()).IsEmpty()) {
       if (aIsSubtreeHidden)
         *aIsSubtreeHidden = true;
 
       return nsnull;
     }
 
@@ -1356,17 +1356,17 @@ nsAccessibilityService::CreateAccessible
 
     case nsIAccessibleProvider::XULImage:
     {
       // Don't include nameless images in accessible tree.
       if (!aContent->HasAttr(kNameSpaceID_None,
                              nsGkAtoms::tooltiptext))
         return nsnull;
 
-      accessible = new nsHTMLImageAccessibleWrap(aContent, aDoc);
+      accessible = new ImageAccessibleWrap(aContent, aDoc);
       break;
 
     }
     case nsIAccessibleProvider::XULLink:
       accessible = new nsXULLinkAccessible(aContent, aDoc);
       break;
 
     case nsIAccessibleProvider::XULListbox:
--- a/accessible/src/generic/Accessible.h
+++ b/accessible/src/generic/Accessible.h
@@ -22,25 +22,25 @@
 #include "nsRefPtrHashtable.h"
 
 class AccEvent;
 class AccGroupInfo;
 class EmbeddedObjCollector;
 class KeyBinding;
 class Accessible;
 class HyperTextAccessible;
-class nsHTMLImageAccessible;
 class nsHTMLImageMapAccessible;
 struct nsRoleMapEntry;
 class Relation;
 
 namespace mozilla {
 namespace a11y {
 
 class HTMLLIAccessible;
+class ImageAccessible;
 class TableAccessible;
 class TextLeafAccessible;
 
 /**
  * Name type flags.
  */
 enum ENameValueFlag {
   /**
@@ -475,17 +475,17 @@ public:
   HyperTextAccessible* AsHyperText();
 
   inline bool IsHTMLFileInput() const { return mFlags & eHTMLFileInputAccessible; }
 
   inline bool IsHTMLListItem() const { return mFlags & eHTMLListItemAccessible; }
   mozilla::a11y::HTMLLIAccessible* AsHTMLListItem();
 
   inline bool IsImage() const { return mFlags & eImageAccessible; }
-  nsHTMLImageAccessible* AsImage();
+  mozilla::a11y::ImageAccessible* AsImage();
 
   bool IsImageMapAccessible() const { return mFlags & eImageMapAccessible; }
   nsHTMLImageMapAccessible* AsImageMap();
 
   inline bool IsXULTree() const { return mFlags & eXULTreeAccessible; }
   nsXULTreeAccessible* AsXULTree();
 
   inline bool IsListControl() const { return mFlags & eListControlAccessible; }
rename from accessible/src/html/nsHTMLImageAccessible.cpp
rename to accessible/src/generic/ImageAccessible.cpp
--- a/accessible/src/html/nsHTMLImageAccessible.cpp
+++ b/accessible/src/generic/ImageAccessible.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 "nsHTMLImageAccessible.h"
+#include "ImageAccessible.h"
 
 #include "nsAccUtils.h"
 #include "Role.h"
 #include "AccIterator.h"
 #include "States.h"
 
 #include "imgIContainer.h"
 #include "imgIRequest.h"
@@ -20,34 +20,34 @@
 #include "nsIServiceManager.h"
 #include "nsIDOMHTMLImageElement.h"
 #include "nsIDOMDocument.h"
 #include "nsPIDOMWindow.h"
 
 using namespace mozilla::a11y;
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsHTMLImageAccessible
+// ImageAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
-nsHTMLImageAccessible::
-  nsHTMLImageAccessible(nsIContent* aContent, DocAccessible* aDoc) :
+ImageAccessible::
+  ImageAccessible(nsIContent* aContent, DocAccessible* aDoc) :
   nsLinkableAccessible(aContent, aDoc)
 {
   mFlags |= eImageAccessible;
 }
 
-NS_IMPL_ISUPPORTS_INHERITED1(nsHTMLImageAccessible, Accessible,
+NS_IMPL_ISUPPORTS_INHERITED1(ImageAccessible, Accessible,
                              nsIAccessibleImage)
 
 ////////////////////////////////////////////////////////////////////////////////
 // Accessible public
 
 PRUint64
-nsHTMLImageAccessible::NativeState()
+ImageAccessible::NativeState()
 {
   // The state is a bitfield, get our inherited state, then logically OR it with
   // states::ANIMATED if this is an animated image.
 
   PRUint64 state = nsLinkableAccessible::NativeState();
 
   nsCOMPtr<nsIImageLoadingContent> content(do_QueryInterface(mContent));
   nsCOMPtr<imgIRequest> imageRequest;
@@ -66,17 +66,17 @@ nsHTMLImageAccessible::NativeState()
     if (animated)
       state |= states::ANIMATED;
   }
 
   return state;
 }
 
 nsresult
-nsHTMLImageAccessible::GetNameInternal(nsAString& aName)
+ImageAccessible::GetNameInternal(nsAString& aName)
 {
   bool hasAltAttrib =
     mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::alt, aName);
   if (!aName.IsEmpty())
     return NS_OK;
 
   nsresult rv = Accessible::GetNameInternal(aName);
   NS_ENSURE_SUCCESS(rv, rv);
@@ -88,48 +88,48 @@ nsHTMLImageAccessible::GetNameInternal(n
     // nsIAccessible::name attribute for details).
     return NS_OK_EMPTY_NAME;
   }
 
   return NS_OK;
 }
 
 role
-nsHTMLImageAccessible::NativeRole()
+ImageAccessible::NativeRole()
 {
   return roles::GRAPHIC;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsIAccessible
 
 PRUint8
-nsHTMLImageAccessible::ActionCount()
+ImageAccessible::ActionCount()
 {
   PRUint8 actionCount = nsLinkableAccessible::ActionCount();
   return HasLongDesc() ? actionCount + 1 : actionCount;
 }
 
 NS_IMETHODIMP
-nsHTMLImageAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
+ImageAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
 {
   aName.Truncate();
 
   if (IsDefunct())
     return NS_ERROR_FAILURE;
 
   if (IsLongDescIndex(aIndex) && HasLongDesc()) {
     aName.AssignLiteral("showlongdesc"); 
     return NS_OK;
   }
   return nsLinkableAccessible::GetActionName(aIndex, aName);
 }
 
 NS_IMETHODIMP
-nsHTMLImageAccessible::DoAction(PRUint8 aIndex)
+ImageAccessible::DoAction(PRUint8 aIndex)
 {
   if (IsDefunct())
     return NS_ERROR_FAILURE;
 
   // Get the long description uri and open in a new window.
   if (!IsLongDescIndex(aIndex))
     return nsLinkableAccessible::DoAction(aIndex);
 
@@ -144,67 +144,65 @@ nsHTMLImageAccessible::DoAction(PRUint8 
   nsIDocument* document = mContent->OwnerDoc();
   nsCOMPtr<nsPIDOMWindow> piWindow = document->GetWindow();
   nsCOMPtr<nsIDOMWindow> win = do_QueryInterface(piWindow);
   NS_ENSURE_STATE(win);
 
   nsCOMPtr<nsIDOMWindow> tmp;
   return win->Open(spec, EmptyString(), EmptyString(),
                    getter_AddRefs(tmp));
-
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsIAccessibleImage
 
 NS_IMETHODIMP
-nsHTMLImageAccessible::GetImagePosition(PRUint32 aCoordType,
-                                        PRInt32 *aX, PRInt32 *aY)
+ImageAccessible::GetImagePosition(PRUint32 aCoordType, PRInt32* aX, PRInt32* aY)
 {
   PRInt32 width, height;
   nsresult rv = GetBounds(aX, aY, &width, &height);
   if (NS_FAILED(rv))
     return rv;
 
   return nsAccUtils::ConvertScreenCoordsTo(aX, aY, aCoordType, this);
 }
 
 NS_IMETHODIMP
-nsHTMLImageAccessible::GetImageSize(PRInt32 *aWidth, PRInt32 *aHeight)
+ImageAccessible::GetImageSize(PRInt32* aWidth, PRInt32* aHeight)
 {
   PRInt32 x, y;
   return GetBounds(&x, &y, aWidth, aHeight);
 }
 
 // Accessible
 nsresult
-nsHTMLImageAccessible::GetAttributesInternal(nsIPersistentProperties *aAttributes)
+ImageAccessible::GetAttributesInternal(nsIPersistentProperties* aAttributes)
 {
   if (IsDefunct())
     return NS_ERROR_FAILURE;
-  
+
   nsresult rv = nsLinkableAccessible::GetAttributesInternal(aAttributes);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsAutoString src;
   mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::src, src);
   if (!src.IsEmpty())
     nsAccUtils::SetAccAttr(aAttributes, nsGkAtoms::src, src);
 
   return NS_OK;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // Private methods
 
 already_AddRefed<nsIURI>
-nsHTMLImageAccessible::GetLongDescURI() const
+ImageAccessible::GetLongDescURI() const
 {
   if (mContent->HasAttr(kNameSpaceID_None, nsGkAtoms::longdesc)) {
-    nsGenericHTMLElement* element = 
+    nsGenericHTMLElement* element =
       nsGenericHTMLElement::FromContent(mContent);
     if (element) {
       nsCOMPtr<nsIURI> uri;
       element->GetURIAttr(nsGkAtoms::longdesc, nsnull, getter_AddRefs(uri));
       return uri.forget();
     }
   }
 
@@ -223,13 +221,13 @@ nsHTMLImageAccessible::GetLongDescURI() 
       }
     }
   }
 
   return nsnull;
 }
 
 bool
-nsHTMLImageAccessible::IsLongDescIndex(PRUint8 aIndex)
+ImageAccessible::IsLongDescIndex(PRUint8 aIndex)
 {
   return aIndex == nsLinkableAccessible::ActionCount();
 }
 
rename from accessible/src/html/nsHTMLImageAccessible.h
rename to accessible/src/generic/ImageAccessible.h
--- a/accessible/src/html/nsHTMLImageAccessible.h
+++ b/accessible/src/generic/ImageAccessible.h
@@ -1,45 +1,48 @@
 /* -*- 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 _nsHTMLImageAccessible_H_
-#define _nsHTMLImageAccessible_H_
+#ifndef mozilla_a11y_ImageAccessible_h__
+#define mozilla_a11y_ImageAccessible_h__
 
 #include "nsBaseWidgetAccessible.h"
 #include "nsIAccessibleImage.h"
 
 class nsGenericHTMLElement;
 
+namespace mozilla {
+namespace a11y {
+
 /* Accessible for supporting images
  * supports:
  * - gets name, role
  * - support basic state
  */
-class nsHTMLImageAccessible : public nsLinkableAccessible,
-                              public nsIAccessibleImage
+class ImageAccessible : public nsLinkableAccessible,
+                        public nsIAccessibleImage
 {
 public:
-  nsHTMLImageAccessible(nsIContent* aContent, DocAccessible* aDoc);
+  ImageAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIAccessible
   NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
   NS_IMETHOD DoAction(PRUint8 index);
 
   // nsIAccessibleImage
   NS_DECL_NSIACCESSIBLEIMAGE
 
   // Accessible
   virtual nsresult GetNameInternal(nsAString& aName);
-  virtual mozilla::a11y::role NativeRole();
+  virtual a11y::role NativeRole();
   virtual PRUint64 NativeState();
   virtual nsresult GetAttributesInternal(nsIPersistentProperties *aAttributes);
 
   // ActionAccessible
   virtual PRUint8 ActionCount();
 
 private:
   /**
@@ -66,20 +69,23 @@ private:
    * @param aIndex  The 0-based index to be tested.
    *
    * @returns  true if index is valid for longdesc action.
    */
   inline bool IsLongDescIndex(PRUint8 aIndex);
 
 };
 
+} // namespace a11y
+} // namespace mozilla
+
 ////////////////////////////////////////////////////////////////////////////////
 // Accessible downcasting method
 
-inline nsHTMLImageAccessible*
+inline mozilla::a11y::ImageAccessible*
 Accessible::AsImage()
 {
   return IsImage() ?
-    static_cast<nsHTMLImageAccessible*>(this) : nsnull;
+    static_cast<mozilla::a11y::ImageAccessible*>(this) : nsnull;
 }
 
 #endif
 
--- a/accessible/src/generic/Makefile.in
+++ b/accessible/src/generic/Makefile.in
@@ -16,16 +16,17 @@ LIBXUL_LIBRARY = 1
 
 CPPSRCS = \
   Accessible.cpp \
   ApplicationAccessible.cpp \
   ARIAGridAccessible.cpp \
   DocAccessible.cpp \
   FormControlAccessible.cpp \
   HyperTextAccessible.cpp \
+  ImageAccessible.cpp \
   OuterDocAccessible.cpp \
   RootAccessible.cpp \
   TextLeafAccessible.cpp \
   $(NULL)
 
 EXPORTS_NAMESPACES = mozilla/a11y
 
 EXPORTS_mozilla/a11y = \
@@ -37,16 +38,18 @@ FORCE_STATIC_LIB = 1
 
 include $(topsrcdir)/config/rules.mk
 
 LOCAL_INCLUDES = \
   -I$(srcdir)/../xpcom \
   -I$(srcdir)/../base \
   -I$(srcdir)/../html \
   -I$(srcdir)/../xul \
+  -I$(srcdir)/../../../content/base/src \
+  -I$(srcdir)/../../../content/html/content/src \
   -I$(srcdir)/../../../layout/generic \
   -I$(srcdir)/../../../layout/xul/base/src \
   $(NULL)
 
 ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2)
 LOCAL_INCLUDES += \
   -I$(srcdir)/../atk \
   $(NULL)
--- a/accessible/src/html/Makefile.in
+++ b/accessible/src/html/Makefile.in
@@ -16,33 +16,31 @@ LIBXUL_LIBRARY = 1
 
 
 
 CPPSRCS = \
   HTMLElementAccessibles.cpp \
   HTMLFormControlAccessible.cpp \
   HTMLListAccessible.cpp \
   nsHTMLCanvasAccessible.cpp \
-  nsHTMLImageAccessible.cpp \
   nsHTMLImageMapAccessible.cpp \
   nsHTMLLinkAccessible.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
 
 LOCAL_INCLUDES = \
   -I$(srcdir)/../base \
   -I$(srcdir)/../generic \
   -I$(srcdir)/../xpcom \
-  -I$(srcdir)/../../../content/base/src \
   -I$(srcdir)/../../../content/html/content/src \
   -I$(srcdir)/../../../layout/generic \
   -I$(srcdir)/../../../layout/xul/base/src \
   $(NULL)
 
 ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2)
 LOCAL_INCLUDES += \
   -I$(srcdir)/../atk \
--- a/accessible/src/html/nsHTMLImageMapAccessible.cpp
+++ b/accessible/src/html/nsHTMLImageMapAccessible.cpp
@@ -21,25 +21,25 @@
 using namespace mozilla::a11y;
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsHTMLImageMapAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
 nsHTMLImageMapAccessible::
   nsHTMLImageMapAccessible(nsIContent* aContent, DocAccessible* aDoc) :
-  nsHTMLImageAccessibleWrap(aContent, aDoc)
+  ImageAccessibleWrap(aContent, aDoc)
 {
   mFlags |= eImageMapAccessible;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsHTMLImageMapAccessible: nsISupports
 
-NS_IMPL_ISUPPORTS_INHERITED0(nsHTMLImageMapAccessible, nsHTMLImageAccessible)
+NS_IMPL_ISUPPORTS_INHERITED0(nsHTMLImageMapAccessible, ImageAccessible)
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsHTMLImageMapAccessible: Accessible public
 
 role
 nsHTMLImageMapAccessible::NativeRole()
 {
   return roles::IMAGE_MAP;
@@ -174,17 +174,17 @@ nsHTMLAreaAccessible::GetNameInternal(ns
 
 void
 nsHTMLAreaAccessible::Description(nsString& aDescription)
 {
   aDescription.Truncate();
 
   // Still to do - follow IE's standard here
   nsCOMPtr<nsIDOMHTMLAreaElement> area(do_QueryInterface(mContent));
-  if (area) 
+  if (area)
     area->GetShape(aDescription);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsHTMLAreaAccessible: nsAccessNode public
 
 bool
 nsHTMLAreaAccessible::IsPrimaryForNode() const
--- a/accessible/src/html/nsHTMLImageMapAccessible.h
+++ b/accessible/src/html/nsHTMLImageMapAccessible.h
@@ -1,25 +1,25 @@
 /* -*- 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 _nsHTMLAreaAccessible_H_
 #define _nsHTMLAreaAccessible_H_
 
+#include "ImageAccessibleWrap.h"
 #include "nsHTMLLinkAccessible.h"
-#include "nsHTMLImageAccessibleWrap.h"
 
 #include "nsIDOMHTMLMapElement.h"
 
 /**
  * Used for HTML image maps.
  */
-class nsHTMLImageMapAccessible : public nsHTMLImageAccessibleWrap
+class nsHTMLImageMapAccessible : public mozilla::a11y::ImageAccessibleWrap
 {
 public:
   nsHTMLImageMapAccessible(nsIContent* aContent, DocAccessible* aDoc);
   virtual ~nsHTMLImageMapAccessible() { }
 
   // nsISupports and cycle collector
   NS_DECL_ISUPPORTS_INHERITED
 
@@ -77,9 +77,9 @@ public:
   virtual PRUint32 EndOffset();
 
 protected:
 
   // Accessible
   virtual void CacheChildren();
 };
 
-#endif  
+#endif
rename from accessible/src/mac/nsHTMLImageAccessibleWrap.h
rename to accessible/src/mac/ImageAccessibleWrap.h
--- a/accessible/src/mac/nsHTMLImageAccessibleWrap.h
+++ b/accessible/src/mac/ImageAccessibleWrap.h
@@ -1,16 +1,22 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim:expandtab:shiftwidth=2:tabstop=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 _NSHTMLIMAGEACCESSIBLEWRAP_H
-#define _NSHTMLIMAGEACCESSIBLEWRAP_H
+#ifndef mozilla_a11y_ImageAccessibleWrap_h__
+#define mozilla_a11y_ImageAccessibleWrap_h__
+
+#include "ImageAccessible.h"
 
-#include "nsHTMLImageAccessible.h"
+namespace mozilla {
+namespace a11y {
 
-typedef class nsHTMLImageAccessible nsHTMLImageAccessibleWrap;
+typedef class ImageAccessible ImageAccessibleWrap;
+
+} // namespace a11y
+} // namespace mozilla
 
 #endif
 
rename from accessible/src/msaa/nsHTMLImageAccessibleWrap.cpp
rename to accessible/src/msaa/ImageAccessibleWrap.cpp
--- a/accessible/src/msaa/nsHTMLImageAccessibleWrap.cpp
+++ b/accessible/src/msaa/ImageAccessibleWrap.cpp
@@ -1,16 +1,19 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim:expandtab:shiftwidth=2:tabstop=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 "nsHTMLImageAccessibleWrap.h"
+#include "ImageAccessibleWrap.h"
+
+using namespace mozilla;
+using namespace mozilla::a11y;
 
-NS_IMPL_ISUPPORTS_INHERITED0(nsHTMLImageAccessibleWrap,
-                             nsHTMLImageAccessible)
+NS_IMPL_ISUPPORTS_INHERITED0(ImageAccessibleWrap,
+                             ImageAccessible)
 
-IMPL_IUNKNOWN_INHERITED1(nsHTMLImageAccessibleWrap,
+IMPL_IUNKNOWN_INHERITED1(ImageAccessibleWrap,
                          AccessibleWrap,
                          ia2AccessibleImage);
 
rename from accessible/src/msaa/nsHTMLImageAccessibleWrap.h
rename to accessible/src/msaa/ImageAccessibleWrap.h
--- a/accessible/src/msaa/nsHTMLImageAccessibleWrap.h
+++ b/accessible/src/msaa/ImageAccessibleWrap.h
@@ -1,29 +1,35 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim:expandtab:shiftwidth=2:tabstop=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 _NSHTMLIMAGEACCESSIBLEWRAP_H
-#define _NSHTMLIMAGEACCESSIBLEWRAP_H
+#ifndef mozilla_a11y_ImageAccessibleWrap_h__
+#define mozilla_a11y_ImageAccessibleWrap_h__
 
-#include "nsHTMLImageAccessible.h"
+#include "ImageAccessible.h"
 #include "ia2AccessibleImage.h"
 
-class nsHTMLImageAccessibleWrap : public nsHTMLImageAccessible,
-                                  public ia2AccessibleImage
+namespace mozilla {
+namespace a11y {
+
+class ImageAccessibleWrap : public ImageAccessible,
+                            public ia2AccessibleImage
 {
 public:
-  nsHTMLImageAccessibleWrap(nsIContent* aContent, DocAccessible* aDoc) :
-    nsHTMLImageAccessible(aContent, aDoc) {}
+  ImageAccessibleWrap(nsIContent* aContent, DocAccessible* aDoc) :
+    ImageAccessible(aContent, aDoc) {}
 
   // IUnknown
   DECL_IUNKNOWN_INHERITED
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 };
 
+} // namespace a11y
+} // namespace mozilla
+
 #endif
 
--- a/accessible/src/msaa/Makefile.in
+++ b/accessible/src/msaa/Makefile.in
@@ -16,22 +16,22 @@ LIBXUL_LIBRARY = 1
 
 
 CPPSRCS = \
   AccessibleWrap.cpp \
   ApplicationAccessibleWrap.cpp \
   ARIAGridAccessibleWrap.cpp \
   DocAccessibleWrap.cpp \
   HyperTextAccessibleWrap.cpp \
+  ImageAccessibleWrap.cpp \
   nsAccessNodeWrap.cpp \
   nsHTMLWin32ObjectAccessible.cpp \
   nsXULMenuAccessibleWrap.cpp \
   nsXULListboxAccessibleWrap.cpp \
   nsXULTreeGridAccessibleWrap.cpp \
-  nsHTMLImageAccessibleWrap.cpp \
   nsHTMLTableAccessibleWrap.cpp \
   nsWinUtils.cpp \
   CAccessibleText.cpp \
   CAccessibleEditableText.cpp \
   CAccessibleHyperlink.cpp \
   CAccessibleTable.cpp \
   CAccessibleTableCell.cpp \
   CAccessibleValue.cpp \
--- a/accessible/src/msaa/ia2AccessibleImage.cpp
+++ b/accessible/src/msaa/ia2AccessibleImage.cpp
@@ -4,26 +4,28 @@
 /* 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 "ia2AccessibleImage.h"
 
 #include "AccessibleImage_i.c"
 
-#include "nsHTMLImageAccessibleWrap.h"
-#include "nsHTMLImageAccessible.h"
+#include "ImageAccessibleWrap.h"
 
 #include "nsIAccessible.h"
 #include "nsIAccessibleImage.h"
 #include "nsIAccessibleTypes.h"
 #include "nsAccessNodeWrap.h"
 
 #include "nsString.h"
 
+using namespace mozilla;
+using namespace mozilla::a11y;
+
 // IUnknown
 
 STDMETHODIMP
 ia2AccessibleImage::QueryInterface(REFIID iid, void** ppv)
 {
   *ppv = NULL;
 
   if (IID_IAccessibleImage == iid) {
@@ -38,18 +40,17 @@ ia2AccessibleImage::QueryInterface(REFII
 // IAccessibleImage
 
 STDMETHODIMP
 ia2AccessibleImage::get_description(BSTR* aDescription)
 {
 __try {
   *aDescription = NULL;
 
-  nsHTMLImageAccessibleWrap* acc =
-    static_cast<nsHTMLImageAccessibleWrap*>(this);
+  ImageAccessibleWrap* acc = static_cast<ImageAccessibleWrap*>(this);
   if (acc->IsDefunct())
     return CO_E_OBJNOTCONNECTED;
 
   nsAutoString description;
   nsresult rv = acc->GetName(description);
   if (NS_FAILED(rv))
     return GetHRESULT(rv);
 
@@ -67,18 +68,17 @@ STDMETHODIMP
 ia2AccessibleImage::get_imagePosition(enum IA2CoordinateType aCoordType,
                                       long* aX,
                                       long* aY)
 {
 __try {
   *aX = 0;
   *aY = 0;
 
-  nsHTMLImageAccessibleWrap* imageAcc =
-    static_cast<nsHTMLImageAccessibleWrap*>(this);
+  ImageAccessibleWrap* imageAcc = static_cast<ImageAccessibleWrap*>(this);
   if (imageAcc->IsDefunct())
     return CO_E_OBJNOTCONNECTED;
 
   PRUint32 geckoCoordType = (aCoordType == IA2_COORDTYPE_SCREEN_RELATIVE) ?
     nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE :
     nsIAccessibleCoordinateType::COORDTYPE_PARENT_RELATIVE;
   PRInt32 x = 0, y = 0;
 
@@ -97,18 +97,17 @@ ia2AccessibleImage::get_imagePosition(en
 
 STDMETHODIMP
 ia2AccessibleImage::get_imageSize(long* aHeight, long* aWidth)
 {
 __try {
   *aHeight = 0;
   *aWidth = 0;
 
-  nsHTMLImageAccessibleWrap* imageAcc =
-    static_cast<nsHTMLImageAccessibleWrap*>(this);
+  ImageAccessibleWrap* imageAcc = static_cast<ImageAccessibleWrap*>(this);
   if (imageAcc->IsDefunct())
     return CO_E_OBJNOTCONNECTED;
 
   PRInt32 width = 0, height = 0;
   nsresult rv = imageAcc->GetImageSize(&width, &height);
   if (NS_FAILED(rv))
     return GetHRESULT(rv);
 
rename from accessible/src/other/nsHTMLImageAccessibleWrap.h
rename to accessible/src/other/ImageAccessibleWrap.h
--- a/accessible/src/other/nsHTMLImageAccessibleWrap.h
+++ b/accessible/src/other/ImageAccessibleWrap.h
@@ -1,16 +1,22 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim:expandtab:shiftwidth=2:tabstop=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 _NSHTMLIMAGEACCESSIBLEWRAP_H
-#define _NSHTMLIMAGEACCESSIBLEWRAP_H
+#ifndef mozilla_a11y_ImageAccessibleWrap_h__
+#define mozilla_a11y_ImageAccessibleWrap_h__
+
+#include "ImageAccessible.h"
 
-#include "nsHTMLImageAccessible.h"
+namespace mozilla {
+namespace a11y {
 
-typedef class nsHTMLImageAccessible nsHTMLImageAccessibleWrap;
+typedef class ImageAccessible ImageAccessibleWrap;
+
+} // namespace a11y
+} // namespace mozilla
 
 #endif