diff --git a/accessible/src/html/nsHTMLImageMapAccessible.cpp b/accessible/src/html/nsHTMLImageMapAccessible.cpp index f123b9bf548..c41a5f0f61e 100644 --- a/accessible/src/html/nsHTMLImageMapAccessible.cpp +++ b/accessible/src/html/nsHTMLImageMapAccessible.cpp @@ -152,6 +152,9 @@ nsHTMLImageMapAccessible::CacheChildren() return; } + // We must respect ARIA on area elements (for the canvas map technique) + areaAcc->SetRoleMapEntry(nsAccUtils::GetRoleMapEntry(areaNode)); + mChildren.AppendElement(areaAcc); areaAcc->SetParent(this); } @@ -250,6 +253,19 @@ nsHTMLAreaAccessible::GetBounds(PRInt32 *x, PRInt32 *y, //////////////////////////////////////////////////////////////////////////////// // nsHTMLAreaAccessible: nsAccessible public +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/nsHTMLImageMapAccessible.h b/accessible/src/html/nsHTMLImageMapAccessible.h index cde82ee7fa4..43907e771e1 100644 --- a/accessible/src/html/nsHTMLImageMapAccessible.h +++ b/accessible/src/html/nsHTMLImageMapAccessible.h @@ -92,6 +92,7 @@ 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/tests/mochitest/Makefile.in b/accessible/tests/mochitest/Makefile.in index 2d1f23bba13..5fb2b0c048d 100644 --- a/accessible/tests/mochitest/Makefile.in +++ b/accessible/tests/mochitest/Makefile.in @@ -48,6 +48,7 @@ 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 8b44036f09f..a12e0270bb5 100644 --- a/accessible/tests/mochitest/states/Makefile.in +++ b/accessible/tests/mochitest/states/Makefile.in @@ -47,6 +47,7 @@ include $(topsrcdir)/config/rules.mk _TEST_FILES =\ test_aria.html \ + test_aria_imgmap.html \ test_doc.html \ test_docarticle.html \ test_editablebody.html \ diff --git a/accessible/tests/mochitest/states/test_aria_imgmap.html b/accessible/tests/mochitest/states/test_aria_imgmap.html new file mode 100644 index 00000000000..e42d6291b26 --- /dev/null +++ b/accessible/tests/mochitest/states/test_aria_imgmap.html @@ -0,0 +1,62 @@ + + + + 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 4c2d0292c05..f536668856b 100644 --- a/accessible/tests/mochitest/tree/Makefile.in +++ b/accessible/tests/mochitest/tree/Makefile.in @@ -47,6 +47,7 @@ include $(topsrcdir)/config/rules.mk _TEST_FILES =\ test_aria_globals.html \ + test_aria_imgmap.html \ test_button.xul \ test_colorpicker.xul \ test_combobox.xul \ diff --git a/accessible/tests/mochitest/tree/test_aria_imgmap.html b/accessible/tests/mochitest/tree/test_aria_imgmap.html new file mode 100644 index 00000000000..55fb60a49a4 --- /dev/null +++ b/accessible/tests/mochitest/tree/test_aria_imgmap.html @@ -0,0 +1,99 @@ + + + + Test usemap elements and ARIA + + + + + + + + + + + + + + +Mozilla Bug 548291 + +

+ +
+
+ + + + + + + + + + + + + + +