Fix for bug 77507. Set default background color correctly. Warn if it isn't set correctly. r=waterson,sr=attinasi,a=blizzard
git-svn-id: svn://10.0.0.236/trunk@95913 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -3927,6 +3927,28 @@ nsDocShell::SetupNewViewer(nsIContentViewer * aNewViewer)
|
||||
// Stop any activity that may be happening in the old document before
|
||||
// releasing it...
|
||||
mContentViewer->Stop();
|
||||
|
||||
// Try to extract the default background color from the old
|
||||
// view manager, so we can use it for the next document.
|
||||
nsCOMPtr<nsIDocumentViewer> docviewer =
|
||||
do_QueryInterface(mContentViewer);
|
||||
|
||||
if (docviewer) {
|
||||
nsCOMPtr<nsIPresShell> shell;
|
||||
docviewer->GetPresShell(*getter_AddRefs(shell));
|
||||
|
||||
if (shell) {
|
||||
nsCOMPtr<nsIViewManager> vm;
|
||||
shell->GetViewManager(getter_AddRefs(vm));
|
||||
|
||||
if (vm) {
|
||||
vm->GetDefaultBackgroundColor(&bgcolor);
|
||||
// If the background color is not known, don't propagate it.
|
||||
bgSet = NS_GET_A(bgcolor) != 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mContentViewer->Destroy();
|
||||
aNewViewer->SetPreviousViewer(mContentViewer);
|
||||
mContentViewer = nsnull;
|
||||
|
||||
Reference in New Issue
Block a user