Bug 815055 - crash in nsCoreUtils::IsTabDocument, r=tbsaund

This commit is contained in:
Alexander Surkov 2012-12-30 01:33:59 +09:00
parent 42779407f8
commit 58d66cf520
3 changed files with 10 additions and 5 deletions

View File

@ -1469,9 +1469,11 @@ DocAccessible::NotifyOfLoading(bool aIsReloading)
void void
DocAccessible::DoInitialUpdate() DocAccessible::DoInitialUpdate()
{ {
if (nsCoreUtils::IsTabDocument(mDocumentNode))
mDocFlags |= eTabDocument;
// We provide a virtual cursor if this is a root doc or if it's a tab doc. // We provide a virtual cursor if this is a root doc or if it's a tab doc.
if (!(mDocumentNode->GetParentDocument()) || if (!mDocumentNode->GetParentDocument() || (mDocFlags & eTabDocument))
nsCoreUtils::IsTabDocument(mDocumentNode))
mDocFlags |= eCursorable; mDocFlags |= eCursorable;
mLoadState |= eTreeConstructed; mLoadState |= eTreeConstructed;

View File

@ -493,7 +493,10 @@ protected:
eScrollInitialized = 1 << 0, eScrollInitialized = 1 << 0,
// Whether we support nsIAccessibleCursorable. // Whether we support nsIAccessibleCursorable.
eCursorable = 1 << 1 eCursorable = 1 << 1,
// Whether the document is a tab document.
eTabDocument = 1 << 2
}; };
/** /**

View File

@ -223,7 +223,7 @@ DocAccessibleWrap::Shutdown()
// Do window emulation specific shutdown if emulation was started. // Do window emulation specific shutdown if emulation was started.
if (nsWinUtils::IsWindowEmulationStarted()) { if (nsWinUtils::IsWindowEmulationStarted()) {
// Destroy window created for root document. // Destroy window created for root document.
if (nsCoreUtils::IsTabDocument(mDocumentNode)) { if (mDocFlags & eTabDocument) {
sHWNDCache.Remove(mHWND); sHWNDCache.Remove(mHWND);
::DestroyWindow(static_cast<HWND>(mHWND)); ::DestroyWindow(static_cast<HWND>(mHWND));
} }
@ -253,7 +253,7 @@ DocAccessibleWrap::DoInitialUpdate()
if (nsWinUtils::IsWindowEmulationStarted()) { if (nsWinUtils::IsWindowEmulationStarted()) {
// Create window for tab document. // Create window for tab document.
if (nsCoreUtils::IsTabDocument(mDocumentNode)) { if (mDocFlags & eTabDocument) {
mozilla::dom::TabChild* tabChild = mozilla::dom::TabChild* tabChild =
mozilla::dom::GetTabChildFrom(mDocumentNode->GetShell()); mozilla::dom::GetTabChildFrom(mDocumentNode->GetShell());