mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 768461 - Add Accessible::HasNumericValue() method r=tbsaunde
This commit is contained in:
parent
0565487fa1
commit
9488e18b95
@ -28,4 +28,13 @@ Accessible::ARIARole()
|
|||||||
return ARIATransformRole(mRoleMapEntry->role);
|
return ARIATransformRole(mRoleMapEntry->role);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline bool
|
||||||
|
Accessible::HasNumericValue() const
|
||||||
|
{
|
||||||
|
if (mFlags & eHasNumericValue)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return mRoleMapEntry && mRoleMapEntry->valueRule != eNoValue;
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -139,12 +139,12 @@ Accessible::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (aIID.Equals(NS_GET_IID(nsIAccessibleValue))) {
|
if (aIID.Equals(NS_GET_IID(nsIAccessibleValue))) {
|
||||||
if (mRoleMapEntry && mRoleMapEntry->valueRule != eNoValue) {
|
if (HasNumericValue()) {
|
||||||
*aInstancePtr = static_cast<nsIAccessibleValue*>(this);
|
*aInstancePtr = static_cast<nsIAccessibleValue*>(this);
|
||||||
NS_ADDREF_THIS();
|
NS_ADDREF_THIS();
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aIID.Equals(NS_GET_IID(nsIAccessibleHyperLink))) {
|
if (aIID.Equals(NS_GET_IID(nsIAccessibleHyperLink))) {
|
||||||
if (IsLink()) {
|
if (IsLink()) {
|
||||||
|
@ -701,6 +701,11 @@ public:
|
|||||||
*/
|
*/
|
||||||
bool IsPrimaryForNode() const { return !(mFlags & eSharedNode); }
|
bool IsPrimaryForNode() const { return !(mFlags & eSharedNode); }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return true if the accessible has a numeric value.
|
||||||
|
*/
|
||||||
|
bool HasNumericValue() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
@ -751,7 +756,8 @@ protected:
|
|||||||
enum StateFlags {
|
enum StateFlags {
|
||||||
eIsDefunct = 1 << 2, // accessible is defunct
|
eIsDefunct = 1 << 2, // accessible is defunct
|
||||||
eIsNotInDocument = 1 << 3, // accessible is not in document
|
eIsNotInDocument = 1 << 3, // accessible is not in document
|
||||||
eSharedNode = 1 << 4 // accessible shares DOM node from another accessible
|
eSharedNode = 1 << 4, // accessible shares DOM node from another accessible
|
||||||
|
eHasNumericValue = 1 << 5 // accessible has a numeric value
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -759,23 +765,23 @@ protected:
|
|||||||
* @note keep these flags in sync with ChildrenFlags and StateFlags
|
* @note keep these flags in sync with ChildrenFlags and StateFlags
|
||||||
*/
|
*/
|
||||||
enum AccessibleTypes {
|
enum AccessibleTypes {
|
||||||
eApplicationAccessible = 1 << 5,
|
eApplicationAccessible = 1 << 6,
|
||||||
eAutoCompleteAccessible = 1 << 6,
|
eAutoCompleteAccessible = 1 << 7,
|
||||||
eAutoCompletePopupAccessible = 1 << 7,
|
eAutoCompletePopupAccessible = 1 << 8,
|
||||||
eComboboxAccessible = 1 << 8,
|
eComboboxAccessible = 1 << 9,
|
||||||
eDocAccessible = 1 << 9,
|
eDocAccessible = 1 << 10,
|
||||||
eHyperTextAccessible = 1 << 10,
|
eHyperTextAccessible = 1 << 11,
|
||||||
eHTMLFileInputAccessible = 1 << 11,
|
eHTMLFileInputAccessible = 1 << 12,
|
||||||
eHTMLListItemAccessible = 1 << 12,
|
eHTMLListItemAccessible = 1 << 13,
|
||||||
eImageAccessible = 1 << 13,
|
eImageAccessible = 1 << 14,
|
||||||
eImageMapAccessible = 1 << 14,
|
eImageMapAccessible = 1 << 15,
|
||||||
eListControlAccessible = 1 << 15,
|
eListControlAccessible = 1 << 16,
|
||||||
eMenuButtonAccessible = 1 << 16,
|
eMenuButtonAccessible = 1 << 17,
|
||||||
eMenuPopupAccessible = 1 << 17,
|
eMenuPopupAccessible = 1 << 18,
|
||||||
eRootAccessible = 1 << 18,
|
eRootAccessible = 1 << 19,
|
||||||
eTextLeafAccessible = 1 << 19,
|
eTextLeafAccessible = 1 << 20,
|
||||||
eXULDeckAccessible = 1 << 20,
|
eXULDeckAccessible = 1 << 21,
|
||||||
eXULTreeAccessible = 1 << 21
|
eXULTreeAccessible = 1 << 22
|
||||||
};
|
};
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -21,6 +21,7 @@ public:
|
|||||||
ProgressMeterAccessible(nsIContent* aContent, DocAccessible* aDoc) :
|
ProgressMeterAccessible(nsIContent* aContent, DocAccessible* aDoc) :
|
||||||
LeafAccessible(aContent, aDoc)
|
LeafAccessible(aContent, aDoc)
|
||||||
{
|
{
|
||||||
|
mFlags = mFlags | eHasNumericValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_DECL_ISUPPORTS_INHERITED
|
NS_DECL_ISUPPORTS_INHERITED
|
||||||
|
@ -21,6 +21,7 @@ XULSliderAccessible::
|
|||||||
XULSliderAccessible(nsIContent* aContent, DocAccessible* aDoc) :
|
XULSliderAccessible(nsIContent* aContent, DocAccessible* aDoc) :
|
||||||
AccessibleWrap(aContent, aDoc)
|
AccessibleWrap(aContent, aDoc)
|
||||||
{
|
{
|
||||||
|
mFlags = mFlags | eHasNumericValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// nsISupports
|
// nsISupports
|
||||||
|
Loading…
Reference in New Issue
Block a user