Bug 472909. Need to call FinishSettingProperties on nsTranformedTextRuns that we create as parts of other transformed textruns. r=smontagu

--HG--
extra : rebase_source : 38adef908b1ec8d6fcc97b1b6cb42690733ae752
This commit is contained in:
Robert O'Callahan 2009-01-16 21:17:46 +13:00
Родитель 2917d9f646
Коммит a4d2c93329
5 изменённых файлов: 27 добавлений и 12 удалений

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

@ -88,7 +88,7 @@ nsTransformedTextRun::SetPotentialLineBreaks(PRUint32 aStart, PRUint32 aLength,
return changed;
}
gfxTextRun*
nsTransformedTextRun*
nsTransformingTextRunFactory::MakeTextRun(const PRUnichar* aString, PRUint32 aLength,
const gfxTextRunFactory::Parameters* aParams,
gfxFontGroup* aFontGroup, PRUint32 aFlags,
@ -98,7 +98,7 @@ nsTransformingTextRunFactory::MakeTextRun(const PRUnichar* aString, PRUint32 aLe
aString, aLength, aFlags, aStyles, aOwnsFactory);
}
gfxTextRun*
nsTransformedTextRun*
nsTransformingTextRunFactory::MakeTextRun(const PRUint8* aString, PRUint32 aLength,
const gfxTextRunFactory::Parameters* aParams,
gfxFontGroup* aFontGroup, PRUint32 aFlags,
@ -279,7 +279,7 @@ nsFontVariantTextRunFactory::RebuildTextRun(nsTransformedTextRun* aTextRun,
}
if ((i == length || runIsLowercase != isLowercase) && runStart < i) {
nsAutoPtr<gfxTextRun> transformedChild;
nsAutoPtr<nsTransformedTextRun> transformedChild;
gfxTextRunCache::AutoTextRun cachedChild;
gfxTextRun* child;
@ -301,6 +301,9 @@ nsFontVariantTextRunFactory::RebuildTextRun(nsTransformedTextRun* aTextRun,
"lost some break-before values?");
child->SetPotentialLineBreaks(0, canBreakBeforeArray.Length(),
canBreakBeforeArray.Elements(), aRefContext);
if (transformedChild) {
transformedChild->FinishSettingProperties(aRefContext);
}
aTextRun->CopyGlyphDataFrom(child, 0, child->GetLength(), runStart, PR_FALSE);
runStart = i;
@ -388,7 +391,7 @@ nsCaseTransformTextRunFactory::RebuildTextRun(nsTransformedTextRun* aTextRun,
GetParametersForInner(aTextRun, &flags, aRefContext);
gfxFontGroup* fontGroup = aTextRun->GetFontGroup();
nsAutoPtr<gfxTextRun> transformedChild;
nsAutoPtr<nsTransformedTextRun> transformedChild;
gfxTextRunCache::AutoTextRun cachedChild;
gfxTextRun* child;
@ -411,6 +414,9 @@ nsCaseTransformTextRunFactory::RebuildTextRun(nsTransformedTextRun* aTextRun,
"Dropped characters or break-before values somewhere!");
child->SetPotentialLineBreaks(0, canBreakBeforeArray.Length(),
canBreakBeforeArray.Elements(), aRefContext);
if (transformedChild) {
transformedChild->FinishSettingProperties(aRefContext);
}
if (extraCharsCount > 0) {
// Now merge multiple characters into one multi-glyph character as required

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

@ -48,14 +48,14 @@ public:
virtual ~nsTransformingTextRunFactory() {}
// Default 8-bit path just transforms to Unicode and takes that path
gfxTextRun* MakeTextRun(const PRUint8* aString, PRUint32 aLength,
const gfxFontGroup::Parameters* aParams,
gfxFontGroup* aFontGroup, PRUint32 aFlags,
nsStyleContext** aStyles, PRBool aOwnsFactory = PR_TRUE);
gfxTextRun* MakeTextRun(const PRUnichar* aString, PRUint32 aLength,
const gfxFontGroup::Parameters* aParams,
gfxFontGroup* aFontGroup, PRUint32 aFlags,
nsStyleContext** aStyles, PRBool aOwnsFactory = PR_TRUE);
nsTransformedTextRun* MakeTextRun(const PRUint8* aString, PRUint32 aLength,
const gfxFontGroup::Parameters* aParams,
gfxFontGroup* aFontGroup, PRUint32 aFlags,
nsStyleContext** aStyles, PRBool aOwnsFactory = PR_TRUE);
nsTransformedTextRun* MakeTextRun(const PRUnichar* aString, PRUint32 aLength,
const gfxFontGroup::Parameters* aParams,
gfxFontGroup* aFontGroup, PRUint32 aFlags,
nsStyleContext** aStyles, PRBool aOwnsFactory = PR_TRUE);
virtual void RebuildTextRun(nsTransformedTextRun* aTextRun, gfxContext* aRefContext) = 0;
};

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

@ -2,5 +2,6 @@
== capitalize-2.html capitalize-ref.html
== capitalize-3.html capitalize-3-ref.html
== lowercase-1.html lowercase-ref.html
== small-caps-1.html small-caps-1-ref.html
== uppercase-1.html uppercase-ref.html
== uppercase-szlig-1.html uppercase-szlig-ref.html

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

@ -0,0 +1,4 @@
<!DOCTYPE HTML>
<html>
<body style="font-size:100px;">A<span style="font-size:80%">A</span></body>
</html>

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

@ -0,0 +1,4 @@
<!DOCTYPE HTML>
<html>
<body style="font-variant:small-caps; font-size:100px;">Aa</body>
</html>