Bug 413778. Avoid creating and destroying extra empty nsDocAccessible when new tab opened. r=ginn.chen, a=blocking1.9

This commit is contained in:
aaronleventhal@moonset.net 2008-02-26 06:04:25 -08:00
parent a232ebcba5
commit 32c4f34e3c

View File

@ -419,6 +419,19 @@ nsAccessibilityService::CreateRootAccessible(nsIPresShell *aShell,
nsCOMPtr<nsIContentViewer> contentViewer;
docShell->GetContentViewer(getter_AddRefs(contentViewer));
NS_ENSURE_TRUE(contentViewer, NS_ERROR_FAILURE); // Doc was already shut down
PRUint32 busyFlags;
docShell->GetBusyFlags(&busyFlags);
if (busyFlags != nsIDocShell::BUSY_FLAGS_NONE) {
nsCOMPtr<nsIWebNavigation> webNav(do_GetInterface(docShell));
nsCOMPtr<nsIURI> uri;
webNav->GetCurrentURI(getter_AddRefs(uri));
NS_ENSURE_STATE(uri);
nsCAutoString url;
uri->GetSpec(url);
if (url.EqualsLiteral("about:blank")) {
return NS_OK; // No load events for a busy about:blank -- they are often temporary
}
}
nsCOMPtr<nsIDocShellTreeItem> docShellTreeItem =
do_QueryInterface(container);