Bug 638465 - do not ignore inital documents, r=tbsaunde

This commit is contained in:
Alexander Surkov 2014-04-02 15:36:48 -04:00
Родитель e3e4dd4f5e
Коммит e31688cbd8
2 изменённых файлов: 21 добавлений и 10 удалений

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

@ -271,11 +271,6 @@ DocManager::HandleEvent(nsIDOMEvent* aEvent)
logging::DocDestroy("received 'pagehide' event", document); logging::DocDestroy("received 'pagehide' event", document);
#endif #endif
// Ignore 'pagehide' on temporary documents since we ignore them entirely in
// accessibility.
if (document->IsInitialDocument())
return NS_OK;
// Shutdown this one and sub document accessibles. // Shutdown this one and sub document accessibles.
// We're allowed to not remove listeners when accessible document is // We're allowed to not remove listeners when accessible document is
@ -370,10 +365,8 @@ DocManager::RemoveListeners(nsIDocument* aDocument)
DocAccessible* DocAccessible*
DocManager::CreateDocOrRootAccessible(nsIDocument* aDocument) DocManager::CreateDocOrRootAccessible(nsIDocument* aDocument)
{ {
// Ignore temporary, hiding, resource documents and documents without // Ignore hiding, resource documents and documents without docshell.
// docshell. if (!aDocument->IsVisibleConsideringAncestors() ||
if (aDocument->IsInitialDocument() ||
!aDocument->IsVisibleConsideringAncestors() ||
aDocument->IsResourceDoc() || !aDocument->IsActive()) aDocument->IsResourceDoc() || !aDocument->IsActive())
return nullptr; return nullptr;

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

@ -52,6 +52,24 @@
} }
} }
function browserReorderChecker()
{
this.type = EVENT_REORDER;
this.match = function browserReorderChecker_match(aEvent)
{
// Reorder event might be duped because of temporary document creation.
if (aEvent.accessible == getAccessible(currentBrowser())) {
this.cnt++;
return this.cnt != 2;
}
return false;
}
this.cnt = 0;
}
function loadOneTab(aURI) function loadOneTab(aURI)
{ {
this.invoke = function loadOneTab_invoke() this.invoke = function loadOneTab_invoke()
@ -60,7 +78,7 @@
} }
this.eventSeq = [ this.eventSeq = [
new invokerChecker(EVENT_REORDER, currentBrowser) new browserReorderChecker()
]; ];
this.finalCheck = function loadURI_finalCheck() this.finalCheck = function loadURI_finalCheck()