Bug 280136 - Remove GetFinalState(), r=davidb

This commit is contained in:
Alexander Surkov 2008-11-04 11:37:46 +08:00
parent c05ee390bf
commit bcacb1f51a
67 changed files with 511 additions and 336 deletions

View File

@ -58,7 +58,7 @@ interface nsIAccessibleRelation;
*
* @status UNDER_REVIEW
*/
[scriptable, uuid(c7520419-87ec-42bc-98cc-04c0bf173530)]
[scriptable, uuid(670fc322-14ec-4f3b-8279-9d62ab8895c0)]
interface nsIAccessible : nsISupports
{
/**
@ -164,7 +164,7 @@ interface nsIAccessible : nsISupports
* @param aExtraState - the second bit field
* (see nsIAccessibleStates::EXT_STATE_* constants)
*/
void getFinalState(out unsigned long aState, out unsigned long aExtraState);
void getState(out unsigned long aState, out unsigned long aExtraState);
/**
* Help text associated with node

View File

@ -835,7 +835,7 @@ GetAttributeSet(nsIAccessible* aAccessible)
if (attributes) {
// Deal with attributes that we only need to expose in ATK
PRUint32 state;
aAccessible->GetFinalState(&state, nsnull);
aAccessible->GetState(&state, nsnull);
if (state & nsIAccessibleStates::STATE_HASPOPUP) {
// There is no ATK state for haspopup, must use object attribute to expose the same info
nsAutoString oldValueUnused;
@ -1033,7 +1033,7 @@ refStateSetCB(AtkObject *aAtkObj)
// Map states
PRUint32 accState = 0, accExtState = 0;
nsresult rv = accWrap->GetFinalState(&accState, &accExtState);
nsresult rv = accWrap->GetState(&accState, &accExtState);
NS_ENSURE_SUCCESS(rv, state_set);
TranslateStates(accState, gAtkStateMap, state_set);

View File

@ -248,7 +248,7 @@ public:
{
PRUint32 state = 0;
if (aAcc)
aAcc->GetFinalState(&state, nsnull);
aAcc->GetState(&state, nsnull);
return state;
}

View File

@ -944,7 +944,7 @@ PRBool nsAccessible::IsVisible(PRBool *aIsOffscreen)
}
nsresult
nsAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
nsAccessible::GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState)
{
*aState = 0;
@ -1992,7 +1992,7 @@ nsAccessible::GetAttributes(nsIPersistentProperties **aAttributes)
content->HasAttr(kNameSpaceID_None, nsAccessibilityAtoms::aria_checked)) {
// Might be checkable -- checking role & ARIA attribute first is faster than getting state
PRUint32 state = 0;
GetFinalState(&state, nsnull);
GetState(&state, nsnull);
if (state & nsIAccessibleStates::STATE_CHECKABLE) {
// No official state for checkable, so use object attribute to expose that
attributes->SetStringProperty(NS_LITERAL_CSTRING("checkable"), NS_LITERAL_STRING("true"),
@ -2269,11 +2269,11 @@ PRBool nsAccessible::MappedAttrState(nsIContent *aContent, PRUint32 *aStateInOut
}
NS_IMETHODIMP
nsAccessible::GetFinalState(PRUint32 *aState, PRUint32 *aExtraState)
nsAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
{
NS_ENSURE_ARG_POINTER(aState);
nsresult rv = GetState(aState, aExtraState);
nsresult rv = GetStateInternal(aState, aExtraState);
NS_ENSURE_SUCCESS(rv, rv);
// Apply ARIA states to be sure accessible states will be overriden.

View File

@ -141,13 +141,11 @@ public:
/**
* Return the state of accessible that doesn't take into account ARIA states.
* Use nsIAccessible::finalState() to get all states for accessible. If
* Use nsIAccessible::state to get all states for accessible. If
* second argument is omitted then second bit field of accessible state won't
* be calculated.
*
* XXX: should be renamed into GetStateInternal
*/
NS_IMETHOD GetState(PRUint32 *aState, PRUint32 *aExtraState);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
/**
* Returns attributes for accessible without explicitly setted ARIA

View File

@ -421,7 +421,7 @@ nsAccStateChangeEvent::
nsCOMPtr<nsIAccessible> accessible(GetAccessibleByNode());
if (accessible) {
PRUint32 state = 0, extraState = 0;
accessible->GetFinalState(&state, mIsExtraState ? &extraState : nsnull);
accessible->GetState(&state, mIsExtraState ? &extraState : nsnull);
mIsEnabled = ((mIsExtraState ? extraState : state) & mState) != 0;
} else {
mIsEnabled = PR_FALSE;

View File

@ -143,8 +143,9 @@ nsApplicationAccessible::GetFinalRole(PRUint32 *aFinalRole)
return GetRole(aFinalRole);
}
NS_IMETHODIMP
nsApplicationAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
nsresult
nsApplicationAccessible::GetStateInternal(PRUint32 *aState,
PRUint32 *aExtraState)
{
*aState = 0;
if (aExtraState)

View File

@ -73,13 +73,15 @@ public:
NS_IMETHOD GetName(nsAString & aName);
NS_IMETHOD GetRole(PRUint32 *aRole);
NS_IMETHOD GetFinalRole(PRUint32 *aFinalRole);
NS_IMETHOD GetState(PRUint32 *aState, PRUint32 *aExtraState);
NS_IMETHOD GetParent(nsIAccessible * *aParent);
NS_IMETHOD GetNextSibling(nsIAccessible * *aNextSibling);
NS_IMETHOD GetPreviousSibling(nsIAccessible **aPreviousSibling);
NS_IMETHOD GetIndexInParent(PRInt32 *aIndexInParent);
NS_IMETHOD GetChildAt(PRInt32 aChildNum, nsIAccessible **aChild);
// nsAccessible
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
// nsApplicationAccessible
virtual nsresult AddRootAccessible(nsIAccessible *aRootAccWrap);
virtual nsresult RemoveRootAccessible(nsIAccessible *aRootAccWrap);

View File

@ -121,10 +121,11 @@ nsLinkableAccessible::TakeFocus()
return nsHyperTextAccessibleWrap::TakeFocus();
}
NS_IMETHODIMP
nsLinkableAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
nsresult
nsLinkableAccessible::GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState)
{
nsresult rv = nsHyperTextAccessibleWrap::GetState(aState, aExtraState);
nsresult rv = nsHyperTextAccessibleWrap::GetStateInternal(aState,
aExtraState);
NS_ENSURE_SUCCESS(rv, rv);
if (mIsLink) {

View File

@ -85,7 +85,6 @@ public:
NS_IMETHOD GetNumActions(PRUint8 *_retval);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD DoAction(PRUint8 index);
NS_IMETHOD GetState(PRUint32 *aState, PRUint32 *aExtraState);
NS_IMETHOD GetValue(nsAString& _retval);
NS_IMETHOD TakeFocus();
NS_IMETHOD GetKeyboardShortcut(nsAString& _retval);
@ -97,6 +96,9 @@ public:
virtual nsresult Init();
virtual nsresult Shutdown();
// nsAccessible
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
protected:
/**
* Return an accessible for cached action node.

View File

@ -270,11 +270,11 @@ nsDocAccessible::GetDescription(nsAString& aDescription)
return NS_OK;
}
NS_IMETHODIMP
nsDocAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
nsresult
nsDocAccessible::GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState)
{
// nsAccessible::GetState() always fail for document accessible.
nsAccessible::GetState(aState, aExtraState);
// nsAccessible::GetStateInternal() always fail for document accessible.
nsAccessible::GetStateInternal(aState, aExtraState);
if (!mDOMNode)
return NS_OK;
@ -365,7 +365,7 @@ NS_IMETHODIMP nsDocAccessible::TakeFocus()
{
NS_ENSURE_TRUE(mDocument, NS_ERROR_FAILURE);
PRUint32 state;
GetState(&state, nsnull);
GetStateInternal(&state, nsnull);
if (0 == (state & nsIAccessibleStates::STATE_FOCUSABLE)) {
return NS_ERROR_FAILURE; // Not focusable
}

View File

@ -80,7 +80,6 @@ class nsDocAccessible : public nsHyperTextAccessibleWrap,
NS_IMETHOD GetName(nsAString& aName);
NS_IMETHOD GetDescription(nsAString& aDescription);
NS_IMETHOD GetARIAState(PRUint32 *aState);
NS_IMETHOD GetState(PRUint32 *aState, PRUint32 *aExtraState);
NS_IMETHOD GetAttributes(nsIPersistentProperties **aAttributes);
NS_IMETHOD GetFocusedChild(nsIAccessible **aFocusedChild);
NS_IMETHOD GetParent(nsIAccessible **aParent);
@ -101,6 +100,9 @@ class nsDocAccessible : public nsHyperTextAccessibleWrap,
virtual nsresult Shutdown();
virtual nsIFrame* GetFrame();
// nsAccessible
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
// nsIAccessibleText
NS_IMETHOD GetAssociatedEditor(nsIEditor **aEditor);

View File

@ -59,10 +59,12 @@ NS_IMETHODIMP nsOuterDocAccessible::GetRole(PRUint32 *aRole)
return NS_OK;
}
NS_IMETHODIMP
nsOuterDocAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
nsresult
nsOuterDocAccessible::GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState)
{
nsAccessible::GetState(aState, aExtraState);
nsresult rv = nsAccessible::GetStateInternal(aState, aExtraState);
NS_ENSURE_SUCCESS(rv, rv);
*aState &= ~nsIAccessibleStates::STATE_FOCUSABLE;
return NS_OK;
}

View File

@ -46,26 +46,34 @@ class nsIWeakReference;
class nsOuterDocAccessible : public nsAccessibleWrap
{
// XXX: why is it private?
// CVS comment: <aaronl@netscape.com> 2003-04-01 14:15 Fixing bustage
NS_DECL_ISUPPORTS_INHERITED
public:
nsOuterDocAccessible(nsIDOMNode* aNode,
nsIWeakReference* aShell);
public:
nsOuterDocAccessible(nsIDOMNode* aNode,
nsIWeakReference* aShell);
NS_IMETHOD GetRole(PRUint32 *aRole);
NS_IMETHOD GetState(PRUint32 *aState, PRUint32 *aExtraState);
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *aRole);
NS_IMETHOD GetChildAtPoint(PRInt32 aX, PRInt32 aY,
nsIAccessible **aAccessible);
NS_IMETHOD GetDeepestChildAtPoint(PRInt32 aX, PRInt32 aY,
nsIAccessible **aAccessible);
NS_IMETHOD GetChildAtPoint(PRInt32 aX, PRInt32 aY,
nsIAccessible **aAccessible);
NS_IMETHOD GetDeepestChildAtPoint(PRInt32 aX, PRInt32 aY,
nsIAccessible **aAccessible);
void CacheChildren();
nsresult GetAttributesInternal(nsIPersistentProperties *aAttributes);
NS_IMETHOD GetNumActions(PRUint8 *aNumActions);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHODIMP GetActionDescription(PRUint8 aIndex, nsAString& aDescription);
NS_IMETHOD DoAction(PRUint8 aIndex);
NS_IMETHOD GetNumActions(PRUint8 *aNumActions);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD GetActionDescription(PRUint8 aIndex, nsAString& aDescription);
NS_IMETHOD DoAction(PRUint8 aIndex);
// nsAccessible
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
virtual nsresult GetAttributesInternal(nsIPersistentProperties *aAttributes);
protected:
// nsAccessible
void CacheChildren();
};
#endif

View File

@ -210,10 +210,10 @@ PRUint32 nsRootAccessible::GetChromeFlags()
}
#endif
NS_IMETHODIMP
nsRootAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
nsresult
nsRootAccessible::GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState)
{
nsresult rv = nsDocAccessibleWrap::GetState(aState, aExtraState);
nsresult rv = nsDocAccessibleWrap::GetStateInternal(aState, aExtraState);
NS_ENSURE_SUCCESS(rv, rv);
if (!mDOMNode)
return NS_OK;
@ -697,7 +697,7 @@ nsresult nsRootAccessible::HandleEventWithTarget(nsIDOMEvent* aEvent,
// radiogroup in prefWindow is exposed as a list,
// and panebutton is exposed as XULListitem in A11y.
// nsXULListitemAccessible::GetState uses STATE_SELECTED in this case,
// nsXULListitemAccessible::GetStateInternal uses STATE_SELECTED in this case,
// so we need to check nsIAccessibleStates::STATE_SELECTED also.
PRBool isEnabled = (state & (nsIAccessibleStates::STATE_CHECKED |
nsIAccessibleStates::STATE_SELECTED)) != 0;

View File

@ -77,7 +77,6 @@ class nsRootAccessible : public nsDocAccessibleWrap,
NS_IMETHOD GetName(nsAString& aName);
NS_IMETHOD GetParent(nsIAccessible * *aParent);
NS_IMETHOD GetRole(PRUint32 *aRole);
NS_IMETHOD GetState(PRUint32 *aState, PRUint32 *aExtraState);
NS_IMETHOD GetAccessibleRelated(PRUint32 aRelationType,
nsIAccessible **aRelated);
@ -91,6 +90,9 @@ class nsRootAccessible : public nsDocAccessibleWrap,
virtual nsresult Init();
virtual nsresult Shutdown();
// nsAccessible
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
void ShutdownAll();
NS_DECLARE_STATIC_IID_ACCESSOR(NS_ROOTACCESSIBLE_IMPL_CID)

View File

@ -81,7 +81,8 @@ NS_IMETHODIMP nsHTMLCheckboxAccessible::GetActionName(PRUint8 aIndex, nsAString&
if (aIndex == eAction_Click) { // 0 is the magic value for default action
// check or uncheck
PRUint32 state;
GetState(&state, nsnull);
nsresult rv = GetStateInternal(&state, nsnull);
NS_ENSURE_SUCCESS(rv, rv);
if (state & nsIAccessibleStates::STATE_CHECKED)
aName.AssignLiteral("uncheck");
@ -101,10 +102,11 @@ NS_IMETHODIMP nsHTMLCheckboxAccessible::DoAction(PRUint8 index)
return NS_ERROR_INVALID_ARG;
}
NS_IMETHODIMP
nsHTMLCheckboxAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
nsresult
nsHTMLCheckboxAccessible::GetStateInternal(PRUint32 *aState,
PRUint32 *aExtraState)
{
nsresult rv = nsFormControlAccessible::GetState(aState, aExtraState);
nsresult rv = nsFormControlAccessible::GetStateInternal(aState, aExtraState);
NS_ENSURE_SUCCESS(rv, rv);
if (!mDOMNode)
return NS_OK;
@ -130,10 +132,11 @@ nsRadioButtonAccessible(aNode, aShell)
{
}
NS_IMETHODIMP
nsHTMLRadioButtonAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
nsresult
nsHTMLRadioButtonAccessible::GetStateInternal(PRUint32 *aState,
PRUint32 *aExtraState)
{
nsresult rv = nsAccessibleWrap::GetState(aState, aExtraState);
nsresult rv = nsAccessibleWrap::GetStateInternal(aState, aExtraState);
NS_ENSURE_SUCCESS(rv, rv);
if (!mDOMNode)
return NS_OK;
@ -250,10 +253,12 @@ NS_IMETHODIMP nsHTMLButtonAccessible::DoAction(PRUint8 index)
return NS_ERROR_INVALID_ARG;
}
NS_IMETHODIMP
nsHTMLButtonAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
nsresult
nsHTMLButtonAccessible::GetStateInternal(PRUint32 *aState,
PRUint32 *aExtraState)
{
nsresult rv = nsHyperTextAccessibleWrap::GetState(aState, aExtraState);
nsresult rv = nsHyperTextAccessibleWrap::GetStateInternal(aState,
aExtraState);
NS_ENSURE_SUCCESS(rv, rv);
if (!mDOMNode)
return NS_OK;
@ -349,10 +354,12 @@ NS_IMETHODIMP nsHTML4ButtonAccessible::GetRole(PRUint32 *_retval)
return NS_OK;
}
NS_IMETHODIMP
nsHTML4ButtonAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
nsresult
nsHTML4ButtonAccessible::GetStateInternal(PRUint32 *aState,
PRUint32 *aExtraState)
{
nsresult rv = nsHyperTextAccessibleWrap::GetState(aState, aExtraState);
nsresult rv = nsHyperTextAccessibleWrap::GetStateInternal(aState,
aExtraState);
NS_ENSURE_SUCCESS(rv, rv);
if (!mDOMNode)
return NS_OK;
@ -423,7 +430,9 @@ nsHTMLTextFieldAccessible::GetNameInternal(nsAString& aName)
NS_IMETHODIMP nsHTMLTextFieldAccessible::GetValue(nsAString& _retval)
{
PRUint32 state;
GetState(&state, nsnull);
nsresult rv = GetStateInternal(&state, nsnull);
NS_ENSURE_SUCCESS(rv, rv);
if (state & nsIAccessibleStates::STATE_PROTECTED) // Don't return password text!
return NS_ERROR_FAILURE;
@ -440,10 +449,12 @@ NS_IMETHODIMP nsHTMLTextFieldAccessible::GetValue(nsAString& _retval)
return NS_ERROR_FAILURE;
}
NS_IMETHODIMP
nsHTMLTextFieldAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
nsresult
nsHTMLTextFieldAccessible::GetStateInternal(PRUint32 *aState,
PRUint32 *aExtraState)
{
nsresult rv = nsHyperTextAccessibleWrap::GetState(aState, aExtraState);
nsresult rv = nsHyperTextAccessibleWrap::GetStateInternal(aState,
aExtraState);
NS_ENSURE_SUCCESS(rv, rv);
if (!mDOMNode)
return NS_OK;

View File

@ -49,11 +49,15 @@ public:
enum { eAction_Click = 0 };
nsHTMLCheckboxAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *_retval);
NS_IMETHOD GetNumActions(PRUint8 *_retval);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD DoAction(PRUint8 index);
NS_IMETHOD GetState(PRUint32 *aState, PRUint32 *aExtraState);
// nsAccessible
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
};
class nsHTMLRadioButtonAccessible : public nsRadioButtonAccessible
@ -62,8 +66,9 @@ class nsHTMLRadioButtonAccessible : public nsRadioButtonAccessible
public:
nsHTMLRadioButtonAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
NS_IMETHOD GetState(PRUint32 *aState, PRUint32 *aExtraState);
// nsAccessible
virtual nsresult GetAttributesInternal(nsIPersistentProperties *aAttributes);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
};
class nsHTMLButtonAccessible : public nsHyperTextAccessibleWrap
@ -76,13 +81,13 @@ public:
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *_retval);
NS_IMETHOD GetState(PRUint32 *aState, PRUint32 *aExtraState);
NS_IMETHOD GetNumActions(PRUint8 *_retval);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD DoAction(PRUint8 index);
// nsAccessible
virtual nsresult GetNameInternal(nsAString& aName);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
};
class nsHTML4ButtonAccessible : public nsHyperTextAccessibleWrap
@ -95,13 +100,13 @@ public:
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *_retval);
NS_IMETHOD GetState(PRUint32 *aState, PRUint32 *aExtraState);
NS_IMETHOD GetNumActions(PRUint8 *_retval);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD DoAction(PRUint8 index);
// nsAccessible
virtual nsresult GetNameInternal(nsAString& aName);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
};
class nsHTMLTextFieldAccessible : public nsHyperTextAccessibleWrap
@ -117,7 +122,6 @@ public:
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *_retval);
NS_IMETHOD GetValue(nsAString& _retval);
NS_IMETHOD GetState(PRUint32 *aState, PRUint32 *aExtraState);
NS_IMETHOD GetNumActions(PRUint8 *_retval);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD DoAction(PRUint8 index);
@ -127,6 +131,7 @@ public:
// nsAccessible
virtual nsresult GetNameInternal(nsAString& aName);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
};
class nsHTMLGroupboxAccessible : public nsHyperTextAccessibleWrap

View File

@ -94,13 +94,13 @@ NS_IMPL_ISUPPORTS_INHERITED1(nsHTMLImageAccessible, nsAccessible,
////////////////////////////////////////////////////////////////////////////////
// nsIAccessible
NS_IMETHODIMP
nsHTMLImageAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
nsresult
nsHTMLImageAccessible::GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState)
{
// The state is a bitfield, get our inherited state, then logically OR it with
// STATE_ANIMATED if this is an animated image.
nsresult rv = nsLinkableAccessible::GetState(aState, aExtraState);
nsresult rv = nsLinkableAccessible::GetStateInternal(aState, aExtraState);
NS_ENSURE_SUCCESS(rv, rv);
if (!mDOMNode)
return NS_OK;

View File

@ -58,7 +58,6 @@ public:
nsHTMLImageAccessible(nsIDOMNode* aDomNode, nsIWeakReference* aShell);
// nsIAccessible
NS_IMETHOD GetState(PRUint32 *aState, PRUint32 *aExtraState);
NS_IMETHOD GetRole(PRUint32 *_retval);
NS_IMETHOD GetNumActions(PRUint8 *aNumActions);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
@ -77,6 +76,7 @@ public:
// nsAccessible
virtual nsresult GetNameInternal(nsAString& aName);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
virtual nsresult GetAttributesInternal(nsIPersistentProperties *aAttributes);
protected:

View File

@ -82,10 +82,11 @@ nsHTMLLinkAccessible::GetRole(PRUint32 *aRole)
return NS_OK;
}
NS_IMETHODIMP
nsHTMLLinkAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
nsresult
nsHTMLLinkAccessible::GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState)
{
nsresult rv = nsHyperTextAccessibleWrap::GetState(aState, aExtraState);
nsresult rv = nsHyperTextAccessibleWrap::GetStateInternal(aState,
aExtraState);
NS_ENSURE_SUCCESS(rv, rv);
if (!mDOMNode)
return NS_OK;

View File

@ -51,7 +51,6 @@ public:
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *aRole);
NS_IMETHOD GetState(PRUint32 *aState, PRUint32 *aExtraState);
NS_IMETHOD GetValue(nsAString& aValue);
NS_IMETHOD GetNumActions(PRUint8 *aNumActions);
@ -63,6 +62,7 @@ public:
// nsAccessible
virtual nsresult GetNameInternal(nsAString& aName);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
protected:
enum { eAction_Jump = 0 };

View File

@ -325,10 +325,12 @@ nsHTMLSelectListAccessible::nsHTMLSelectListAccessible(nsIDOMNode* aDOMNode,
* nsIAccessibleStates::STATE_MULTISELECTABLE
* nsIAccessibleStates::STATE_EXTSELECTABLE
*/
NS_IMETHODIMP
nsHTMLSelectListAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
nsresult
nsHTMLSelectListAccessible::GetStateInternal(PRUint32 *aState,
PRUint32 *aExtraState)
{
nsresult rv = nsHTMLSelectableAccessible::GetState(aState, aExtraState);
nsresult rv = nsHTMLSelectableAccessible::GetStateInternal(aState,
aExtraState);
NS_ENSURE_SUCCESS(rv, rv);
if (!mDOMNode)
return NS_OK;
@ -604,12 +606,13 @@ nsIFrame* nsHTMLSelectOptionAccessible::GetBoundsFrame()
* STATE_FOCUSABLE
* STATE_OFFSCREEN
*/
NS_IMETHODIMP
nsHTMLSelectOptionAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
nsresult
nsHTMLSelectOptionAccessible::GetStateInternal(PRUint32 *aState,
PRUint32 *aExtraState)
{
// Upcall to nsAccessible, but skip nsHyperTextAccessible impl
// because we don't want EXT_STATE_EDITABLE or EXT_STATE_SELECTABLE_TEXT
nsresult rv = nsAccessible::GetState(aState, aExtraState);
nsresult rv = nsAccessible::GetStateInternal(aState, aExtraState);
NS_ENSURE_SUCCESS(rv, rv);
if (!mDOMNode)
return NS_OK;
@ -890,7 +893,7 @@ nsIContent* nsHTMLSelectOptionAccessible::GetSelectState(PRUint32* aState,
nsCOMPtr<nsIAccessible> selAcc;
accService->GetAccessibleFor(selectNode, getter_AddRefs(selAcc));
if (selAcc) {
selAcc->GetFinalState(aState, aExtraState);
selAcc->GetState(aState, aExtraState);
return content;
}
}
@ -913,10 +916,12 @@ nsHTMLSelectOptGroupAccessible::GetRole(PRUint32 *aRole)
return NS_OK;
}
NS_IMETHODIMP
nsHTMLSelectOptGroupAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
nsresult
nsHTMLSelectOptGroupAccessible::GetStateInternal(PRUint32 *aState,
PRUint32 *aExtraState)
{
nsresult rv = nsHTMLSelectOptionAccessible::GetState(aState, aExtraState);
nsresult rv = nsHTMLSelectOptionAccessible::GetStateInternal(aState,
aExtraState);
NS_ENSURE_SUCCESS(rv, rv);
*aState &= ~(nsIAccessibleStates::STATE_FOCUSABLE |
@ -1066,11 +1071,12 @@ nsHTMLComboboxAccessible::Shutdown()
* STATE_EXPANDED
* STATE_COLLAPSED
*/
NS_IMETHODIMP
nsHTMLComboboxAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
nsresult
nsHTMLComboboxAccessible::GetStateInternal(PRUint32 *aState,
PRUint32 *aExtraState)
{
// Get focus status from base class
nsresult rv = nsAccessible::GetState(aState, aExtraState);
nsresult rv = nsAccessible::GetStateInternal(aState, aExtraState);
NS_ENSURE_SUCCESS(rv, rv);
if (!mDOMNode)
return NS_OK;
@ -1386,11 +1392,12 @@ nsHTMLComboboxButtonAccessible::GetName(nsAString& aName)
* STATE_FOCUSABLE
* STATE_INVISIBLE
*/
NS_IMETHODIMP
nsHTMLComboboxButtonAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
nsresult
nsHTMLComboboxButtonAccessible::GetStateInternal(PRUint32 *aState,
PRUint32 *aExtraState)
{
// Get focus status from base class
nsresult rv = nsAccessible::GetState(aState, aExtraState);
nsresult rv = nsAccessible::GetStateInternal(aState, aExtraState);
NS_ENSURE_SUCCESS(rv, rv);
if (!mDOMNode)
return NS_OK;
@ -1446,11 +1453,12 @@ nsHTMLComboboxListAccessible::GetFrame()
* STATE_INVISIBLE
* STATE_FLOATING
*/
NS_IMETHODIMP
nsHTMLComboboxListAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
nsresult
nsHTMLComboboxListAccessible::GetStateInternal(PRUint32 *aState,
PRUint32 *aExtraState)
{
// Get focus status from base class
nsresult rv = nsAccessible::GetState(aState, aExtraState);
nsresult rv = nsAccessible::GetStateInternal(aState, aExtraState);
NS_ENSURE_SUCCESS(rv, rv);
if (!mDOMNode)
return NS_OK;

View File

@ -125,12 +125,15 @@ public:
nsHTMLSelectListAccessible(nsIDOMNode* aDOMNode, nsIWeakReference* aShell);
virtual ~nsHTMLSelectListAccessible() {}
/* ----- nsIAccessible ----- */
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *aRole);
NS_IMETHOD GetState(PRUint32 *aState, PRUint32 *aExtraState);
void CacheChildren();
// nsAccessible
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
protected:
void CacheChildren();
already_AddRefed<nsIAccessible>
AccessibleForOption(nsIAccessibilityService *aAccService,
nsIContent *aContent,
@ -158,11 +161,11 @@ public:
NS_IMETHOD DoAction(PRUint8 index);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD GetNumActions(PRUint8 *_retval);
NS_IMETHOD GetState(PRUint32 *aState, PRUint32 *aExtraState);
NS_IMETHOD GetRole(PRUint32 *aRole);
// nsAccessible
virtual nsresult GetNameInternal(nsAString& aName);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
virtual nsresult GetAttributesInternal(nsIPersistentProperties *aAttributes);
nsIFrame* GetBoundsFrame();
@ -190,12 +193,16 @@ public:
nsHTMLSelectOptGroupAccessible(nsIDOMNode* aDOMNode, nsIWeakReference* aShell);
virtual ~nsHTMLSelectOptGroupAccessible() {}
/* ----- nsIAccessible ----- */
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *aRole);
NS_IMETHOD GetState(PRUint32 *aState, PRUint32 *aExtraState);
NS_IMETHOD DoAction(PRUint8 index);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD GetNumActions(PRUint8 *_retval);
// nsAccessible
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
protected:
void CacheChildren();
};
@ -216,21 +223,23 @@ public:
nsHTMLComboboxAccessible(nsIDOMNode* aDOMNode, nsIWeakReference* aShell);
virtual ~nsHTMLComboboxAccessible() {}
/* ----- nsIAccessible ----- */
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *_retval);
NS_IMETHOD GetState(PRUint32 *aState, PRUint32 *aExtraState);
NS_IMETHOD GetValue(nsAString& _retval);
NS_IMETHOD GetDescription(nsAString& aDescription);
NS_IMETHOD DoAction(PRUint8 index);
NS_IMETHOD GetNumActions(PRUint8 *aNumActions);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
void CacheChildren();
// nsAccessNode
virtual nsresult Shutdown();
// nsAccessible
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
protected:
void CacheChildren();
already_AddRefed<nsIAccessible> GetFocusedOptionAccessible();
private:
@ -276,12 +285,14 @@ public:
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD GetParent(nsIAccessible **_retval);
NS_IMETHOD GetRole(PRUint32 *_retval);
NS_IMETHOD GetState(PRUint32 *aState, PRUint32 *aExtraState);
NS_IMETHOD GetName(nsAString& aName);
// nsIAccessNode
NS_IMETHOD GetUniqueID(void **aUniqueID);
// nsAccessible
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
protected:
virtual void GetBoundsRect(nsRect& aBounds, nsIFrame** aBoundingFrame);
};
@ -302,14 +313,15 @@ public:
nsIWeakReference* aShell);
virtual ~nsHTMLComboboxListAccessible() {}
/* ----- nsIAccessible ----- */
NS_IMETHOD GetState(PRUint32 *aState, PRUint32 *aExtraState);
// nsIAccessible
NS_IMETHOD GetParent(nsIAccessible **aParent);
NS_IMETHOD GetUniqueID(void **aUniqueID);
// nsAccessNode
virtual nsIFrame* GetFrame();
// nsAccessible
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
virtual void GetBoundsRect(nsRect& aBounds, nsIFrame** aBoundingFrame);
};

View File

@ -195,11 +195,12 @@ NS_IMETHODIMP nsHTMLTableAccessible::GetRole(PRUint32 *aResult)
return NS_OK;
}
NS_IMETHODIMP
nsHTMLTableAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
nsresult
nsHTMLTableAccessible::GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState)
{
nsresult rv= nsAccessible::GetState(aState, aExtraState);
nsresult rv= nsAccessible::GetStateInternal(aState, aExtraState);
NS_ENSURE_SUCCESS(rv, rv);
*aState |= nsIAccessibleStates::STATE_READONLY;
return NS_OK;
}
@ -1058,7 +1059,7 @@ NS_IMETHODIMP nsHTMLTableAccessible::IsProbablyForLayout(PRBool *aIsProbablyForL
nsCOMPtr<nsIAccessible> docAccessible = do_QueryInterface(nsCOMPtr<nsIAccessibleDocument>(GetDocAccessible()));
if (docAccessible) {
PRUint32 state, extState;
docAccessible->GetFinalState(&state, &extState);
docAccessible->GetState(&state, &extState);
if (extState & nsIAccessibleStates::EXT_STATE_EDITABLE) { // Need to see all elements while document is being edited
RETURN_LAYOUT_ANSWER(PR_FALSE, "In editable document");
}

View File

@ -74,12 +74,12 @@ public:
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *aResult);
NS_IMETHOD GetState(PRUint32 *aState, PRUint32 *aExtraState);
NS_IMETHOD GetDescription(nsAString& aDescription);
NS_IMETHOD GetAccessibleRelated(PRUint32 aRelationType, nsIAccessible **aRelated);
// nsAccessible
virtual nsresult GetNameInternal(nsAString& aName);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
virtual nsresult GetAttributesInternal(nsIPersistentProperties *aAttributes);
// nsHTMLTableAccessible

View File

@ -74,10 +74,10 @@ NS_IMETHODIMP nsHTMLTextAccessible::GetRole(PRUint32 *aRole)
return nsTextAccessible::GetRole(aRole);
}
NS_IMETHODIMP
nsHTMLTextAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
nsresult
nsHTMLTextAccessible::GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState)
{
nsresult rv = nsTextAccessible::GetState(aState, aExtraState);
nsresult rv = nsTextAccessible::GetStateInternal(aState, aExtraState);
NS_ENSURE_SUCCESS(rv, rv);
if (!mDOMNode)
return NS_OK;
@ -86,7 +86,7 @@ nsHTMLTextAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
do_QueryInterface(nsCOMPtr<nsIAccessibleDocument>(GetDocAccessible()));
if (docAccessible) {
PRUint32 state, extState;
docAccessible->GetFinalState(&state, &extState);
docAccessible->GetState(&state, &extState);
if (0 == (extState & nsIAccessibleStates::EXT_STATE_EDITABLE)) {
*aState |= nsIAccessibleStates::STATE_READONLY; // Links not focusable in editor
}
@ -135,8 +135,8 @@ NS_IMETHODIMP nsHTMLBRAccessible::GetRole(PRUint32 *aRole)
return NS_OK;
}
NS_IMETHODIMP
nsHTMLBRAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
nsresult
nsHTMLBRAccessible::GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState)
{
*aState = nsIAccessibleStates::STATE_READONLY;
if (aExtraState) {
@ -186,10 +186,10 @@ NS_IMETHODIMP nsHTMLLabelAccessible::GetRole(PRUint32 *aRole)
return NS_OK;
}
NS_IMETHODIMP
nsHTMLLabelAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
nsresult
nsHTMLLabelAccessible::GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState)
{
nsresult rv = nsTextAccessible::GetState(aState, aExtraState);
nsresult rv = nsTextAccessible::GetStateInternal(aState, aExtraState);
NS_ENSURE_SUCCESS(rv, rv);
if (mDOMNode) {
*aState &= (nsIAccessibleStates::STATE_LINKED |
@ -242,10 +242,10 @@ nsHTMLLIAccessible::Shutdown()
return rv;
}
NS_IMETHODIMP
nsHTMLLIAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
nsresult
nsHTMLLIAccessible::GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState)
{
nsresult rv = nsAccessibleWrap::GetState(aState, aExtraState);
nsresult rv = nsAccessibleWrap::GetStateInternal(aState, aExtraState);
NS_ENSURE_SUCCESS(rv, rv);
*aState |= nsIAccessibleStates::STATE_READONLY;
@ -327,10 +327,10 @@ nsHTMLListBulletAccessible::GetRole(PRUint32 *aRole)
return NS_OK;
}
NS_IMETHODIMP
nsHTMLListBulletAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
nsresult
nsHTMLListBulletAccessible::GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState)
{
nsresult rv = nsLeafAccessible::GetState(aState, aExtraState);
nsresult rv = nsLeafAccessible::GetStateInternal(aState, aExtraState);
NS_ENSURE_SUCCESS(rv, rv);
*aState &= ~nsIAccessibleStates::STATE_FOCUSABLE;
@ -367,10 +367,11 @@ nsHTMLListBulletAccessible::AppendTextTo(nsAString& aText, PRUint32 aStartOffset
// nsHTMLListAccessible
NS_IMETHODIMP
nsHTMLListAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
nsresult
nsHTMLListAccessible::GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState)
{
nsresult rv = nsHyperTextAccessibleWrap::GetState(aState, aExtraState);
nsresult rv = nsHyperTextAccessibleWrap::GetStateInternal(aState,
aExtraState);
NS_ENSURE_SUCCESS(rv, rv);
*aState |= nsIAccessibleStates::STATE_READONLY;

View File

@ -52,12 +52,12 @@ public:
nsHTMLTextAccessible(nsIDOMNode* aDomNode, nsIWeakReference* aShell);
// nsIAccessible
NS_IMETHOD GetState(PRUint32 *aState, PRUint32 *aExtraState);
NS_IMETHOD GetName(nsAString& aName);
NS_IMETHOD GetRole(PRUint32 *aRole);
// nsAccessible
virtual nsresult GetAttributesInternal(nsIPersistentProperties *aAttributes);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
};
class nsHTMLHRAccessible : public nsLeafAccessible
@ -74,10 +74,10 @@ public:
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *aRole);
NS_IMETHOD GetState(PRUint32 *aState, PRUint32 *aExtraState);
// nsAccessible
virtual nsresult GetNameInternal(nsAString& aName);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
};
class nsHTMLLabelAccessible : public nsTextAccessible
@ -89,13 +89,13 @@ public:
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *_retval);
NS_IMETHOD GetState(PRUint32 *aState, PRUint32 *aExtraState);
NS_IMETHOD GetFirstChild(nsIAccessible **aFirstChild);
NS_IMETHOD GetLastChild(nsIAccessible **aLastChild);
NS_IMETHOD GetChildCount(PRInt32 *aAccChildCount);
// nsAccessible
virtual nsresult GetNameInternal(nsAString& aName);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
};
class nsHTMLListBulletAccessible : public nsLeafAccessible
@ -110,7 +110,6 @@ public:
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *aRole);
NS_IMETHOD GetName(nsAString& aName);
NS_IMETHOD GetState(PRUint32 *aState, PRUint32 *aExtraState);
// Don't cache via unique ID -- bullet accessible shares the same dom node as
// this LI accessible. Also, don't cache via mParent/SetParent(), prevent
@ -121,6 +120,9 @@ public:
// nsAccessNode
virtual nsresult Shutdown();
// nsAccessible
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
// nsPIAccessible
NS_IMETHOD AppendTextTo(nsAString& aText, PRUint32 aStartOffset, PRUint32 aLength);
@ -140,8 +142,12 @@ class nsHTMLListAccessible : public nsHyperTextAccessibleWrap
public:
nsHTMLListAccessible(nsIDOMNode *aDOMNode, nsIWeakReference* aShell):
nsHyperTextAccessibleWrap(aDOMNode, aShell) { }
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *aRole) { *aRole = nsIAccessibleRole::ROLE_LIST; return NS_OK; }
NS_IMETHOD GetState(PRUint32 *aState, PRUint32 *aExtraState);
// nsAccessible
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
};
class nsHTMLLIAccessible : public nsLinkableAccessible
@ -152,12 +158,14 @@ public:
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *aRole) { *aRole = nsIAccessibleRole::ROLE_LISTITEM; return NS_OK; }
NS_IMETHOD GetState(PRUint32 *aState, PRUint32 *aExtraState);
NS_IMETHOD GetBounds(PRInt32 *x, PRInt32 *y, PRInt32 *width, PRInt32 *height);
// nsAccessNode
virtual nsresult Shutdown();
// nsAccessible
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
protected:
void CacheChildren(); // Include bullet accessible

