Bug 1038663 (part 2, attempt 2) - Move GetFirstFontMetrics() up. r=heycam.
This commit is contained in:
@@ -1597,6 +1597,16 @@ HasTerminalNewline(const nsTextFrame* aFrame)
|
|||||||
return frag->CharAt(aFrame->GetContentEnd() - 1) == '\n';
|
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
|
static nscoord
|
||||||
LetterSpacing(nsIFrame* aFrame, const nsStyleText* aStyleText = nullptr)
|
LetterSpacing(nsIFrame* aFrame, const nsStyleText* aStyleText = nullptr)
|
||||||
{
|
{
|
||||||
@@ -1826,16 +1836,6 @@ GetHyphenTextRun(gfxTextRun* aTextRun, gfxContext* aContext, nsTextFrame* aTextF
|
|||||||
MakeHyphenTextRun(ctx, aTextRun->GetAppUnitsPerDevUnit());
|
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_NORMAL == 0);
|
||||||
PR_STATIC_ASSERT(NS_STYLE_WHITESPACE_PRE == 1);
|
PR_STATIC_ASSERT(NS_STYLE_WHITESPACE_PRE == 1);
|
||||||
PR_STATIC_ASSERT(NS_STYLE_WHITESPACE_NOWRAP == 2);
|
PR_STATIC_ASSERT(NS_STYLE_WHITESPACE_NOWRAP == 2);
|
||||||
|
|||||||
Reference in New Issue
Block a user