Bug 307534. Accessibklity cache can become corrupt after get_accFocus(). r=parente, sr=jst

git-svn-id: svn://10.0.0.236/trunk@179884 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
aaronleventhal%moonset.net 2005-09-09 02:30:16 +00:00
parent 0ce78185b1
commit b9127673b6
2 changed files with 12 additions and 2 deletions

View File

@ -1813,6 +1813,15 @@ NS_IMETHODIMP nsAccessibilityService::GetAccessible(nsIDOMNode *aNode,
return NS_OK;
}
NS_ASSERTION(content->GetDocument(), "Creating accessible for node with no document");
if (!content->GetDocument()) {
return NS_ERROR_FAILURE;
}
NS_ASSERTION(content->GetDocument() == aPresShell->GetDocument(), "Creating accessible for wrong pres shell");
if (content->GetDocument() != aPresShell->GetDocument()) {
return NS_ERROR_FAILURE;
}
// We have a content node
nsIFrame *frame = *aFrameHint;
if (content->IsContentOfType(nsIContent::eXUL)) {

View File

@ -229,10 +229,11 @@ NS_IMETHODIMP nsDocAccessible::GetFocusedChild(nsIAccessible **aFocusedChild)
return NS_OK;
}
// Return an accessible for the current global focus, which does not have to
// be contained within the current document.
nsCOMPtr<nsIAccessibilityService> accService =
do_GetService("@mozilla.org/accessibilityService;1");
return accService->GetAccessibleInWeakShell(gLastFocusedNode, mWeakShell,
aFocusedChild);
return accService->GetAccessibleFor(gLastFocusedNode, aFocusedChild);
}
// ------- nsIAccessibleDocument Methods (5) ---------------