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

git-svn-id: svn://10.0.0.236/trunk@29771 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
ftang%netscape.com
1999-04-28 23:59:08 +00:00
parent adaa708f18
commit 3dc5321803
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;
}