Fix fastback regression where IsZombieDocument could return false even if we are in a zombie document. Bug 301804, r=aaronl, sr+a=dbaron

This commit is contained in:
bryner%brianryner.com 2005-08-05 20:01:52 +00:00
Родитель db10260a30
Коммит dcf71c0ed1
1 изменённых файлов: 5 добавлений и 3 удалений

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

@ -5900,12 +5900,14 @@ PresShell::PopCurrentEventInfo()
PRBool PresShell::InZombieDocument(nsIContent *aContent) PRBool PresShell::InZombieDocument(nsIContent *aContent)
{ {
// If a content node points to a null document, it is possibly in a // If a content node points to a null document, or the document is not
// zombie document, about to be replaced by a newly loading document. // attached to a window, then it is possibly in a zombie document,
// about to be replaced by a newly loading document.
// Such documents cannot handle DOM events. // Such documents cannot handle DOM events.
// It might actually be in a node not attached to any document, // It might actually be in a node not attached to any document,
// in which case there is not parent presshell to retarget it to. // in which case there is not parent presshell to retarget it to.
return !aContent->GetDocument(); nsIDocument *doc = aContent->GetDocument();
return !doc || !doc->GetScriptGlobalObject();
} }
nsresult PresShell::RetargetEventToParent(nsIView *aView, nsresult PresShell::RetargetEventToParent(nsIView *aView,