fix 45347. swap the order for author and content-type to make the content-type

appear first in the meta tag since we need to know the encoding before hitting
non ASCII value in the author name. r=cmanske
This commit is contained in:
ftang%netscape.com 2000-08-09 02:25:25 +00:00
Родитель 4a0351e364
Коммит 8c792f118c
1 изменённых файлов: 20 добавлений и 18 удалений

Просмотреть файл

@ -1393,6 +1393,26 @@ function EditorSetDefaultPrefs()
var nodelist = domdoc.getElementsByTagName("meta");
if ( nodelist )
{
// we should do charset first since we need to have charset before
// hitting other 8-bit char in other meta tags
// grab charset pref and make it the default charset
var prefCharsetString = 0;
try
{
prefCharsetString = gPrefs.getLocalizedUnicharPref("intl.charset.default");
}
catch (ex) {}
if ( prefCharsetString && prefCharsetString != 0)
{
var element = domdoc.createElement("meta");
if ( element )
{
AddAttrToElem(domdoc, "http-equiv", "content-type", element);
AddAttrToElem(domdoc, "content", "text/html; charset=" + prefCharsetString, element);
headelement.appendChild( element );
}
}
var node = 0;
var listlength = nodelist.length;
@ -1432,24 +1452,6 @@ function EditorSetDefaultPrefs()
}
}
// grab charset pref and make it the default charset
var prefCharsetString = 0;
try
{
prefCharsetString = gPrefs.getLocalizedUnicharPref("intl.charset.default");
}
catch (ex) {}
if ( prefCharsetString && prefCharsetString != 0)
{
var element = domdoc.createElement("meta");
if ( element )
{
AddAttrToElem(domdoc, "http-equiv", "content-type", element);
AddAttrToElem(domdoc, "content", "text/html; charset=" + prefCharsetString, element);
headelement.appendChild( element );
}
}
}
// color prefs