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 14:04:25 +00:00
Родитель ce39c9c786
Коммит 07ae6f322d
1 изменённых файлов: 13 добавлений и 0 удалений

Просмотреть файл

@ -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);