Bug 628888 - Ensure external documents loaded after page show get page show update; r=dholbert, bzbarsky; a=roc

--HG--
extra : rebase_source : 0f17e5fb3e7e831b0a7222697ec87631dc879286
This commit is contained in:
Brian Birtles 2011-02-11 10:04:36 +09:00
parent d33f310364
commit 6d7e1a7bf4

View File

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