diff --git a/accessible/src/html/nsHTMLFormControlAccessible.cpp b/accessible/src/html/nsHTMLFormControlAccessible.cpp index 7fbdccd195b..0962981d465 100644 --- a/accessible/src/html/nsHTMLFormControlAccessible.cpp +++ b/accessible/src/html/nsHTMLFormControlAccessible.cpp @@ -373,6 +373,8 @@ nsHyperTextAccessibleWrap(aNode, aShell) { } +NS_IMPL_ISUPPORTS_INHERITED3(nsHTMLTextFieldAccessible, nsAccessible, nsHyperTextAccessible, nsIAccessibleText, nsIAccessibleEditableText) + NS_IMETHODIMP nsHTMLTextFieldAccessible::GetRole(PRUint32 *aRole) { *aRole = nsIAccessibleRole::ROLE_ENTRY; diff --git a/accessible/src/html/nsHTMLFormControlAccessible.h b/accessible/src/html/nsHTMLFormControlAccessible.h index 6ad322f62d7..b3fc167a775 100644 --- a/accessible/src/html/nsHTMLFormControlAccessible.h +++ b/accessible/src/html/nsHTMLFormControlAccessible.h @@ -104,6 +104,8 @@ public: nsHTMLTextFieldAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell); + NS_DECL_ISUPPORTS_INHERITED + NS_IMETHOD GetRole(PRUint32 *_retval); NS_IMETHOD GetName(nsAString& aName); NS_IMETHOD GetValue(nsAString& _retval); diff --git a/accessible/src/html/nsHTMLImageAccessible.cpp b/accessible/src/html/nsHTMLImageAccessible.cpp index db428f670fa..915cfb83d13 100644 --- a/accessible/src/html/nsHTMLImageAccessible.cpp +++ b/accessible/src/html/nsHTMLImageAccessible.cpp @@ -84,7 +84,7 @@ nsLinkableAccessible(aDOMNode, aShell), mAccessNodeCache(nsnull) } } -NS_IMPL_ISUPPORTS_INHERITED1(nsHTMLImageAccessible, nsLinkableAccessible, nsIAccessibleImage) +NS_IMPL_ISUPPORTS_INHERITED1(nsHTMLImageAccessible, nsAccessible, nsIAccessibleImage) NS_IMETHODIMP nsHTMLImageAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState) diff --git a/accessible/src/html/nsHyperTextAccessible.cpp b/accessible/src/html/nsHyperTextAccessible.cpp index 49ac4581087..04579a6e041 100644 --- a/accessible/src/html/nsHyperTextAccessible.cpp +++ b/accessible/src/html/nsHyperTextAccessible.cpp @@ -91,10 +91,10 @@ nsresult nsHyperTextAccessible::QueryInterface(REFNSIID aIID, void** aInstancePt return NS_OK; } - PRUint32 role = Role(this); - if (role == nsIAccessibleRole::ROLE_GRAPHIC || - role == nsIAccessibleRole::ROLE_IMAGE_MAP || - role == nsIAccessibleRole::ROLE_TEXT_LEAF) { + if (mRoleMapEntry && + (mRoleMapEntry->role == nsIAccessibleRole::ROLE_GRAPHIC || + mRoleMapEntry->role == nsIAccessibleRole::ROLE_IMAGE_MAP)) { + // ARIA roles that these interfaces are not appropriate for return nsAccessible::QueryInterface(aIID, aInstancePtr); } @@ -105,15 +105,6 @@ nsresult nsHyperTextAccessible::QueryInterface(REFNSIID aIID, void** aInstancePt } if (aIID.Equals(NS_GET_IID(nsIAccessibleHyperText))) { - if (role == nsIAccessibleRole::ROLE_ENTRY || - role == nsIAccessibleRole::ROLE_PASSWORD_TEXT) { - nsCOMPtr editor; - GetAssociatedEditor(getter_AddRefs(editor)); - nsCOMPtr peditor(do_QueryInterface(editor)); - if (peditor) { - return NS_ERROR_NO_INTERFACE; // No embedded objects ever in plain text - } - } *aInstancePtr = static_cast(this); NS_ADDREF_THIS(); return NS_OK; diff --git a/accessible/src/xforms/nsXFormsFormControlsAccessible.cpp b/accessible/src/xforms/nsXFormsFormControlsAccessible.cpp index 53127942c31..c4fec6cc104 100755 --- a/accessible/src/xforms/nsXFormsFormControlsAccessible.cpp +++ b/accessible/src/xforms/nsXFormsFormControlsAccessible.cpp @@ -150,6 +150,8 @@ nsXFormsInputAccessible:: { } +NS_IMPL_ISUPPORTS_INHERITED3(nsXFormsInputAccessible, nsAccessible, nsHyperTextAccessible, nsIAccessibleText, nsIAccessibleEditableText) + NS_IMETHODIMP nsXFormsInputAccessible::GetRole(PRUint32 *aRole) { diff --git a/accessible/src/xforms/nsXFormsFormControlsAccessible.h b/accessible/src/xforms/nsXFormsFormControlsAccessible.h index b017d24dbc5..2d2d072ea27 100755 --- a/accessible/src/xforms/nsXFormsFormControlsAccessible.h +++ b/accessible/src/xforms/nsXFormsFormControlsAccessible.h @@ -93,6 +93,8 @@ class nsXFormsInputAccessible : public nsXFormsEditableAccessible public: nsXFormsInputAccessible(nsIDOMNode *aNode, nsIWeakReference *aShell); + NS_DECL_ISUPPORTS_INHERITED + NS_IMETHOD GetRole(PRUint32 *aRole); NS_IMETHOD GetNumActions(PRUint8 *aCount); NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName); diff --git a/accessible/src/xul/nsXULFormControlAccessible.cpp b/accessible/src/xul/nsXULFormControlAccessible.cpp index 10272d009f3..cfb024ce614 100644 --- a/accessible/src/xul/nsXULFormControlAccessible.cpp +++ b/accessible/src/xul/nsXULFormControlAccessible.cpp @@ -764,6 +764,8 @@ nsXULTextFieldAccessible::nsXULTextFieldAccessible(nsIDOMNode* aNode, nsIWeakRef { } +NS_IMPL_ISUPPORTS_INHERITED3(nsXULTextFieldAccessible, nsAccessible, nsHyperTextAccessible, nsIAccessibleText, nsIAccessibleEditableText) + NS_IMETHODIMP nsXULTextFieldAccessible::GetValue(nsAString& aValue) { PRUint32 state; diff --git a/accessible/src/xul/nsXULFormControlAccessible.h b/accessible/src/xul/nsXULFormControlAccessible.h index 9680e3f9a6b..a6f8f4e107a 100644 --- a/accessible/src/xul/nsXULFormControlAccessible.h +++ b/accessible/src/xul/nsXULFormControlAccessible.h @@ -163,6 +163,8 @@ public: nsXULTextFieldAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell); + NS_DECL_ISUPPORTS_INHERITED + NS_IMETHOD GetValue(nsAString& aValue); NS_IMETHOD GetState(PRUint32 *aState, PRUint32 *aExtraState); NS_IMETHOD GetRole(PRUint32 *aRole);