View File

@ -169,10 +169,10 @@ NS_IMETHODIMP nsHyperTextAccessible::GetRole(PRUint32 *aRole)
return NS_OK;
}
NS_IMETHODIMP
nsHyperTextAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
nsresult
nsHyperTextAccessible::GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState)
{
nsresult rv = nsAccessibleWrap::GetState(aState, aExtraState);
nsresult rv = nsAccessibleWrap::GetStateInternal(aState, aExtraState);
NS_ENSURE_SUCCESS(rv, rv);
if (!mDOMNode || !aExtraState)
return NS_OK;

View File

@ -84,10 +84,10 @@ public:
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *aRole);
NS_IMETHOD GetState(PRUint32 *aState, PRUint32 *aExtraState);
// nsAccessible
virtual nsresult GetAttributesInternal(nsIPersistentProperties *aAttributes);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
void CacheChildren();
// Convert content offset to rendered text offset

View File

@ -549,14 +549,14 @@ GetNativeFromGeckoAccessible(nsIAccessible *anAccessible)
- (BOOL)isFocused
{
PRUint32 state = 0;
mGeckoAccessible->GetFinalState (&state, nsnull);
mGeckoAccessible->GetState (&state, nsnull);
return (state & nsIAccessibleStates::STATE_FOCUSED) != 0;
}
- (BOOL)canBeFocused
{
PRUint32 state = 0;
mGeckoAccessible->GetFinalState (&state, nsnull);
mGeckoAccessible->GetState (&state, nsnull);
return (state & nsIAccessibleStates::STATE_FOCUSABLE) != 0;
}
@ -569,7 +569,7 @@ GetNativeFromGeckoAccessible(nsIAccessible *anAccessible)
- (BOOL)isEnabled
{
PRUint32 state = 0;
mGeckoAccessible->GetFinalState (&state, nsnull);
mGeckoAccessible->GetState (&state, nsnull);
return (state & nsIAccessibleStates::STATE_UNAVAILABLE) == 0;
}

