Bug 375747. Should not fire nsIAccessible::EVENT_FOCUS for top level window (nsRootAccessible). r=parente

This commit is contained in:
aaronleventhal@moonset.net 2007-04-10 11:41:40 -07:00
parent 6ab774da75
commit 97a4bbcebe

View File

@ -506,9 +506,10 @@ PRBool nsRootAccessible::FireAccessibleFocusEvent(nsIAccessible *aAccessible,
if (docAccessible) {
// Doc is gaining focus, but actual focus may be on an element within document
nsCOMPtr<nsIDOMNode> realFocusedNode = GetCurrentFocus();
if (realFocusedNode != aNode) {
if (realFocusedNode != aNode || realFocusedNode == mDOMNode) {
// Suppress document focus, because real DOM focus will be fired next,
// and that's what we care about
// Make sure we never fire focus for the nsRootAccessible (mDOMNode)
return PR_FALSE;
}
}