Bug 760038 - crash in NotificationController::WillRefresh, r=tbsaunde

This commit is contained in:
Alexander Surkov 2012-06-02 14:14:42 +09:00
parent c97a446579
commit a26b9e61bb
3 changed files with 8 additions and 9 deletions

View File

@ -11,12 +11,6 @@
#include "nsAccessibilityService.h"
#include "NotificationController.h"
inline DocAccessible*
DocAccessible::ParentDocument() const
{
return GetAccService()->GetDocAccessible(mDocument->GetParentDocument());
}
inline void
DocAccessible::BindChildDocument(DocAccessible* aDocument)
{

View File

@ -2043,8 +2043,12 @@ DocAccessible::IsLoadEventTarget() const
// Return true if it's not a root document (either tab document or
// frame/iframe document) and its parent document is not in loading state.
if (parentTreeItem)
return ParentDocument()->HasLoadState(eCompletelyLoaded);
// Note: we can get notifications while document is loading (and thus
// while there's no parent document yet).
if (parentTreeItem) {
DocAccessible* parentDoc = ParentDocument();
return parentDoc && parentDoc->HasLoadState(eCompletelyLoaded);
}
// It's content (not chrome) root document.
PRInt32 contentType;

View File

@ -152,7 +152,8 @@ public:
/**
* Return the parent document.
*/
DocAccessible* ParentDocument() const;
DocAccessible* ParentDocument() const
{ return mParent ? mParent->Document() : nsnull; }
/**
* Return the child document count.