View File

@ -158,7 +158,7 @@ enum CheckboxValue {
- (int)isChecked
{
PRUint32 state = 0;
mGeckoAccessible->GetState(&state, nsnull);
mGeckoAccessible->GetStateInternal(&state, nsnull);
// check if we're checked or in a mixed state
if (state & nsIAccessibleStates::STATE_CHECKED) {

View File

@ -140,7 +140,7 @@ extern const NSString *kTopLevelUIElementAttribute; // NSAccessibilityTopLevel
if (mGeckoEditableTextAccessible) {
PRUint32 state = 0;
mGeckoAccessible->GetFinalState(&state, nsnull);
mGeckoAccessible->GetState(&state, nsnull);
return (state & nsIAccessibleStates::STATE_READONLY) == 0;
}

View File

@ -87,7 +87,7 @@ class nsAccessibleWrap : public nsAccessible
PRBool HasPopup () {
PRUint32 state = 0;
GetState(&state, nsnull);
GetStateInternal(&state, nsnull);
return (state & nsIAccessibleStates::STATE_HASPOPUP);
}

View File

@ -91,7 +91,7 @@ __try {
// If the object is not on any screen the returned position is (0,0).
PRUint32 states = 0;
nsresult rv = acc->GetFinalState(&states, nsnull);
nsresult rv = acc->GetState(&states, nsnull);
if (NS_FAILED(rv))
return GetHRESULT(rv);

View File

@ -551,7 +551,7 @@ __try {
return E_FAIL;
PRUint32 state = 0;
if (NS_FAILED(xpAccessible->GetFinalState(&state, nsnull)))
if (NS_FAILED(xpAccessible->GetState(&state, nsnull)))
return E_FAIL;
pvarState->lVal = state;
@ -1360,7 +1360,7 @@ __try {
// XXX: bug 344674 should come with better approach that we have here.
PRUint32 states = 0, extraStates = 0;
nsresult rv = GetFinalState(&states, &extraStates);
nsresult rv = GetState(&states, &extraStates);
if (NS_FAILED(rv))
return GetHRESULT(rv);

View File

@ -171,8 +171,8 @@ nsXFormsAccessible::GetValue(nsAString& aValue)
return sXFormsService->GetValue(mDOMNode, aValue);
}
NS_IMETHODIMP
nsXFormsAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
nsresult
nsXFormsAccessible::GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState)
{
NS_ENSURE_ARG_POINTER(aState);
*aState = 0;
@ -203,7 +203,7 @@ nsXFormsAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
rv = sXFormsService->IsValid(mDOMNode, &isValid);
NS_ENSURE_SUCCESS(rv, rv);
rv = nsHyperTextAccessibleWrap::GetState(aState, aExtraState);
rv = nsHyperTextAccessibleWrap::GetStateInternal(aState, aExtraState);
NS_ENSURE_SUCCESS(rv, rv);
if (!isRelevant)
@ -303,12 +303,13 @@ nsXFormsEditableAccessible::
{
}
NS_IMETHODIMP
nsXFormsEditableAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
nsresult
nsXFormsEditableAccessible::GetStateInternal(PRUint32 *aState,
PRUint32 *aExtraState)
{
NS_ENSURE_ARG_POINTER(aState);
nsresult rv = nsXFormsAccessible::GetState(aState, aExtraState);
nsresult rv = nsXFormsAccessible::GetStateInternal(aState, aExtraState);
NS_ENSURE_SUCCESS(rv, rv);
if (!mDOMNode || !aExtraState)
return NS_OK;

View File

@ -72,19 +72,23 @@ class nsXFormsAccessible : public nsHyperTextAccessibleWrap,
public:
nsXFormsAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
// nsIAccessible
// Returns value of instance node that xforms element is bound to.
NS_IMETHOD GetValue(nsAString& aValue);
// Returns state of xforms element taking into account state of instance node
// that it is bound to.
NS_IMETHOD GetState(PRUint32 *aState, PRUint32 *aExtraState);
// Returns value of child xforms 'hint' element.
NS_IMETHOD GetDescription(nsAString& aDescription);
// nsAccessible
// Returns value of child xforms 'label' element.
virtual nsresult GetNameInternal(nsAString& aName);
// Returns state of xforms element taking into account state of instance node
// that it is bound to.
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
// Appends ARIA 'datatype' property based on datatype of instance node that
// element is bound to.
virtual nsresult GetAttributesInternal(nsIPersistentProperties *aAttributes);
@ -145,10 +149,11 @@ class nsXFormsEditableAccessible : public nsXFormsAccessible
public:
nsXFormsEditableAccessible(nsIDOMNode *aNode, nsIWeakReference *aShell);
NS_IMETHOD GetState(PRUint32 *aState, PRUint32 *aExtraState);
// nsIAccessibleEditableText
NS_IMETHOD GetAssociatedEditor(nsIEditor **aEditor);
// nsAccessible
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
};

View File

@ -204,10 +204,11 @@ nsXFormsInputBooleanAccessible::GetRole(PRUint32 *aRole)
return NS_OK;
}
NS_IMETHODIMP
nsXFormsInputBooleanAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
nsresult
nsXFormsInputBooleanAccessible::GetStateInternal(PRUint32 *aState,
PRUint32 *aExtraState)
{
nsresult rv = nsXFormsAccessible::GetState(aState, aExtraState);
nsresult rv = nsXFormsAccessible::GetStateInternal(aState, aExtraState);
NS_ENSURE_SUCCESS(rv, rv);
if (!mDOMNode)
return NS_OK;
@ -292,10 +293,11 @@ nsXFormsSecretAccessible::GetRole(PRUint32 *aRole)
return NS_OK;
}
NS_IMETHODIMP
nsXFormsSecretAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
nsresult
nsXFormsSecretAccessible::GetStateInternal(PRUint32 *aState,
PRUint32 *aExtraState)
{
nsresult rv = nsXFormsInputAccessible::GetState(aState, aExtraState);
nsresult rv = nsXFormsInputAccessible::GetStateInternal(aState, aExtraState);
NS_ENSURE_SUCCESS(rv, rv);
if (!mDOMNode)
return NS_OK;
@ -328,10 +330,11 @@ nsXFormsRangeAccessible::GetRole(PRUint32 *aRole)
return NS_OK;
}
NS_IMETHODIMP
nsXFormsRangeAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
nsresult
nsXFormsRangeAccessible::GetStateInternal(PRUint32 *aState,
PRUint32 *aExtraState)
{
nsresult rv = nsXFormsAccessible::GetState(aState, aExtraState);
nsresult rv = nsXFormsAccessible::GetStateInternal(aState, aExtraState);
NS_ENSURE_SUCCESS(rv, rv);
if (!mDOMNode)
return NS_OK;
@ -411,10 +414,12 @@ nsXFormsSelectAccessible::
{
}
NS_IMETHODIMP
nsXFormsSelectAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
nsresult
nsXFormsSelectAccessible::GetStateInternal(PRUint32 *aState,
PRUint32 *aExtraState)
{
nsresult rv = nsXFormsContainerAccessible::GetState(aState, aExtraState);
nsresult rv = nsXFormsContainerAccessible::GetStateInternal(aState,
aExtraState);
NS_ENSURE_SUCCESS(rv, rv);
if (!mDOMNode)
return NS_OK;
@ -503,11 +508,12 @@ nsXFormsItemCheckgroupAccessible::GetRole(PRUint32 *aRole)
return NS_OK;
}
NS_IMETHODIMP
nsXFormsItemCheckgroupAccessible::GetState(PRUint32 *aState,
PRUint32 *aExtraState)
nsresult
nsXFormsItemCheckgroupAccessible::GetStateInternal(PRUint32 *aState,
PRUint32 *aExtraState)
{
nsresult rv = nsXFormsSelectableItemAccessible::GetState(aState, aExtraState);
nsresult rv = nsXFormsSelectableItemAccessible::GetStateInternal(aState,
aExtraState);
NS_ENSURE_SUCCESS(rv, rv);
if (!mDOMNode)
return NS_OK;
@ -550,11 +556,12 @@ nsXFormsItemRadiogroupAccessible::GetRole(PRUint32 *aRole)
return NS_OK;
}
NS_IMETHODIMP
nsXFormsItemRadiogroupAccessible::GetState(PRUint32 *aState,
PRUint32 *aExtraState)
nsresult
nsXFormsItemRadiogroupAccessible::GetStateInternal(PRUint32 *aState,
PRUint32 *aExtraState)
{
nsresult rv = nsXFormsSelectableItemAccessible::GetState(aState, aExtraState);
nsresult rv = nsXFormsSelectableItemAccessible::GetStateInternal(aState,
aExtraState);
NS_ENSURE_SUCCESS(rv, rv);
if (!mDOMNode)
return NS_OK;
@ -593,11 +600,12 @@ nsXFormsSelectComboboxAccessible::GetRole(PRUint32 *aRole)
return NS_OK;
}
NS_IMETHODIMP
nsXFormsSelectComboboxAccessible::GetState(PRUint32 *aState,
PRUint32 *aExtraState)
nsresult
nsXFormsSelectComboboxAccessible::GetStateInternal(PRUint32 *aState,
PRUint32 *aExtraState)
{
nsresult rv = nsXFormsSelectableAccessible::GetState(aState, aExtraState);
nsresult rv = nsXFormsSelectableAccessible::GetStateInternal(aState,
aExtraState);
NS_ENSURE_SUCCESS(rv, rv);
if (!mDOMNode)
return NS_OK;
@ -643,11 +651,12 @@ nsXFormsItemComboboxAccessible::GetRole(PRUint32 *aRole)
return NS_OK;
}
NS_IMETHODIMP
nsXFormsItemComboboxAccessible::GetState(PRUint32 *aState,
PRUint32 *aExtraState)
nsresult
nsXFormsItemComboboxAccessible::GetStateInternal(PRUint32 *aState,
PRUint32 *aExtraState)
{
nsresult rv = nsXFormsSelectableItemAccessible::GetState(aState, aExtraState);
nsresult rv = nsXFormsSelectableItemAccessible::GetStateInternal(aState,
aExtraState);
NS_ENSURE_SUCCESS(rv, rv);
if (!mDOMNode || (*aState & nsIAccessibleStates::STATE_UNAVAILABLE))
return NS_OK;

View File

@ -113,11 +113,14 @@ class nsXFormsInputBooleanAccessible : public nsXFormsAccessible
public:
nsXFormsInputBooleanAccessible(nsIDOMNode *aNode, nsIWeakReference *aShell);
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *aRole);
NS_IMETHOD GetState(PRUint32 *aState, PRUint32 *aExtraState);
NS_IMETHOD GetNumActions(PRUint8 *aCount);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD DoAction(PRUint8 aIndex);
// nsAccessible
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
};
/**
@ -141,9 +144,12 @@ class nsXFormsSecretAccessible : public nsXFormsInputAccessible
public:
nsXFormsSecretAccessible(nsIDOMNode *aNode, nsIWeakReference *aShell);
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *aRole);
NS_IMETHOD GetState(PRUint32 *aState, PRUint32 *aExtraState);
NS_IMETHOD GetValue(nsAString& aValue);
// nsAccessible
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
};
@ -156,14 +162,17 @@ class nsXFormsRangeAccessible : public nsXFormsAccessible
public:
nsXFormsRangeAccessible(nsIDOMNode *aNode, nsIWeakReference *aShell);
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *aRole);
NS_IMETHOD GetState(PRUint32 *aState, PRUint32 *aExtraState);
// nsIAccessibleValue
NS_IMETHOD GetMaximumValue(double *aMaximumValue);
NS_IMETHOD GetMinimumValue(double *aMinimumValue);
NS_IMETHOD GetMinimumIncrement(double *aMinimumIncrement);
NS_IMETHOD GetCurrentValue(double *aCurrentValue);
// nsAccessible
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
};
@ -177,7 +186,8 @@ class nsXFormsSelectAccessible : public nsXFormsContainerAccessible
public:
nsXFormsSelectAccessible(nsIDOMNode *aNode, nsIWeakReference *aShell);
NS_IMETHOD GetState(PRUint32 *aState, PRUint32 *aExtraState);
// nsAccessible
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
};
@ -224,9 +234,12 @@ class nsXFormsItemCheckgroupAccessible : public nsXFormsSelectableItemAccessible
public:
nsXFormsItemCheckgroupAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *aRole);
NS_IMETHOD GetState(PRUint32 *aState, PRUint32 *aExtraState);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
// nsAccessible
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
};
@ -241,9 +254,12 @@ class nsXFormsItemRadiogroupAccessible : public nsXFormsSelectableItemAccessible
public:
nsXFormsItemRadiogroupAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *aRole);
NS_IMETHOD GetState(PRUint32 *aState, PRUint32 *aExtraState);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
// nsAccessible
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
};
@ -257,12 +273,15 @@ class nsXFormsSelectComboboxAccessible : public nsXFormsSelectableAccessible
public:
nsXFormsSelectComboboxAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *aRole);
NS_IMETHOD GetState(PRUint32 *aState, PRUint32 *aExtraState);
// Allows accessible nodes in anonymous content of xforms element by
// always returning PR_TRUE value.
NS_IMETHOD GetAllowsAnonChildAccessibles(PRBool *aAllowsAnonChildren);
// nsAccessible
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
};
@ -277,9 +296,12 @@ class nsXFormsItemComboboxAccessible : public nsXFormsSelectableItemAccessible
public:
nsXFormsItemComboboxAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *aRole);
NS_IMETHOD GetState(PRUint32 *aState, PRUint32 *aExtraState);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
// nsAccessible
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
};
#endif

View File

@ -55,9 +55,9 @@ nsXFormsDropmarkerWidgetAccessible::GetRole(PRUint32 *aRole)
return NS_OK;
}
NS_IMETHODIMP
nsXFormsDropmarkerWidgetAccessible::GetState(PRUint32 *aState,
PRUint32 *aExtraState)
nsresult
nsXFormsDropmarkerWidgetAccessible::GetStateInternal(PRUint32 *aState,
PRUint32 *aExtraState)
{
NS_ENSURE_ARG_POINTER(aState);
*aState = 0;
@ -154,13 +154,13 @@ nsXFormsComboboxPopupWidgetAccessible::GetRole(PRUint32 *aRole)
return NS_OK;
}
NS_IMETHODIMP
nsXFormsComboboxPopupWidgetAccessible::GetState(PRUint32 *aState,
PRUint32 *aExtraState)
nsresult
nsXFormsComboboxPopupWidgetAccessible::GetStateInternal(PRUint32 *aState,
PRUint32 *aExtraState)
{
NS_ENSURE_ARG_POINTER(aState);
nsresult rv = nsXFormsAccessible::GetState(aState, aExtraState);
nsresult rv = nsXFormsAccessible::GetStateInternal(aState, aExtraState);
NS_ENSURE_SUCCESS(rv, rv);
if (!mDOMNode)
return NS_OK;

View File

@ -54,12 +54,15 @@ public:
nsXFormsDropmarkerWidgetAccessible(nsIDOMNode *aNode,
nsIWeakReference *aShell);
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *aRole);
NS_IMETHOD GetState(PRUint32 *aState, PRUint32 *aExtraState);
NS_IMETHOD GetNumActions(PRUint8 *aCount);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD DoAction(PRUint8 aIndex);
// nsAccessible
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
};
@ -87,12 +90,13 @@ public:
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *aRole);
NS_IMETHOD GetState(PRUint32 *aState, PRUint32 *aExtraState);
NS_IMETHOD GetValue(nsAString& aValue);
NS_IMETHOD GetDescription(nsAString& aDescription);
// nsAccessible
virtual nsresult GetNameInternal(nsAString& aName);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
protected:
void CacheChildren();
};

View File

@ -53,10 +53,10 @@ NS_IMETHODIMP nsXULAlertAccessible::GetRole(PRUint32 *aRole)
return NS_OK;
}
NS_IMETHODIMP
nsXULAlertAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
nsresult
nsXULAlertAccessible::GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState)
{
nsresult rv = nsAccessible::GetState(aState, aExtraState);
nsresult rv = nsAccessible::GetStateInternal(aState, aExtraState);
NS_ENSURE_SUCCESS(rv, rv);
if (mDOMNode) {
*aState |= nsIAccessibleStates::STATE_ALERT_MEDIUM; // XUL has no markup for low, medium or high

View File

@ -47,10 +47,15 @@ class nsXULAlertAccessible : public nsAccessibleWrap
{
public:
nsXULAlertAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
NS_DECL_ISUPPORTS_INHERITED
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *aRole);
NS_IMETHOD GetState(PRUint32 *aState, PRUint32 *aExtraState);
NS_IMETHOD GetName(nsAString& aName);
// nsAccessible
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
};
#endif

View File

@ -65,11 +65,12 @@ NS_IMETHODIMP nsXULColorPickerTileAccessible::GetRole(PRUint32 *_retval)
/**
* Possible states: focused, focusable, selected
*/
NS_IMETHODIMP
nsXULColorPickerTileAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
nsresult
nsXULColorPickerTileAccessible::GetStateInternal(PRUint32 *aState,
PRUint32 *aExtraState)
{
// get focus and disable status from base class
nsresult rv = nsFormControlAccessible::GetState(aState, aExtraState);
nsresult rv = nsFormControlAccessible::GetStateInternal(aState, aExtraState);
NS_ENSURE_SUCCESS(rv, rv);
if (!mDOMNode)
return NS_OK;
@ -123,11 +124,12 @@ nsXULColorPickerTileAccessible(aNode, aShell)
/**
* Possible states: focused, focusable, unavailable(disabled)
*/
NS_IMETHODIMP
nsXULColorPickerAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
nsresult
nsXULColorPickerAccessible::GetStateInternal(PRUint32 *aState,
PRUint32 *aExtraState)
{
// get focus and disable status from base class
nsresult rv = nsFormControlAccessible::GetState(aState, aExtraState);
nsresult rv = nsFormControlAccessible::GetStateInternal(aState, aExtraState);
NS_ENSURE_SUCCESS(rv, rv);
if (!mDOMNode)
return NS_OK;

View File

@ -49,19 +49,23 @@ public:
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *_retval);
NS_IMETHOD GetState(PRUint32 *aState, PRUint32 *aExtraState);
NS_IMETHOD GetValue(nsAString& _retval);
// nsAccessible
virtual nsresult GetNameInternal(nsAString& aName);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
};
class nsXULColorPickerAccessible : public nsXULColorPickerTileAccessible
{
public:
nsXULColorPickerAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
NS_IMETHOD GetState(PRUint32 *aState, PRUint32 *aExtraState);
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *_retval);
// nsAccessible
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
};
#endif

View File

@ -114,11 +114,11 @@ NS_IMETHODIMP nsXULButtonAccessible::GetRole(PRUint32 *_retval)
/**
* Possible states: focused, focusable, unavailable(disabled)
*/
NS_IMETHODIMP
nsXULButtonAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
nsresult
nsXULButtonAccessible::GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState)
{
// get focus and disable status from base class
nsresult rv = nsAccessible::GetState(aState, aExtraState);
nsresult rv = nsAccessible::GetStateInternal(aState, aExtraState);
NS_ENSURE_SUCCESS(rv, rv);
if (!mDOMNode)
return NS_OK;
@ -291,8 +291,9 @@ NS_IMETHODIMP nsXULDropmarkerAccessible::GetRole(PRUint32 *aResult)
return NS_OK;
}
NS_IMETHODIMP
nsXULDropmarkerAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
nsresult
nsXULDropmarkerAccessible::GetStateInternal(PRUint32 *aState,
PRUint32 *aExtraState)
{
*aState = 0;
if (!mDOMNode) {
@ -348,7 +349,8 @@ NS_IMETHODIMP nsXULCheckboxAccessible::GetActionName(PRUint8 aIndex, nsAString&
if (aIndex == eAction_Click) {
// check or uncheck
PRUint32 state;
GetState(&state, nsnull);
nsresult rv = GetStateInternal(&state, nsnull);
NS_ENSURE_SUCCESS(rv, rv);
if (state & nsIAccessibleStates::STATE_CHECKED)
aName.AssignLiteral("uncheck");
@ -374,11 +376,12 @@ NS_IMETHODIMP nsXULCheckboxAccessible::DoAction(PRUint8 index)
/**
* Possible states: focused, focusable, unavailable(disabled), checked
*/
NS_IMETHODIMP
nsXULCheckboxAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
nsresult
nsXULCheckboxAccessible::GetStateInternal(PRUint32 *aState,
PRUint32 *aExtraState)
{
// Get focus and disable status from base class
nsresult rv = nsFormControlAccessible::GetState(aState, aExtraState);
nsresult rv = nsFormControlAccessible::GetStateInternal(aState, aExtraState);
NS_ENSURE_SUCCESS(rv, rv);
if (!mDOMNode)
return NS_OK;
@ -550,10 +553,11 @@ nsRadioButtonAccessible(aNode, aShell)
}
/** We are Focusable and can be Checked and focused */
NS_IMETHODIMP
nsXULRadioButtonAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
nsresult
nsXULRadioButtonAccessible::GetStateInternal(PRUint32 *aState,
PRUint32 *aExtraState)
{
nsresult rv = nsFormControlAccessible::GetState(aState, aExtraState);
nsresult rv = nsFormControlAccessible::GetStateInternal(aState, aExtraState);
NS_ENSURE_SUCCESS(rv, rv);
if (!mDOMNode)
return NS_OK;
@ -608,13 +612,14 @@ NS_IMETHODIMP nsXULRadioGroupAccessible::GetRole(PRUint32 *_retval)
return NS_OK;
}
NS_IMETHODIMP
nsXULRadioGroupAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
nsresult
nsXULRadioGroupAccessible::GetStateInternal(PRUint32 *aState,
PRUint32 *aExtraState)
{
// The radio group is not focusable.
// Sometimes the focus controller will report that it is focused.
// That means that the actual selected radio button should be considered focused
nsresult rv = nsAccessible::GetState(aState, aExtraState);
nsresult rv = nsAccessible::GetStateInternal(aState, aExtraState);
NS_ENSURE_SUCCESS(rv, rv);
if (mDOMNode) {
*aState &= ~(nsIAccessibleStates::STATE_FOCUSABLE |
@ -735,9 +740,9 @@ NS_IMETHODIMP nsXULToolbarSeparatorAccessible::GetRole(PRUint32 *_retval)
return NS_OK;
}
NS_IMETHODIMP
nsXULToolbarSeparatorAccessible::GetState(PRUint32 *aState,
PRUint32 *aExtraState)
nsresult
nsXULToolbarSeparatorAccessible::GetStateInternal(PRUint32 *aState,
PRUint32 *aExtraState)
{
*aState = 0; // no special state flags for toolbar separator
if (aExtraState) {
@ -760,7 +765,9 @@ NS_IMPL_ISUPPORTS_INHERITED3(nsXULTextFieldAccessible, nsAccessible, nsHyperText
NS_IMETHODIMP nsXULTextFieldAccessible::GetValue(nsAString& aValue)
{
PRUint32 state;
GetState(&state, nsnull);
nsresult rv = GetStateInternal(&state, nsnull);
NS_ENSURE_SUCCESS(rv, rv);
if (state & nsIAccessibleStates::STATE_PROTECTED) // Don't return password text!
return NS_ERROR_FAILURE;
@ -791,10 +798,12 @@ already_AddRefed<nsIDOMNode> nsXULTextFieldAccessible::GetInputField()
return inputField;
}
NS_IMETHODIMP
nsXULTextFieldAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
nsresult
nsXULTextFieldAccessible::GetStateInternal(PRUint32 *aState,
PRUint32 *aExtraState)
{
nsresult rv = nsHyperTextAccessibleWrap::GetState(aState, aExtraState);
nsresult rv = nsHyperTextAccessibleWrap::GetStateInternal(aState,
aExtraState);
NS_ENSURE_SUCCESS(rv, rv);
if (!mDOMNode)
return NS_OK;
@ -810,7 +819,7 @@ nsXULTextFieldAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
if (!tempAccessible)
return NS_ERROR_OUT_OF_MEMORY;
nsCOMPtr<nsIAccessible> kungFuDeathGrip = tempAccessible;
rv = tempAccessible->GetState(aState, nsnull);
rv = tempAccessible->GetStateInternal(aState, nsnull);
NS_ENSURE_SUCCESS(rv, rv);
if (gLastFocusedNode == mDOMNode) {

View File

@ -52,11 +52,17 @@ class nsXULButtonAccessible : public nsAccessibleWrap
public:
enum { eAction_Click = 0 };
nsXULButtonAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *_retval);
NS_IMETHOD GetState(PRUint32 *aState, PRUint32 *aExtraState);
NS_IMETHOD GetNumActions(PRUint8 *_retval);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD DoAction(PRUint8 index);
// nsAccessible
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
protected:
void CacheChildren();
};
@ -65,11 +71,15 @@ class nsXULCheckboxAccessible : public nsFormControlAccessible
public:
enum { eAction_Click = 0 };
nsXULCheckboxAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *_retval);
NS_IMETHOD GetNumActions(PRUint8 *_retval);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD DoAction(PRUint8 index);
NS_IMETHOD GetState(PRUint32 *aState, PRUint32 *aExtraState);
// nsAccessible
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
};
class nsXULDropmarkerAccessible : public nsFormControlAccessible
@ -77,12 +87,16 @@ class nsXULDropmarkerAccessible : public nsFormControlAccessible
public:
enum { eAction_Click = 0 };
nsXULDropmarkerAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *_retval);
NS_IMETHOD GetState(PRUint32 *aState, PRUint32 *aExtraState);
NS_IMETHOD GetNumActions(PRUint8 *_retval);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD DoAction(PRUint8 index);
// nsAccessible
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
private:
PRBool DropmarkerOpen(PRBool aToggleOpen);
};
@ -116,16 +130,22 @@ class nsXULRadioButtonAccessible : public nsRadioButtonAccessible
public:
nsXULRadioButtonAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
NS_IMETHOD GetState(PRUint32 *aState, PRUint32 *aExtraState);
// nsAccessible
virtual nsresult GetAttributesInternal(nsIPersistentProperties *aAttributes);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
};
class nsXULRadioGroupAccessible : public nsXULSelectableAccessible
{
public:
nsXULRadioGroupAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
NS_IMETHOD GetRole(PRUint32 *_retval);
NS_IMETHOD GetState(PRUint32 *aState, PRUint32 *aExtraState);
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *aRole);
// nsAccessible
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
};
class nsXULStatusBarAccessible : public nsAccessibleWrap
@ -154,8 +174,12 @@ class nsXULToolbarSeparatorAccessible : public nsLeafAccessible
{
public:
nsXULToolbarSeparatorAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
NS_IMETHOD GetRole(PRUint32 *_retval);
NS_IMETHOD GetState(PRUint32 *aState, PRUint32 *aExtraState);
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *aRole);
// nsAccessible
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
};
class nsXULTextFieldAccessible : public nsHyperTextAccessibleWrap
@ -167,8 +191,8 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIAccessible
NS_IMETHOD GetValue(nsAString& aValue);
NS_IMETHOD GetState(PRUint32 *aState, PRUint32 *aExtraState);
NS_IMETHOD GetRole(PRUint32 *aRole);
NS_IMETHOD GetNumActions(PRUint8 *_retval);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
@ -178,6 +202,9 @@ public:
// nsIAccessibleEditableText
NS_IMETHOD GetAssociatedEditor(nsIEditor **aEditor);
// nsAccessible
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
protected:
already_AddRefed<nsIDOMNode> GetInputField();
};

View File

@ -277,10 +277,11 @@ nsXULMenuitemAccessible::Init()
return rv;
}
NS_IMETHODIMP
nsXULMenuitemAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
nsresult
nsXULMenuitemAccessible::GetStateInternal(PRUint32 *aState,
PRUint32 *aExtraState)
{
nsresult rv = nsAccessible::GetState(aState, aExtraState);
nsresult rv = nsAccessible::GetStateInternal(aState, aExtraState);
NS_ENSURE_SUCCESS(rv, rv);
if (!mDOMNode) {
return NS_OK;
@ -356,7 +357,7 @@ nsXULMenuitemAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
NS_ASSERTION(nsAccUtils::Role(grandParentAcc) == nsIAccessibleRole::ROLE_COMBOBOX,
"grandparent of combobox listitem is not combobox");
PRUint32 grandParentState, grandParentExtState;
grandParentAcc->GetFinalState(&grandParentState, &grandParentExtState);
grandParentAcc->GetState(&grandParentState, &grandParentExtState);
*aState &= ~(nsIAccessibleStates::STATE_OFFSCREEN |
nsIAccessibleStates::STATE_INVISIBLE);
*aState |= grandParentState & nsIAccessibleStates::STATE_OFFSCREEN |
@ -559,11 +560,12 @@ nsXULMenuitemAccessible(aDOMNode, aShell)
{
}
NS_IMETHODIMP
nsXULMenuSeparatorAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
nsresult
nsXULMenuSeparatorAccessible::GetStateInternal(PRUint32 *aState,
PRUint32 *aExtraState)
{
// Isn't focusable, but can be offscreen/invisible -- only copy those states
nsresult rv = nsXULMenuitemAccessible::GetState(aState, aExtraState);
nsresult rv = nsXULMenuitemAccessible::GetStateInternal(aState, aExtraState);
NS_ENSURE_SUCCESS(rv, rv);
if (!mDOMNode) {
return NS_OK;
@ -612,10 +614,11 @@ nsXULMenupopupAccessible::nsXULMenupopupAccessible(nsIDOMNode* aDOMNode, nsIWeak
mSelectControl = do_QueryInterface(parentNode);
}
NS_IMETHODIMP
nsXULMenupopupAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
nsresult
nsXULMenupopupAccessible::GetStateInternal(PRUint32 *aState,
PRUint32 *aExtraState)
{
nsresult rv = nsAccessible::GetState(aState, aExtraState);
nsresult rv = nsAccessible::GetStateInternal(aState, aExtraState);
NS_ENSURE_SUCCESS(rv, rv);
if (!mDOMNode) {
return NS_OK;
@ -729,10 +732,11 @@ nsXULMenubarAccessible::nsXULMenubarAccessible(nsIDOMNode* aDOMNode, nsIWeakRefe
{
}
NS_IMETHODIMP
nsXULMenubarAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
nsresult
nsXULMenubarAccessible::GetStateInternal(PRUint32 *aState,
PRUint32 *aExtraState)
{
nsresult rv = nsAccessible::GetState(aState, aExtraState);
nsresult rv = nsAccessible::GetStateInternal(aState, aExtraState);
NS_ENSURE_SUCCESS(rv, rv);
if (!mDOMNode) {
return NS_OK;

View File

@ -83,7 +83,6 @@ public:
NS_IMETHOD GetDescription(nsAString& aDescription);
NS_IMETHOD GetKeyboardShortcut(nsAString& _retval);
NS_IMETHOD GetDefaultKeyBinding(nsAString& aKeyBinding);
NS_IMETHOD GetState(PRUint32 *aState, PRUint32 *aExtraState);
NS_IMETHOD GetRole(PRUint32 *_retval);
NS_IMETHOD DoAction(PRUint8 index);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
@ -94,6 +93,7 @@ public:
// nsAccessible
virtual nsresult GetNameInternal(nsAString& aName);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
virtual nsresult GetAttributesInternal(nsIPersistentProperties *aAttributes);
NS_IMETHOD GetAllowsAnonChildAccessibles(PRBool *aAllowsAnonChildren);
@ -105,7 +105,6 @@ public:
nsXULMenuSeparatorAccessible(nsIDOMNode* aDomNode, nsIWeakReference* aShell);
// nsIAccessible
NS_IMETHOD GetState(PRUint32 *aState, PRUint32 *aExtraState);
NS_IMETHOD GetRole(PRUint32 *_retval);
NS_IMETHOD DoAction(PRUint8 index);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
@ -113,6 +112,7 @@ public:
// nsAccessible
virtual nsresult GetNameInternal(nsAString& aName);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
};
class nsXULMenupopupAccessible : public nsXULSelectableAccessible
@ -121,11 +121,11 @@ public:
nsXULMenupopupAccessible(nsIDOMNode* aDomNode, nsIWeakReference* aShell);
// nsIAccessible
NS_IMETHOD GetState(PRUint32 *aState, PRUint32 *aExtraState);
NS_IMETHOD GetRole(PRUint32 *aRole);
// nsAccessible
virtual nsresult GetNameInternal(nsAString& aName);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
// nsXULMenupopupAccessible
static already_AddRefed<nsIDOMNode> FindInNodeList(nsIDOMNodeList *aNodeList,
@ -139,11 +139,11 @@ public:
nsXULMenubarAccessible(nsIDOMNode* aDomNode, nsIWeakReference* aShell);
// nsIAccessible
NS_IMETHOD GetState(PRUint32 *aState, PRUint32 *aExtraState);
NS_IMETHOD GetRole(PRUint32 *_retval);
// nsAccessible
virtual nsresult GetNameInternal(nsAString& aName);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
};
#endif

View File

@ -67,8 +67,9 @@ nsXULColumnsAccessible::GetRole(PRUint32 *aRole)
return NS_OK;
}
NS_IMETHODIMP
nsXULColumnsAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
nsresult
nsXULColumnsAccessible::GetStateInternal(PRUint32 *aState,
PRUint32 *aExtraState)
{
NS_ENSURE_ARG_POINTER(aState);
*aState = nsIAccessibleStates::STATE_READONLY;
@ -96,8 +97,9 @@ nsXULColumnItemAccessible::GetRole(PRUint32 *aRole)
return NS_OK;
}
NS_IMETHODIMP
nsXULColumnItemAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
nsresult
nsXULColumnItemAccessible::GetStateInternal(PRUint32 *aState,
PRUint32 *aExtraState)
{
NS_ENSURE_ARG_POINTER(aState);
*aState = nsIAccessibleStates::STATE_READONLY;
@ -183,8 +185,9 @@ nsXULListboxAccessible::IsTree()
////////////////////////////////////////////////////////////////////////////////
// nsXULListboxAccessible. nsIAccessible
NS_IMETHODIMP
nsXULListboxAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
nsresult
nsXULListboxAccessible::GetStateInternal(PRUint32 *aState,
PRUint32 *aExtraState)
{
// As a nsXULListboxAccessible we can have the following states:
// STATE_FOCUSED
@ -192,7 +195,7 @@ nsXULListboxAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
// STATE_FOCUSABLE
// Get focus status from base class
nsresult rv = nsAccessible::GetState(aState, aExtraState);
nsresult rv = nsAccessible::GetStateInternal(aState, aExtraState);
NS_ENSURE_SUCCESS(rv, rv);
if (!mDOMNode) {
return NS_OK;
@ -897,14 +900,12 @@ NS_IMETHODIMP nsXULListitemAccessible::GetRole(PRUint32 *aRole)
return NS_OK;
}
/**
*
*/
NS_IMETHODIMP
nsXULListitemAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
nsresult
nsXULListitemAccessible::GetStateInternal(PRUint32 *aState,
PRUint32 *aExtraState)
{
if (mIsCheckbox) {
return nsXULMenuitemAccessible::GetState(aState, aExtraState);
return nsXULMenuitemAccessible::GetStateInternal(aState, aExtraState);
}
*aState = 0;
@ -939,7 +940,8 @@ NS_IMETHODIMP nsXULListitemAccessible::GetActionName(PRUint8 aIndex, nsAString&
if (aIndex == eAction_Click && mIsCheckbox) {
// check or uncheck
PRUint32 state;
GetState(&state, nsnull);
nsresult rv = GetStateInternal(&state, nsnull);
NS_ENSURE_SUCCESS(rv, rv);
if (state & nsIAccessibleStates::STATE_CHECKED)
aName.AssignLiteral("uncheck");
@ -1037,11 +1039,12 @@ NS_IMETHODIMP nsXULComboboxAccessible::GetRole(PRUint32 *aRole)
* STATE_EXPANDED
* STATE_COLLAPSED
*/
NS_IMETHODIMP
nsXULComboboxAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
nsresult
nsXULComboboxAccessible::GetStateInternal(PRUint32 *aState,
PRUint32 *aExtraState)
{
// Get focus status from base class
nsresult rv = nsAccessible::GetState(aState, aExtraState);
nsresult rv = nsAccessible::GetStateInternal(aState, aExtraState);
NS_ENSURE_SUCCESS(rv, rv);
if (!mDOMNode) {
return NS_OK;

View File

@ -57,7 +57,9 @@ public:
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *aRole);
NS_IMETHOD GetState(PRUint32 *aState, PRUint32 *aExtraState);
// nsAccessible
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
};
/**
@ -71,7 +73,6 @@ public:
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *aRole);
NS_IMETHOD GetState(PRUint32 *aState, PRUint32 *aExtraState);
NS_IMETHOD GetNumActions(PRUint8 *aNumActions);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
@ -79,6 +80,7 @@ public:
// nsAccessible
virtual nsresult GetNameInternal(nsAString& aName);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
enum { eAction_Click = 0 };
};
@ -117,9 +119,11 @@ public:
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *aRole);
NS_IMETHOD GetState(PRUint32 *aState, PRUint32 *aExtraState);
NS_IMETHOD GetValue(nsAString& aValue);
// nsAccessible
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
protected:
PRBool IsTree();
};
@ -139,7 +143,6 @@ public:
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *_retval);
NS_IMETHOD GetState(PRUint32 *aState, PRUint32 *aExtraState);
NS_IMETHOD GetActionName(PRUint8 index, nsAString& aName);
// Don't use XUL menuitems's description attribute
NS_IMETHOD GetDescription(nsAString& aDesc) { return nsAccessibleWrap::GetDescription(aDesc); }
@ -147,6 +150,7 @@ public:
// nsAccessible
virtual nsresult GetNameInternal(nsAString& aName);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
virtual nsresult GetAttributesInternal(nsIPersistentProperties *aAttributes);
protected:
@ -185,7 +189,6 @@ public:
/* ----- nsIAccessible ----- */
NS_IMETHOD GetRole(PRUint32 *_retval);
NS_IMETHOD GetState(PRUint32 *aState, PRUint32 *aExtraState);
NS_IMETHOD GetValue(nsAString& _retval);
NS_IMETHOD GetDescription(nsAString& aDescription);
NS_IMETHOD GetAllowsAnonChildAccessibles(PRBool *aAllowsAnonChildren);
@ -195,6 +198,9 @@ public:
// nsAccessNode
virtual nsresult Init();
// nsAccessible
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
};
#endif

View File

@ -96,11 +96,11 @@ NS_IMETHODIMP nsXULTabAccessible::GetRole(PRUint32 *_retval)
/**
* Possible states: focused, focusable, unavailable(disabled), offscreen
*/
NS_IMETHODIMP
nsXULTabAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
nsresult
nsXULTabAccessible::GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState)
{
// get focus and disable status from base class
nsresult rv = nsLeafAccessible::GetState(aState, aExtraState);
nsresult rv = nsLeafAccessible::GetStateInternal(aState, aExtraState);
if (!mDOMNode) {
return NS_OK;
}

View File

@ -55,7 +55,6 @@ public:
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *_retval);
NS_IMETHOD GetState(PRUint32 *aState, PRUint32 *aExtraState);
NS_IMETHOD GetNumActions(PRUint8 *_retval);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD DoAction(PRUint8 index);
@ -64,6 +63,7 @@ public:
// nsAccessible
virtual nsresult GetAttributesInternal(nsIPersistentProperties *aAttributes);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
};
/**

View File

@ -67,10 +67,11 @@ nsXULTextAccessible::GetNameInternal(nsAString& aName)
return NS_OK;
}
NS_IMETHODIMP
nsXULTextAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
nsresult
nsXULTextAccessible::GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState)
{
nsresult rv = nsHyperTextAccessibleWrap::GetState(aState, aExtraState);
nsresult rv = nsHyperTextAccessibleWrap::GetStateInternal(aState,
aExtraState);
NS_ENSURE_SUCCESS(rv, rv);
// Labels and description have read only state
@ -122,10 +123,11 @@ nsXULTooltipAccessible::GetNameInternal(nsAString& aName)
return GetXULName(aName, PR_TRUE);
}
NS_IMETHODIMP
nsXULTooltipAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
nsresult
nsXULTooltipAccessible::GetStateInternal(PRUint32 *aState,
PRUint32 *aExtraState)
{
nsresult rv = nsLeafAccessible::GetState(aState, aExtraState);
nsresult rv = nsLeafAccessible::GetStateInternal(aState, aExtraState);
NS_ENSURE_SUCCESS(rv, rv);
*aState &= ~nsIAccessibleStates::STATE_FOCUSABLE;
@ -189,10 +191,11 @@ nsXULLinkAccessible::GetRole(PRUint32 *aRole)
}
NS_IMETHODIMP
nsXULLinkAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
nsresult
nsXULLinkAccessible::GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState)
{
nsresult rv = nsHyperTextAccessibleWrap::GetState(aState, aExtraState);
nsresult rv = nsHyperTextAccessibleWrap::GetStateInternal(aState,
aExtraState);
NS_ENSURE_SUCCESS(rv, rv);
*aState |= nsIAccessibleStates::STATE_LINKED;

View File

@ -53,13 +53,13 @@ public:
nsXULTextAccessible(nsIDOMNode* aDomNode, nsIWeakReference* aShell);
// nsIAccessible
NS_IMETHOD GetState(PRUint32 *aState, PRUint32 *aExtraState);
NS_IMETHOD GetRole(PRUint32 *aRole) { *aRole = nsIAccessibleRole::ROLE_LABEL; return NS_OK; }
NS_IMETHOD GetAccessibleRelated(PRUint32 aRelationType,
nsIAccessible **aRelated);
// nsAccessible
virtual nsresult GetNameInternal(nsAString& aName);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
};
class nsXULTooltipAccessible : public nsLeafAccessible
@ -69,11 +69,11 @@ public:
nsXULTooltipAccessible(nsIDOMNode* aDomNode, nsIWeakReference* aShell);
// nsIAccessible
NS_IMETHOD GetState(PRUint32 *aState, PRUint32 *aExtraState);
NS_IMETHOD GetRole(PRUint32 *_retval);
// nsAccessible
virtual nsresult GetNameInternal(nsAString& aName);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
};
class nsXULLinkAccessible : public nsHyperTextAccessibleWrap
@ -86,7 +86,6 @@ public:
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *aRole);
NS_IMETHOD GetState(PRUint32 *aState, PRUint32 *aExtraState);
NS_IMETHOD GetValue(nsAString& aValue);
NS_IMETHOD GetNumActions(PRUint8 *aNumActions);
@ -98,6 +97,7 @@ public:
// nsAccessible
virtual nsresult GetNameInternal(nsAString& aName);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
protected:
enum { eAction_Jump = 0 };

View File

@ -169,11 +169,11 @@ void nsXULTreeAccessible::GetTreeBoxObject(nsIDOMNode *aDOMNode, nsITreeBoxObjec
*aBoxObject = nsnull;
}
NS_IMETHODIMP
nsXULTreeAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
nsresult
nsXULTreeAccessible::GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState)
{
// Get focus status from base class
nsresult rv = nsAccessible::GetState(aState, aExtraState);
nsresult rv = nsAccessible::GetStateInternal(aState, aExtraState);
NS_ENSURE_SUCCESS(rv, rv);
if (!mDOMNode)
return NS_OK;
@ -848,8 +848,9 @@ NS_IMETHODIMP nsXULTreeitemAccessible::GetRole(PRUint32 *aRole)
// Possible states: focused, focusable, selected, checkable, checked,
// expanded/collapsed, invisible
NS_IMETHODIMP
nsXULTreeitemAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
nsresult
nsXULTreeitemAccessible::GetStateInternal(PRUint32 *aState,
PRUint32 *aExtraState)
{
NS_ENSURE_ARG_POINTER(aState);

View File

@ -61,9 +61,8 @@ public:
nsXULTreeAccessible(nsIDOMNode* aDOMNode, nsIWeakReference* aShell);
virtual ~nsXULTreeAccessible() {}
/* ----- nsIAccessible ----- */
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *_retval);
NS_IMETHOD GetState(PRUint32 *aState, PRUint32 *aExtraState);
NS_IMETHOD GetValue(nsAString& _retval);
NS_IMETHOD GetFirstChild(nsIAccessible **_retval);
@ -79,6 +78,10 @@ public:
// nsAccessNode
virtual nsresult Shutdown();
// nsAccessible
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
// nsXULTreeAccessible
static void GetTreeBoxObject(nsIDOMNode* aDOMNode, nsITreeBoxObject** aBoxObject);
static nsresult GetColumnCount(nsITreeBoxObject* aBoxObject, PRInt32 *aCount);
@ -113,7 +116,6 @@ public:
// nsIAccessible
NS_IMETHOD GetName(nsAString& aName);
NS_IMETHOD GetRole(PRUint32 *_retval);
NS_IMETHOD GetState(PRUint32 *aState, PRUint32 *aExtraState);
NS_IMETHOD GetNumActions(PRUint8 *_retval);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
virtual nsresult GetAttributesInternal(nsIPersistentProperties *aAttributes);
@ -137,6 +139,9 @@ public:
virtual nsresult Init();
virtual nsresult Shutdown();
// nsAccessible
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
protected:
PRBool IsExpandable();
nsCOMPtr<nsITreeBoxObject> mTree;

View File

@ -101,7 +101,7 @@ function testThis(aID, aAcc, aNames, aRoles, aStates, aUndesiredStates, aIndex)
function testStates(aID, aAcc, aStates, aUndesiredStates, aIndex)
{
var state = {}, extraState = {};
aAcc.getFinalState(state, extraState);
aAcc.getState(state, extraState);
if (aStates[aIndex] != 0)
is(state.value & aStates[aIndex], aStates[aIndex],
"Wrong state bits for " + aID + " at index " + aIndex + "!");

View File

@ -53,7 +53,7 @@ function getStates(aAccOrElmOrID)
return [0, 0];
var state = {}, extraState = {};
acc.getFinalState(state, extraState);
acc.getState(state, extraState);
return [state.value, extraState.value];
}

View File

@ -30,7 +30,7 @@ function testValue(aID, aAcc, aValue, aRole)
function testStates(aID, aAcc, aState, aExtraState, aAbsentState)
{
var state = {}, extraState = {};
aAcc.getFinalState(state, extraState);
aAcc.getState(state, extraState);
is(state.value & aState, aState, "wrong state bits for " + aID + "!");
is(extraState.value & aExtraState, aExtraState,
"wrong extraState bits for " + aID + "!");

View File

@ -26,7 +26,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=429285
{
// Check state of aAcc first.
var state = {}, extraState = {};
aAcc.getFinalState(state, extraState);
aAcc.getState(state, extraState);
if (state.value & state_focusable) {
is(state.value & state_disabled, state_disabled,
"Wrong disabled state bit for " + aID + "!");
@ -63,7 +63,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=429285
if (groupAcc) {
var state = {}, extraState = {};
groupAcc.getFinalState(state, extraState);
groupAcc.getState(state, extraState);
is(state.value & state_disabled, state_disabled,
"Wrong disabled state bit for Group element!");
testChildren("group", groupAcc);

View File

@ -46,7 +46,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=441737
// check if it is focusable, read-only.
var state = {}, extraState = {}
docAcc.getFinalState(state, extraState);
docAcc.getState(state, extraState);
var desiredStates = (state_focusable | state_readonly);
is(state.value & desiredStates, desiredStates,
"Wrong state bits for document!");

View File

@ -42,7 +42,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=418368
aShowStateDebugFlag)
{
var state = {}, extraState = {};
aAcc.getFinalState(state, extraState);
aAcc.getState(state, extraState);
if (aShowStateDebugFlag) {
var list = gAccRetrieval.getStringStates(state.value, 0);

View File

@ -36,7 +36,7 @@
function testStates(aID, aAcc, aState, aExtraState, aUndesiredState)
{
var state = {}, extraState = {};
aAcc.getFinalState(state, extraState);
aAcc.getState(state, extraState);
is(state.value & aState, aState, "Wrong state bits for " + aID + "!");
is(extraState.value & aExtraState, aExtraState,
"Wrong extra state bits for " + aID + "!");
@ -119,7 +119,7 @@
"Wrong name for normal label!");
var stateNormal = {}, extraStateNormal = {};
normalLabelAcc.getFinalState(stateNormal, extraStateNormal);
normalLabelAcc.getState(stateNormal, extraStateNormal);
undesiredState = (state_focusable | state_linked);
is(stateNormal.value & undesiredState, 0, "Wrong state bits for normal label!");
}

View File

@ -97,7 +97,7 @@
"Focus wasn't recieved for element with ID " + aFocusMgr.mName + ".");
var states = {}, extraStates = {};
aFocusMgr.mAcc.getFinalState(states, extraStates);
aFocusMgr.mAcc.getState(states, extraStates);
// XXX see bug 455840. Only fails on aria-link, the other two are OK.
// When fixing this bug, remove the if statement and else block and "todo" statement.
if (states.value & nsIAccessibleStates.STATE_FOCUSED)

View File

@ -47,7 +47,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=441519
// check if it is focusable, not desired.
var state = {}, extraState = {}
outerDocAcc.getFinalState(state, extraState);
outerDocAcc.getState(state, extraState);
is(state.value & state_focusable, 0,
"Wrong focusable state bit for internal frame!");