b=455647 garbage Indic characters on parts of some English webpages. r=pavlov a1.9.0.6=dveditz

git-svn-id: svn://10.0.0.236/trunk@255484 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
karlt+%karlt.net
2008-12-11 05:36:45 +00:00
parent 9be339d935
commit 72fb709f07
5 changed files with 46 additions and 3 deletions

View File

@@ -1947,6 +1947,12 @@ gfxTextRun::SortGlyphRuns()
// be skipped; the last GlyphRun will cover its character range.
if (i == 0 || runs[i].mFont != runs[i - 1].mFont) {
mGlyphRuns.AppendElement(runs[i]);
// If two fonts have the same character offset, Sort() will have
// randomized the order.
NS_ASSERTION(i == 0 ||
runs[i].mCharacterOffset !=
runs[i - 1].mCharacterOffset,
"Two fonts for the same run, glyph indices may not match the font");
}
}
}

View File

@@ -1658,7 +1658,7 @@ gfxPangoFontGroup::CreateGlyphRunsItemizing(gfxTextRun *aTextRun,
nsRefPtr<gfxPangoFont> font =
gfxPangoFont::GetOrMakeFont(item->analysis.font);
nsresult rv = aTextRun->AddGlyphRun(font, utf16Offset, PR_TRUE);
nsresult rv = aTextRun->AddGlyphRun(font, utf16Offset);
if (NS_FAILED(rv)) {
NS_ERROR("AddGlyphRun Failed");
goto out;
@@ -1690,8 +1690,6 @@ gfxPangoFontGroup::CreateGlyphRunsItemizing(gfxTextRun *aTextRun,
}
}
aTextRun->SortGlyphRuns();
out:
if (glyphString)
pango_glyph_string_free(glyphString);

View File

@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
[<!ENTITY first "!"><!ENTITY fallback "&#x00e6;">]>
<html xmlns="http://www.w3.org/1999/xhtml">
<!-- U+00E6 is expected to be found in Arial and DejaVu Sans, but not
Devanagari MT, FrankRuehl, nor Standard Symbols L.
"!" is chosen as it is expected to be found in the first font found. -->
<head>
<style>
p { font-size: 16.6px;
font-family: Devanagari MT, FrankRuehl, Standard Symbols L, Arial, DejaVu Sans; serif }
.fallback { font-family: Arial, DejaVu Sans, serif; }
</style>
</head>
<body>
<p><span class="fallback">&fallback;&fallback;</span>&first;<span class="fallback">&fallback;</span>&first;<span class="fallback">&fallback;</span>&first;<span class="fallback">&fallback;</span></p>
</body>
</html>

View File

@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
[<!ENTITY first "!"><!ENTITY fallback "&#x00e6;">]>
<html xmlns="http://www.w3.org/1999/xhtml">
<!-- U+00E6 is expected to be found in Arial and DejaVu Sans, but not
Devanagari MT, FrankRuehl, nor Standard Symbols L.
"!" is chosen as it is expected to be found in the first font found. -->
<head>
<style>
p { font-size: 16.6px;
font-family: Devanagari MT, FrankRuehl, Standard Symbols L, Arial, DejaVu Sans; serif }
.fallback { font-family: Arial, DejaVu Sans, serif; }
</style>
</head>
<body>
<p>&fallback;&fallback;&first;&fallback;&first;&fallback;&first;<span class="fallback">&fallback;</span></p>
</body>
</html>

View File

@@ -1,3 +1,4 @@
== fallback-01.xhtml fallback-01-ref.xhtml
== long-1.html long-ref.html
random == soft-hyphens-1a.html soft-hyphens-1-ref.html # bug 406299
random == soft-hyphens-1b.html soft-hyphens-1-ref.html # bug 406299