diff --git a/mozilla/accessible/public/nsIAccessibleProvider.idl b/mozilla/accessible/public/nsIAccessibleProvider.idl index 5f429d09984..2d467b669f2 100644 --- a/mozilla/accessible/public/nsIAccessibleProvider.idl +++ b/mozilla/accessible/public/nsIAccessibleProvider.idl @@ -122,6 +122,11 @@ interface nsIAccessibleProvider : nsISupports const long XFormsSecret = 0x00002006; /** Used for range element represented by slider */ const long XFormsSliderRange = 0x00002007; + /** Used for xforms elements that provide accessible object for itself as + * well for anonymous content. This property are used for upload, + * input[type="xsd:gDay"] and input[type="xsd:gMonth"]. + */ + const long XFormsContainer = 0x00002008; /** * Return one of constants declared above. diff --git a/mozilla/accessible/src/base/nsAccessibilityService.cpp b/mozilla/accessible/src/base/nsAccessibilityService.cpp index c6cd29d1b6e..0aca84b6429 100644 --- a/mozilla/accessible/src/base/nsAccessibilityService.cpp +++ b/mozilla/accessible/src/base/nsAccessibilityService.cpp @@ -1571,6 +1571,9 @@ nsresult nsAccessibilityService::GetAccessibleByType(nsIDOMNode *aNode, case nsIAccessibleProvider::XFormsSliderRange: *aAccessible = new nsXFormsRangeAccessible(aNode, weakShell); break; + case nsIAccessibleProvider::XFormsContainer: + *aAccessible = new nsXFormsContainerAccessible(aNode, weakShell); + break; #endif default: diff --git a/mozilla/accessible/src/xforms/nsXFormsAccessible.cpp b/mozilla/accessible/src/xforms/nsXFormsAccessible.cpp index c57c960ed85..7773da8d0c9 100755 --- a/mozilla/accessible/src/xforms/nsXFormsAccessible.cpp +++ b/mozilla/accessible/src/xforms/nsXFormsAccessible.cpp @@ -183,3 +183,29 @@ nsXFormsAccessible::GetAllowsAnonChildAccessibles(PRBool *aAllowsAnonChildren) return NS_OK; } +// nsXFormsContainerAccessible + +nsXFormsContainerAccessible:: +nsXFormsContainerAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell): + nsXFormsAccessible(aNode, aShell) +{ +} + +NS_IMETHODIMP +nsXFormsContainerAccessible::GetRole(PRUint32 *aRole) +{ + NS_ENSURE_ARG_POINTER(aRole); + + *aRole = ROLE_GROUPING; + return NS_OK; +} + +NS_IMETHODIMP +nsXFormsContainerAccessible::GetAllowsAnonChildAccessibles(PRBool *aAllowsAnonChildren) +{ + NS_ENSURE_ARG_POINTER(aAllowsAnonChildren); + + *aAllowsAnonChildren = PR_TRUE; + return NS_OK; +} + diff --git a/mozilla/accessible/src/xforms/nsXFormsAccessible.h b/mozilla/accessible/src/xforms/nsXFormsAccessible.h index 003607f2166..7ec35ea64b0 100755 --- a/mozilla/accessible/src/xforms/nsXFormsAccessible.h +++ b/mozilla/accessible/src/xforms/nsXFormsAccessible.h @@ -45,7 +45,9 @@ #define NS_NAMESPACE_XFORMS "http://www.w3.org/2002/xforms" /** - * The class is base for accessible objects of all XForms elements. + * Every XForms element that is bindable to XForms model or is able to contain + * XForms hint and XForms label elements should have accessible object. This + * class is base class for accessible objects for these XForms elements. */ class nsXFormsAccessible : public nsAccessibleWrap { @@ -82,5 +84,31 @@ protected: static nsIXFormsUtilityService *sXFormsService; }; + +/** + * This class is accessible object for XForms elements that provide accessible + * object for itself as well for anonymous content. You should use this class + * if accessible XForms element is complex, i.e. it is composed from elements + * that should be accessible too. Especially for elements that have multiple + * areas that a user can interact with or multiple visual areas. For example, + * objects for XForms input[type="xsd:gMonth"] that contains combobox element + * to choose month. It has an entryfield, a drop-down button and a drop-down + * list, all of which need to be accessible. Another example would be + * an XForms upload element since it is constructed from textfield and + * 'pick up file' and 'clear file' buttons. + */ +class nsXFormsContainerAccessible : public nsXFormsAccessible +{ +public: + nsXFormsContainerAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell); + + // Returns ROLE_GROUP. + NS_IMETHOD GetRole(PRUint32 *aRole); + + // Allows accessible nodes in anonymous content of xforms element by + // always returning PR_TRUE value. + NS_IMETHOD GetAllowsAnonChildAccessibles(PRBool *aAllowsAnonChildren); +}; + #endif diff --git a/mozilla/extensions/xforms/resources/content/input.xml b/mozilla/extensions/xforms/resources/content/input.xml index aebb3244808..905a7b07113 100644 --- a/mozilla/extensions/xforms/resources/content/input.xml +++ b/mozilla/extensions/xforms/resources/content/input.xml @@ -220,7 +220,13 @@ --> - + + + + + return Components.interfaces.nsIAccessibleProvider.XFormsContainer; + + @@ -293,7 +299,14 @@ --> - + + + + + return Components.interfaces.nsIAccessibleProvider.XFormsContainer; + + + - + + + + + + return Components.interfaces.nsIAccessibleProvider.XFormsContainer; + + - this.control.readonly = this.accessors.isReadonly();