From 195ff5ec424dd17e1adda049fb893ec2556ad18a Mon Sep 17 00:00:00 2001 From: "bryner%brianryner.com" Date: Tue, 1 Nov 2005 21:55:34 +0000 Subject: [PATCH] Restore the focus listener in Open() that was removed in Close() (bug 314400). Patch by saito@densan.co.jp, r=me, sr=brendan. git-svn-id: svn://10.0.0.236/trunk@183363 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/base/nsDocumentViewer.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/mozilla/layout/base/nsDocumentViewer.cpp b/mozilla/layout/base/nsDocumentViewer.cpp index bd8f5a0326b..e57eebd1c44 100644 --- a/mozilla/layout/base/nsDocumentViewer.cpp +++ b/mozilla/layout/base/nsDocumentViewer.cpp @@ -1241,6 +1241,17 @@ DocumentViewerImpl::Open(nsISupports *aState) SyncParentSubDocMap(); + if (mFocusListener) { + // get the DOM event receiver + nsCOMPtr erP(do_QueryInterface(mDocument)); + NS_WARN_IF_FALSE(erP, "No event receiver in document!"); + + if (erP) { + erP->AddEventListenerByIID(mFocusListener, + NS_GET_IID(nsIDOMFocusListener)); + } + } + // XXX re-enable image animations once that works correctly PrepareToStartLoad();