mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 22:32:46 +00:00
Bug 20315: Copy charset info from parent down into child content viewer r=buster
This commit is contained in:
parent
572e8726ef
commit
89ea13c2bd
@ -808,16 +808,39 @@ nsWebShell::Embed(nsIContentViewer* aContentViewer,
|
||||
("nsWebShell::Embed: this=%p aDocViewer=%p aCommand=%s aExtraInfo=%p",
|
||||
this, aContentViewer, aCommand ? aCommand : "", aExtraInfo));
|
||||
|
||||
//
|
||||
// The following logic is mirrored in nsHTMLDocument::StartDocumentLoad!
|
||||
//
|
||||
nsCOMPtr<nsIMarkupDocumentViewer> oldMUDV;
|
||||
if (mContentViewer) // && (eCharsetReloadInit!=mCharsetReloadState))
|
||||
{ // get any interesting state from the old content viewer
|
||||
// XXX: it would be far better to just reuse the document viewer ,
|
||||
// since we know we're just displaying the same document as before
|
||||
oldMUDV = do_QueryInterface(mContentViewer);
|
||||
}
|
||||
else
|
||||
{ // If we don't have an old content viewer, get state from our parent
|
||||
// in this block of code, if we get an error result, we return it
|
||||
// but if we get a null pointer, that's perfectly legal for parent and parentContentViewer
|
||||
nsCOMPtr<nsIWebShell> parent;
|
||||
rv = GetParent(*getter_AddRefs(parent));
|
||||
if (NS_FAILED(rv)) { return rv; }
|
||||
if (parent) {
|
||||
nsCOMPtr<nsIContentViewer> parentContentViewer;
|
||||
rv = parent->GetContentViewer(getter_AddRefs(parentContentViewer));
|
||||
if (NS_FAILED(rv)) { return rv; }
|
||||
if (parentContentViewer) {
|
||||
oldMUDV = do_QueryInterface(parentContentViewer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (oldMUDV) {
|
||||
PRUnichar *defaultCharset=nsnull;
|
||||
PRUnichar *forceCharset=nsnull;
|
||||
PRUnichar *hintCharset=nsnull;
|
||||
PRInt32 hintCharsetSource;
|
||||
|
||||
nsCOMPtr<nsIMarkupDocumentViewer> oldMUDV = do_QueryInterface(mContentViewer);
|
||||
nsCOMPtr<nsIMarkupDocumentViewer> newMUDV = do_QueryInterface(aContentViewer);
|
||||
if (oldMUDV && newMUDV)
|
||||
{
|
||||
|
@ -808,16 +808,39 @@ nsWebShell::Embed(nsIContentViewer* aContentViewer,
|
||||
("nsWebShell::Embed: this=%p aDocViewer=%p aCommand=%s aExtraInfo=%p",
|
||||
this, aContentViewer, aCommand ? aCommand : "", aExtraInfo));
|
||||
|
||||
//
|
||||
// The following logic is mirrored in nsHTMLDocument::StartDocumentLoad!
|
||||
//
|
||||
nsCOMPtr<nsIMarkupDocumentViewer> oldMUDV;
|
||||
if (mContentViewer) // && (eCharsetReloadInit!=mCharsetReloadState))
|
||||
{ // get any interesting state from the old content viewer
|
||||
// XXX: it would be far better to just reuse the document viewer ,
|
||||
// since we know we're just displaying the same document as before
|
||||
oldMUDV = do_QueryInterface(mContentViewer);
|
||||
}
|
||||
else
|
||||
{ // If we don't have an old content viewer, get state from our parent
|
||||
// in this block of code, if we get an error result, we return it
|
||||
// but if we get a null pointer, that's perfectly legal for parent and parentContentViewer
|
||||
nsCOMPtr<nsIWebShell> parent;
|
||||
rv = GetParent(*getter_AddRefs(parent));
|
||||
if (NS_FAILED(rv)) { return rv; }
|
||||
if (parent) {
|
||||
nsCOMPtr<nsIContentViewer> parentContentViewer;
|
||||
rv = parent->GetContentViewer(getter_AddRefs(parentContentViewer));
|
||||
if (NS_FAILED(rv)) { return rv; }
|
||||
if (parentContentViewer) {
|
||||
oldMUDV = do_QueryInterface(parentContentViewer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (oldMUDV) {
|
||||
PRUnichar *defaultCharset=nsnull;
|
||||
PRUnichar *forceCharset=nsnull;
|
||||
PRUnichar *hintCharset=nsnull;
|
||||
PRInt32 hintCharsetSource;
|
||||
|
||||
nsCOMPtr<nsIMarkupDocumentViewer> oldMUDV = do_QueryInterface(mContentViewer);
|
||||
nsCOMPtr<nsIMarkupDocumentViewer> newMUDV = do_QueryInterface(aContentViewer);
|
||||
if (oldMUDV && newMUDV)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user