Bug 406838. Crash [@ nsDocAccessible::InvalidateCacheSubtree]. r=gijs, a=dsicore

This commit is contained in:
aaronleventhal@moonset.net 2007-12-04 18:51:22 -08:00
parent a9d75820d2
commit c9d6e41a67

View File

@ -1756,6 +1756,9 @@ NS_IMETHODIMP nsDocAccessible::InvalidateCacheSubtree(nsIContent *aChild,
NS_ENSURE_TRUE(mDOMNode, NS_ERROR_FAILURE);
nsCOMPtr<nsIDOMNode> childNode = aChild ? do_QueryInterface(aChild) : mDOMNode;
nsCOMPtr<nsIPresShell> presShell = GetPresShell();
NS_ENSURE_TRUE(presShell, NS_ERROR_FAILURE);
if (!mIsContentLoaded) {
// Still loading document
if (mAccessNodeCache.Count() <= 1) {
@ -1769,8 +1772,6 @@ NS_IMETHODIMP nsDocAccessible::InvalidateCacheSubtree(nsIContent *aChild,
return InvalidateChildren();
}
if (aChangeEventType == nsIAccessibleEvent::EVENT_DOM_CREATE) {
nsCOMPtr<nsIPresShell> presShell = GetPresShell();
NS_ENSURE_TRUE(presShell, NS_ERROR_FAILURE);
nsIEventStateManager *esm = presShell->GetPresContext()->EventStateManager();
NS_ENSURE_TRUE(esm, NS_ERROR_FAILURE);
if (!esm->IsHandlingUserInputExternal()) {
@ -1834,9 +1835,8 @@ NS_IMETHODIMP nsDocAccessible::InvalidateCacheSubtree(nsIContent *aChild,
if (!isShowing) {
// Fire EVENT_ASYNCH_HIDE or EVENT_DOM_DESTROY
nsCOMPtr<nsIContent> content(do_QueryInterface(childNode));
if (isHiding) {
nsCOMPtr<nsIPresShell> presShell = GetPresShell();
nsCOMPtr<nsIContent> content(do_QueryInterface(childNode));
if (content) {
nsIFrame *frame = presShell->GetPrimaryFrameFor(content);
if (frame) {