Bug 244753. Expose which panes are editor panes. r=kyle, sr=jst

git-svn-id: svn://10.0.0.236/trunk@157413 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
aaronleventhal%moonset.net
2004-06-04 22:03:14 +00:00
parent a4d1ae1d51
commit 2956d11905
2 changed files with 28 additions and 7 deletions

View File

@@ -123,9 +123,15 @@ NS_IMETHODIMP nsDocAccessibleWrap::FireToolkitEvent(PRUint32 aEvent,
switch (pAtkStateChange->state) {
case nsIAccessible::STATE_INVISIBLE:
atkState = ATK_STATE_VISIBLE;
pAtkStateChange->enable = !pAtkStateChange->enable;
break;
case nsIAccessible::STATE_UNAVAILABLE:
atkState = ATK_STATE_ENABLED;
pAtkStateChange->enable = !pAtkStateChange->enable;
break;
case nsIAccessible::STATE_READONLY:
atkState = ATK_STATE_EDITABLE;
pAtkStateChange->enable = !pAtkStateChange->enable;
break;
default:
atkState = TranslateAState(pAtkStateChange->state);
@@ -451,12 +457,16 @@ TranslateAState(PRUint32 aState)
return ATK_STATE_MULTISELECTABLE;
#if 0
// The following two state need to deal specially
// The following states are opposite the MSAA states.
// We need to deal with them specially
case nsIAccessible::STATE_INVISIBLE:
return !ATK_STATE_VISIBLE;
case nsIAccessible::STATE_UNAVAILABLE:
return !ATK_STATE_ENABLED;
case nsIAccessible::STATE_READONLY:
return !ATK_STATE_EDITABLE;
#endif
// The following state is

View File

@@ -169,16 +169,13 @@ NS_IMETHODIMP nsDocAccessible::GetState(PRUint32 *aState)
*aState |= STATE_INVISIBLE;
}
#ifdef DEBUG
PRBool isEditable;
GetIsEditable(&isEditable);
if (isEditable) {
// Just for debugging, to show we're in editor on pane object
// We don't use STATE_MARQUEED for anything else
*aState |= STATE_MARQUEED;
if (!isEditable) {
// Use STATE_READONLY when we're not in an editor pane
*aState |= STATE_READONLY;
}
#endif
return NS_OK;
}
@@ -295,6 +292,9 @@ NS_IMETHODIMP nsDocAccessible::GetDocument(nsIDOMDocument **aDOMDoc)
void nsDocAccessible::CheckForEditor()
{
if (mEditor) {
return; // Already have editor, don't need to check
}
if (!mDocument) {
return; // No document -- we've been shut down
}
@@ -308,6 +308,17 @@ void nsDocAccessible::CheckForEditor()
return; // No editing session interface
editingSession->GetEditorForWindow(domWindow, getter_AddRefs(mEditor));
if (mEditor) {
// State readonly is now clear
#ifdef MOZ_ACCESSIBILITY_ATK
AtkStateChange stateData;
stateData.enable = PR_TRUE;
stateData.state = STATE_READONLY; // Will be translated to ATK_STATE_EDITABLE
FireToolkitEvent(nsIAccessibleEvent::EVENT_STATE_CHANGE, this, &stateData);
#else
FireToolkitEvent(nsIAccessibleEvent::EVENT_STATE_CHANGE, this, nsnull);
#endif
}
}
NS_IMETHODIMP nsDocAccessible::GetIsEditable(PRBool *aIsEditable)