diff --git a/accessible/src/html/nsHTMLAreaAccessible.cpp b/accessible/src/html/nsHTMLAreaAccessible.cpp
index 376f9f3f18be..f4183a45b1dd 100644
--- a/accessible/src/html/nsHTMLAreaAccessible.cpp
+++ b/accessible/src/html/nsHTMLAreaAccessible.cpp
@@ -138,18 +138,6 @@ nsHTMLAreaAccessible::GetBounds(PRInt32 *x, PRInt32 *y,
////////////////////////////////////////////////////////////////////////////////
// nsAccessible public implementation
-nsresult
-nsHTMLAreaAccessible::GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState)
-{
- // Bypass the link states specialization for non links.
- if (mRoleMapEntry && mRoleMapEntry->role != nsIAccessibleRole::ROLE_NOTHING
- && mRoleMapEntry->role != nsIAccessibleRole::ROLE_LINK) {
- return nsAccessible::GetStateInternal(aState,aExtraState);
- }
-
- return nsHTMLLinkAccessible::GetStateInternal(aState,aExtraState);
-}
-
nsresult
nsHTMLAreaAccessible::GetChildAtPoint(PRInt32 aX, PRInt32 aY,
PRBool aDeepestChild,
diff --git a/accessible/src/html/nsHTMLAreaAccessible.h b/accessible/src/html/nsHTMLAreaAccessible.h
index ff7a0ea9ea4c..2d6a6ef2e22b 100644
--- a/accessible/src/html/nsHTMLAreaAccessible.h
+++ b/accessible/src/html/nsHTMLAreaAccessible.h
@@ -58,7 +58,6 @@ public:
// nsAccessible
virtual nsresult GetNameInternal(nsAString& aName);
- virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
virtual nsresult GetChildAtPoint(PRInt32 aX, PRInt32 aY,
PRBool aDeepestChild,
nsIAccessible **aChild);
diff --git a/accessible/src/html/nsHTMLImageAccessible.cpp b/accessible/src/html/nsHTMLImageAccessible.cpp
index fafddd038e01..b1c9dfe98677 100644
--- a/accessible/src/html/nsHTMLImageAccessible.cpp
+++ b/accessible/src/html/nsHTMLImageAccessible.cpp
@@ -165,15 +165,17 @@ nsHTMLImageAccessible::CacheChildren()
PRUint32 areaCount = 0;
mapAreas->GetLength(&areaCount);
- nsRefPtr areaAccessible;
+ nsCOMPtr areaAccessible;
+ nsRefPtr areaAcc;
for (PRUint32 areaIdx = 0; areaIdx < areaCount; areaIdx++) {
areaAccessible = GetAreaAccessible(mapAreas, areaIdx);
if (!areaAccessible)
return;
- mChildren.AppendElement(areaAccessible);
- areaAccessible->SetParent(this);
+ areaAcc = nsAccUtils::QueryObject(areaAccessible);
+ mChildren.AppendElement(areaAcc);
+ areaAcc->SetParent(this);
}
}
@@ -286,7 +288,8 @@ nsHTMLImageAccessible::GetAnchor(PRInt32 aIndex, nsIAccessible **aAccessible)
nsCOMPtr mapAreas = GetAreaCollection();
if (mapAreas) {
- nsRefPtr accessible = GetAreaAccessible(mapAreas, aIndex);
+ nsCOMPtr accessible;
+ accessible = GetAreaAccessible(mapAreas, aIndex);
if (!accessible)
return NS_ERROR_INVALID_ARG;
@@ -371,7 +374,7 @@ nsHTMLImageAccessible::GetAreaCollection()
return mapAreas;
}
-already_AddRefed
+already_AddRefed
nsHTMLImageAccessible::GetAreaAccessible(nsIDOMHTMLCollection *aAreaCollection,
PRInt32 aAreaNum)
{
@@ -384,28 +387,21 @@ nsHTMLImageAccessible::GetAreaAccessible(nsIDOMHTMLCollection *aAreaCollection,
return nsnull;
void* key = reinterpret_cast(aAreaNum);
- nsRefPtr accessible =
- nsAccUtils::QueryObject(mAccessNodeCache->GetWeak(key));
+ nsRefPtr accessNode = mAccessNodeCache->GetWeak(key);
- if (!accessible) {
- accessible = new nsHTMLAreaAccessible(domNode, this, mWeakShell);
- if (!accessible)
+ if (!accessNode) {
+ accessNode = new nsHTMLAreaAccessible(domNode, this, mWeakShell);
+ if (!accessNode)
return nsnull;
- nsresult rv = accessible->Init();
- if (NS_FAILED(rv)) {
- accessible->Shutdown();
+ nsresult rv = accessNode->Init();
+ if (NS_FAILED(rv))
return nsnull;
- }
- // We should respect ARIA on area elements (for the canvas map technique)
- accessible->SetRoleMapEntry(nsAccUtils::GetRoleMapEntry(domNode));
-
- if (!mAccessNodeCache->Put(key, accessible)) {
- return nsnull;
- }
+ mAccessNodeCache->Put(key, accessNode);
}
+ nsCOMPtr accessible = do_QueryInterface(accessNode);
return accessible.forget();
}
diff --git a/accessible/src/html/nsHTMLImageAccessible.h b/accessible/src/html/nsHTMLImageAccessible.h
index 867e04b82bdf..e735e91ecd4e 100644
--- a/accessible/src/html/nsHTMLImageAccessible.h
+++ b/accessible/src/html/nsHTMLImageAccessible.h
@@ -85,11 +85,7 @@ protected:
// nsHTMLImageAccessible
already_AddRefed GetAreaCollection();
-
- /*
- * Return the accessible for the area element.
- */
- already_AddRefed
+ already_AddRefed
GetAreaAccessible(nsIDOMHTMLCollection* aAreaNodes, PRInt32 aAreaNum);
// Reference on linked map element if any.
diff --git a/accessible/tests/mochitest/Makefile.in b/accessible/tests/mochitest/Makefile.in
index cbf2233aa2e0..5279bba087be 100644
--- a/accessible/tests/mochitest/Makefile.in
+++ b/accessible/tests/mochitest/Makefile.in
@@ -48,7 +48,6 @@ include $(DEPTH)/config/autoconf.mk
include $(topsrcdir)/config/rules.mk
_TEST_FILES =\
- formimage.png \
letters.gif \
moz.png \
$(topsrcdir)/content/media/test/bug461281.ogg \
diff --git a/accessible/tests/mochitest/states/Makefile.in b/accessible/tests/mochitest/states/Makefile.in
index 484dca009edf..8b44036f09f8 100644
--- a/accessible/tests/mochitest/states/Makefile.in
+++ b/accessible/tests/mochitest/states/Makefile.in
@@ -47,7 +47,6 @@ include $(topsrcdir)/config/rules.mk
_TEST_FILES =\
test_aria.html \
- test_aria_imagemap.html \
test_doc.html \
test_docarticle.html \
test_editablebody.html \
diff --git a/accessible/tests/mochitest/states/test_aria_imagemap.html b/accessible/tests/mochitest/states/test_aria_imagemap.html
deleted file mode 100644
index e62d60156b32..000000000000
--- a/accessible/tests/mochitest/states/test_aria_imagemap.html
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
-
- Test usemap elements and ARIA
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Mozilla Bug 548291
-
-
-
-
-
-
-
-
-
-
diff --git a/accessible/tests/mochitest/tree/Makefile.in b/accessible/tests/mochitest/tree/Makefile.in
index 852e4f6b8272..f30df7f55eac 100644
--- a/accessible/tests/mochitest/tree/Makefile.in
+++ b/accessible/tests/mochitest/tree/Makefile.in
@@ -46,7 +46,6 @@ include $(DEPTH)/config/autoconf.mk
include $(topsrcdir)/config/rules.mk
_TEST_FILES =\
- test_aria_imagemap.html \
test_button.xul \
test_colorpicker.xul \
test_combobox.xul \
diff --git a/accessible/tests/mochitest/tree/test_aria_imagemap.html b/accessible/tests/mochitest/tree/test_aria_imagemap.html
deleted file mode 100644
index df436e680543..000000000000
--- a/accessible/tests/mochitest/tree/test_aria_imagemap.html
+++ /dev/null
@@ -1,99 +0,0 @@
-
-
-
- Test usemap elements and ARIA
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Mozilla Bug 548291
-
-
-
-
-
-
-
-
-
-