fix bug 5644. reviewed by nisheeth and approved by cyeh. broadcast default character set to all the children and make sure all the children set to the same value when they are added to the parent

This commit is contained in:
ftang%netscape.com 1999-04-28 23:59:08 +00:00
parent 16db69f754
commit 16f64c1f10
2 changed files with 16 additions and 0 deletions

View File

@ -1210,6 +1210,7 @@ nsWebShell::AddChild(nsIWebShell* aChild)
}
mChildren.AppendElement(aChild);
aChild->SetParent(this);
aChild->SetDefaultCharacterSet(mDefaultCharacterSet);
NS_ADDREF(aChild);
return NS_OK;
@ -2767,6 +2768,13 @@ NS_IMETHODIMP
nsWebShell::SetDefaultCharacterSet (const PRUnichar* aDefaultCharacterSet)
{
mDefaultCharacterSet = aDefaultCharacterSet;
PRInt32 i, n = mChildren.Count();
for (i = 0; i < n; i++) {
nsIWebShell* child = (nsIWebShell*) mChildren.ElementAt(i);
if (nsnull != child) {
child->SetDefaultCharacterSet(aDefaultCharacterSet);
}
}
return NS_OK;
}

View File

@ -1210,6 +1210,7 @@ nsWebShell::AddChild(nsIWebShell* aChild)
}
mChildren.AppendElement(aChild);
aChild->SetParent(this);
aChild->SetDefaultCharacterSet(mDefaultCharacterSet);
NS_ADDREF(aChild);
return NS_OK;
@ -2767,6 +2768,13 @@ NS_IMETHODIMP
nsWebShell::SetDefaultCharacterSet (const PRUnichar* aDefaultCharacterSet)
{
mDefaultCharacterSet = aDefaultCharacterSet;
PRInt32 i, n = mChildren.Count();
for (i = 0; i < n; i++) {
nsIWebShell* child = (nsIWebShell*) mChildren.ElementAt(i);
if (nsnull != child) {
child->SetDefaultCharacterSet(aDefaultCharacterSet);
}
}
return NS_OK;
}