зеркало из https://github.com/mozilla/gecko-dev.git
Bug 128572 CPU usage jumps to 100% when loading a page with wrong charset
patch by Roland.Mainz@informatik.med.uni-giessen.de r=katakai sr=rbs
This commit is contained in:
Родитель
63f88dbace
Коммит
79be54179a
|
@ -5329,16 +5329,6 @@ if (mFontMetricsContext->mAllowDoubleByteSpecialChars) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If this is is the 'unknown' char (ie: converter could not
|
|
||||||
// convert it) there is no sense in searching any further for
|
|
||||||
// a font. This test shows up in several locations; if we did
|
|
||||||
// this test earlier in the search we would only need to do it
|
|
||||||
// once but we don't want to slow down the typical search.
|
|
||||||
if (aChar == UCS2_NOMAPPING) {
|
|
||||||
FIND_FONT_PRINTF((" ignore the 'UCS2_NOMAPPING' character"));
|
|
||||||
return nsnull;
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Search all font prefs for generic
|
// Search all font prefs for generic
|
||||||
//
|
//
|
||||||
|
@ -5373,15 +5363,6 @@ nsFontXlib*
|
||||||
nsFontMetricsXlib::FindAnyFont(PRUnichar aChar)
|
nsFontMetricsXlib::FindAnyFont(PRUnichar aChar)
|
||||||
{
|
{
|
||||||
FIND_FONT_PRINTF((" FindAnyFont"));
|
FIND_FONT_PRINTF((" FindAnyFont"));
|
||||||
// If this is is the 'unknown' char (ie: converter could not
|
|
||||||
// convert it) there is no sense in searching any further for
|
|
||||||
// a font. This test shows up in several locations; if we did
|
|
||||||
// this test earlier in the search we would only need to do it
|
|
||||||
// once but we don't want to slow down the typical search.
|
|
||||||
if (aChar == UCS2_NOMAPPING) {
|
|
||||||
FIND_FONT_PRINTF((" ignore the 'UCS2_NOMAPPING' character"));
|
|
||||||
return nsnull;
|
|
||||||
}
|
|
||||||
|
|
||||||
// XXX If we get to this point, that means that we have exhausted all the
|
// XXX If we get to this point, that means that we have exhausted all the
|
||||||
// families in the lists. Maybe we should try a list of fonts that are
|
// families in the lists. Maybe we should try a list of fonts that are
|
||||||
|
@ -5598,6 +5579,14 @@ nsFontMetricsXlib::FindFont(PRUnichar aChar)
|
||||||
{
|
{
|
||||||
FIND_FONT_PRINTF(("\nFindFont(%c/0x%04x)", aChar, aChar));
|
FIND_FONT_PRINTF(("\nFindFont(%c/0x%04x)", aChar, aChar));
|
||||||
|
|
||||||
|
// If this is is the 'unknown' char (ie: converter could not
|
||||||
|
// convert it) there is no sense in searching any further for
|
||||||
|
// a font. Just returing mWesternFont
|
||||||
|
if (aChar == UCS2_NOMAPPING) {
|
||||||
|
FIND_FONT_PRINTF((" ignore the 'UCS2_NOMAPPING' character, return mWesternFont"));
|
||||||
|
return mWesternFont;
|
||||||
|
}
|
||||||
|
|
||||||
nsFontXlib* font = FindUserDefinedFont(aChar);
|
nsFontXlib* font = FindUserDefinedFont(aChar);
|
||||||
if (!font) {
|
if (!font) {
|
||||||
font = FindStyleSheetSpecificFont(aChar);
|
font = FindStyleSheetSpecificFont(aChar);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче