Bug 342186. Implement nsIAccessible::EXT_STATE_DEFUNCT. r=ginn.chen

This commit is contained in:
aaronleventhal%moonset.net 2006-06-21 14:00:11 +00:00
Родитель 59a695aa6d
Коммит 09330745ca
5 изменённых файлов: 11 добавлений и 13 удалений

Просмотреть файл

@ -299,6 +299,7 @@ interface nsIAccessible : nsISupports
* Extended state flags (for now non-MSAA, for Java and Gnome/ATK support)
* "Extended state flags" has seperate value space from "MSAA State flags".
*/
const unsigned long EXT_STATE_DEFUNCT = 0x00080000; // Object no longer exists
const unsigned long EXT_STATE_SELECTABLE_TEXT= 0x00100000; // For text which is selectable, object must implement nsIAccessibleText
const unsigned long EXT_STATE_EDITABLE = 0x00200000; // Used for XUL/HTML input (type = text,password) element
const unsigned long EXT_STATE_ACTIVE = 0x00400000; // This window is currently the active window

Просмотреть файл

@ -261,15 +261,6 @@ nsAccessibleWrap::~nsAccessibleWrap()
}
}
NS_IMETHODIMP nsAccessibleWrap::GetExtState(PRUint32 *aState)
{
PRUint32 state;
nsAccessible::GetState(&state);
if (!(state & STATE_INVISIBLE))
*aState |= EXT_STATE_SHOWING;
return NS_OK;
}
NS_IMETHODIMP nsAccessibleWrap::GetNativeInterface(void **aOutAccessible)
{
*aOutAccessible = nsnull;
@ -596,6 +587,10 @@ nsAccessibleWrap::TranslateStates(PRUint32 aState, PRUint32 aExtState, void *aAt
if (aExtState & nsIAccessible::EXT_STATE_EDITABLE)
atk_state_set_add_state (state_set, ATK_STATE_EDITABLE);
if (aExtState & nsIAccessible::EXT_STATE_DEFUNCT)
atk_state_set_add_state (state_set, ATK_STATE_DEFUNCT);
}
PRBool nsAccessibleWrap::IsValidObject()

Просмотреть файл

@ -116,7 +116,6 @@ public:
public:
// return the atk object for this nsAccessibleWrap
NS_IMETHOD GetNativeInterface(void **aOutAccessible);
NS_IMETHOD GetExtState(PRUint32 *aState);
AtkObject * GetAtkObject(void);

Просмотреть файл

@ -2200,9 +2200,11 @@ NS_IMETHODIMP nsAccessible::ExtendSelection()
NS_IMETHODIMP nsAccessible::GetExtState(PRUint32 *aExtState)
{
if (!mDOMNode) {
return NS_ERROR_FAILURE; // Node shut down
*aExtState = EXT_STATE_DEFUNCT;
return NS_OK; // Node shut down
}
*aExtState = 0;
*aExtState = (State(this) & STATE_INVISIBLE) ? EXT_STATE_SHOWING : 0;
// XXX We can remove this hack once we support RDF-based role & state maps
if (mRoleMapEntry && (mRoleMapEntry->role == ROLE_ENTRY || mRoleMapEntry->role == ROLE_PASSWORD_TEXT)) {
*aExtState = NS_LITERAL_CSTRING("textarea").Equals(mRoleMapEntry->roleString) ?

Просмотреть файл

@ -148,6 +148,8 @@ public:
#endif
static PRBool IsCorrectFrameType(nsIFrame* aFrame, nsIAtom* aAtom);
static PRUint32 State(nsIAccessible *aAcc) { PRUint32 state; aAcc->GetFinalState(&state); return state; }
static PRUint32 Role(nsIAccessible *aAcc) { PRUint32 role; aAcc->GetRole(&role); return role; }
protected:
PRBool MappedAttrState(nsIContent *aContent, PRUint32 *aStateInOut, nsStateMapEntry *aStateMapEntry);
@ -192,7 +194,6 @@ protected:
// Hyperlink helpers
virtual nsresult GetLinkOffset(PRInt32* aStartOffset, PRInt32* aEndOffset);
static PRUint32 Role(nsIAccessible *aAcc) { PRUint32 role; aAcc->GetRole(&role); return role; }
// For accessibles that have actions
static void DoCommandCallback(nsITimer *aTimer, void *aClosure);