From 6d7e1a7bf45372b92ac21f3f95fb446b76332827 Mon Sep 17 00:00:00 2001 From: Brian Birtles Date: Fri, 11 Feb 2011 10:04:36 +0900 Subject: [PATCH] Bug 628888 - Ensure external documents loaded after page show get page show update; r=dholbert, bzbarsky; a=roc --HG-- extra : rebase_source : 0f17e5fb3e7e831b0a7222697ec87631dc879286 --- content/base/src/nsDocument.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/content/base/src/nsDocument.cpp b/content/base/src/nsDocument.cpp index dcf323e7893..5241abbac51 100644 --- a/content/base/src/nsDocument.cpp +++ b/content/base/src/nsDocument.cpp @@ -883,6 +883,17 @@ TransferZoomLevels(nsIDocument* aFromDoc, toCtxt->SetTextZoom(fromCtxt->TextZoom()); } +void +TransferShowingState(nsIDocument* aFromDoc, nsIDocument* aToDoc) +{ + NS_ABORT_IF_FALSE(aFromDoc && aToDoc, + "transferring showing state from/to null doc"); + + if (aFromDoc->IsShowing()) { + aToDoc->OnPageShow(PR_TRUE, nsnull); + } +} + nsresult nsExternalResourceMap::AddExternalResource(nsIURI* aURI, nsIDocumentViewer* aViewer, @@ -942,6 +953,7 @@ nsExternalResourceMap::AddExternalResource(nsIURI* aURI, newResource->mLoadGroup = aLoadGroup; if (doc) { TransferZoomLevels(aDisplayDocument, doc); + TransferShowingState(aDisplayDocument, doc); } }