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

This commit is contained in:
Brian Birtles 2011-02-11 16:01:59 +09:00
parent aab564bec3
commit 667b461dfa

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