зеркало из https://github.com/mozilla/pjs.git
Implement accessible objects for xforms select controls. Patch by Alexander Surkov <surkov.alexander@gmail.com>. r=aaronr, aaronlev, b=348053
This commit is contained in:
Родитель
2675d0a77c
Коммит
3a3463c9a9
|
@ -124,9 +124,12 @@ interface nsIAccessibleProvider : nsISupports
|
|||
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"].
|
||||
*/
|
||||
* input[type="xsd:gDay"] and input[type="xsd:gMonth"] */
|
||||
const long XFormsContainer = 0x00002008;
|
||||
/** Used for select and select1 that are implemented using host document's
|
||||
* native widget. For example, a select1 in a xhtml document may be
|
||||
* represented by the native html control html:select */
|
||||
const long XFormsSelect = 0x00002009;
|
||||
|
||||
/**
|
||||
* Return one of constants declared above.
|
||||
|
|
|
@ -1574,6 +1574,9 @@ nsresult nsAccessibilityService::GetAccessibleByType(nsIDOMNode *aNode,
|
|||
case nsIAccessibleProvider::XFormsContainer:
|
||||
*aAccessible = new nsXFormsContainerAccessible(aNode, weakShell);
|
||||
break;
|
||||
case nsIAccessibleProvider::XFormsSelect:
|
||||
*aAccessible = new nsXFormsSelectAccessible(aNode, weakShell);
|
||||
break;
|
||||
#endif
|
||||
|
||||
default:
|
||||
|
|
|
@ -380,3 +380,28 @@ nsXFormsRangeAccessible::GetCurrentValue(double *aCurrentValue)
|
|||
return error;
|
||||
}
|
||||
|
||||
|
||||
// nsXFormsSelectAccessible
|
||||
|
||||
nsXFormsSelectAccessible::
|
||||
nsXFormsSelectAccessible(nsIDOMNode *aNode, nsIWeakReference *aShell):
|
||||
nsXFormsContainerAccessible(aNode, aShell)
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsXFormsSelectAccessible::GetState(PRUint32 *aState)
|
||||
{
|
||||
nsresult rv = nsXFormsContainerAccessible::GetState(aState);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
PRUint32 isInRange = nsIXFormsUtilityService::STATE_NOT_A_RANGE;
|
||||
rv = sXFormsService->IsInRange(mDOMNode, &isInRange);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
if (isInRange == nsIXFormsUtilityService::STATE_OUT_OF_RANGE)
|
||||
*aState |= STATE_INVALID;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -149,5 +149,19 @@ public:
|
|||
NS_IMETHOD GetCurrentValue(double *aCurrentValue);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Accessible object for xforms:select and xforms:select1 that are implemented
|
||||
* using host document's native widget.
|
||||
*/
|
||||
|
||||
class nsXFormsSelectAccessible : public nsXFormsContainerAccessible
|
||||
{
|
||||
public:
|
||||
nsXFormsSelectAccessible(nsIDOMNode *aNode, nsIWeakReference *aShell);
|
||||
|
||||
NS_IMETHOD GetState(PRUint32 *aState);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Загрузка…
Ссылка в новой задаче