Bug 1038663 (part 2) - Move GetFirstFontMetrics() up. r=heycam.

This is necessary for a subsequent patch.
This commit is contained in:
Nicholas Nethercote 2015-11-04 18:02:20 -08:00
parent d6ab162415
commit a64f843399

View File

@ -1597,6 +1597,16 @@ HasTerminalNewline(const nsTextFrame* aFrame)
return frag->CharAt(aFrame->GetContentEnd() - 1) == '\n';
}
static gfxFont::Metrics
GetFirstFontMetrics(gfxFontGroup* aFontGroup, bool aVerticalMetrics)
{
if (!aFontGroup)
return gfxFont::Metrics();
gfxFont* font = aFontGroup->GetFirstValidFont();
return font->GetMetrics(aVerticalMetrics ? gfxFont::eVertical
: gfxFont::eHorizontal);
}
static nscoord
LetterSpacing(nsIFrame* aFrame, const nsStyleText* aStyleText = nullptr)
{
@ -1826,16 +1836,6 @@ GetHyphenTextRun(gfxTextRun* aTextRun, gfxContext* aContext, nsTextFrame* aTextF
MakeHyphenTextRun(ctx, aTextRun->GetAppUnitsPerDevUnit());
}
static gfxFont::Metrics
GetFirstFontMetrics(gfxFontGroup* aFontGroup, bool aVerticalMetrics)
{
if (!aFontGroup)
return gfxFont::Metrics();
gfxFont* font = aFontGroup->GetFirstValidFont();
return font->GetMetrics(aVerticalMetrics ? gfxFont::eVertical
: gfxFont::eHorizontal);
}
PR_STATIC_ASSERT(NS_STYLE_WHITESPACE_NORMAL == 0);
PR_STATIC_ASSERT(NS_STYLE_WHITESPACE_PRE == 1);
PR_STATIC_ASSERT(NS_STYLE_WHITESPACE_NOWRAP == 2);