зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset d88221aad093 (bug 1251995) for reftest failures
This commit is contained in:
Родитель
b9f86983b1
Коммит
41a0c1ddb8
|
@ -3499,9 +3499,13 @@ struct MOZ_STACK_CLASS CanvasBidiProcessor : public nsBidiPresUtils::BidiProcess
|
|||
|
||||
virtual nscoord GetWidth()
|
||||
{
|
||||
gfxTextRun::Metrics textRunMetrics = mTextRun->MeasureText(
|
||||
mDoMeasureBoundingBox ? gfxFont::TIGHT_INK_EXTENTS
|
||||
: gfxFont::LOOSE_INK_EXTENTS, mDrawTarget);
|
||||
gfxTextRun::Metrics textRunMetrics = mTextRun->MeasureText(0,
|
||||
mTextRun->GetLength(),
|
||||
mDoMeasureBoundingBox ?
|
||||
gfxFont::TIGHT_INK_EXTENTS :
|
||||
gfxFont::LOOSE_INK_EXTENTS,
|
||||
mDrawTarget,
|
||||
nullptr);
|
||||
|
||||
// this only measures the height; the total width is gotten from the
|
||||
// the return value of ProcessText.
|
||||
|
@ -3531,10 +3535,13 @@ struct MOZ_STACK_CLASS CanvasBidiProcessor : public nsBidiPresUtils::BidiProcess
|
|||
// glyph string on OS X and DWrite where textrun widths may
|
||||
// involve fractional pixels.
|
||||
gfxTextRun::Metrics textRunMetrics =
|
||||
mTextRun->MeasureText(mDoMeasureBoundingBox ?
|
||||
gfxFont::TIGHT_INK_EXTENTS :
|
||||
gfxFont::LOOSE_INK_EXTENTS,
|
||||
mDrawTarget);
|
||||
mTextRun->MeasureText(0,
|
||||
mTextRun->GetLength(),
|
||||
mDoMeasureBoundingBox ?
|
||||
gfxFont::TIGHT_INK_EXTENTS :
|
||||
gfxFont::LOOSE_INK_EXTENTS,
|
||||
mDrawTarget,
|
||||
nullptr);
|
||||
inlineCoord += textRunMetrics.mAdvanceWidth;
|
||||
// old code was:
|
||||
// point.x += width * mAppUnitsPerDevPixel;
|
||||
|
|
|
@ -2071,7 +2071,8 @@ gfxFontGroup::GetHyphenWidth(gfxTextRun::PropertyProvider *aProvider)
|
|||
nsAutoPtr<gfxTextRun>
|
||||
hyphRun(MakeHyphenTextRun(dt,
|
||||
aProvider->GetAppUnitsPerDevUnit()));
|
||||
mHyphenWidth = hyphRun.get() ? hyphRun->GetAdvanceWidth() : 0;
|
||||
mHyphenWidth = hyphRun.get() ?
|
||||
hyphRun->GetAdvanceWidth(0, hyphRun->GetLength(), nullptr) : 0;
|
||||
}
|
||||
}
|
||||
return mHyphenWidth;
|
||||
|
|
|
@ -270,13 +270,6 @@ public:
|
|||
DrawTarget* aDrawTargetForTightBoundingBox,
|
||||
PropertyProvider* aProvider);
|
||||
|
||||
Metrics MeasureText(gfxFont::BoundingBoxType aBoundingBoxType,
|
||||
DrawTarget* aDrawTargetForTightBoundingBox,
|
||||
PropertyProvider* aProvider = nullptr) {
|
||||
return MeasureText(0, GetLength(), aBoundingBoxType,
|
||||
aDrawTargetForTightBoundingBox, aProvider);
|
||||
}
|
||||
|
||||
/**
|
||||
* Computes just the advance width for a substring.
|
||||
* Uses GetSpacing from aBreakProvider.
|
||||
|
@ -288,10 +281,6 @@ public:
|
|||
PropertyProvider *aProvider,
|
||||
PropertyProvider::Spacing* aSpacing = nullptr);
|
||||
|
||||
gfxFloat GetAdvanceWidth() {
|
||||
return GetAdvanceWidth(0, GetLength(), nullptr);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear all stored line breaks for the given range (both before and after),
|
||||
* and then set the line-break state before aStart to aBreakBefore and
|
||||
|
|
|
@ -803,7 +803,7 @@ TextOverflow::Marker::SetupString(nsIFrame* aFrame)
|
|||
if (mStyle->mType == NS_STYLE_TEXT_OVERFLOW_ELLIPSIS) {
|
||||
gfxTextRun* textRun = GetEllipsisTextRun(aFrame);
|
||||
if (textRun) {
|
||||
mISize = textRun->GetAdvanceWidth();
|
||||
mISize = textRun->GetAdvanceWidth(0, textRun->GetLength(), nullptr);
|
||||
} else {
|
||||
mISize = 0;
|
||||
}
|
||||
|
|
|
@ -5189,7 +5189,8 @@ nsTextFrame::UpdateTextEmphasis(WritingMode aWM, PropertyProvider& aProvider)
|
|||
EmphasisMarkInfo* info = new EmphasisMarkInfo;
|
||||
info->textRun =
|
||||
GenerateTextRunForEmphasisMarks(this, fm, aWM, styleText);
|
||||
info->advance = info->textRun->GetAdvanceWidth();
|
||||
info->advance =
|
||||
info->textRun->GetAdvanceWidth(0, info->textRun->GetLength(), nullptr);
|
||||
|
||||
// Calculate the baseline offset
|
||||
LogicalSide side = styleText->TextEmphasisSide(aWM);
|
||||
|
@ -5843,7 +5844,8 @@ AddHyphenToMetrics(nsTextFrame* aTextFrame, gfxTextRun* aBaseTextRun,
|
|||
return;
|
||||
|
||||
gfxTextRun::Metrics hyphenMetrics =
|
||||
hyphenTextRun->MeasureText(aBoundingBoxType, aDrawTarget);
|
||||
hyphenTextRun->MeasureText(0, hyphenTextRun->GetLength(), aBoundingBoxType,
|
||||
aDrawTarget, nullptr);
|
||||
if (aTextFrame->GetWritingMode().IsLineInverted()) {
|
||||
hyphenMetrics.mBoundingBox.y = -hyphenMetrics.mBoundingBox.YMost();
|
||||
}
|
||||
|
@ -6627,7 +6629,7 @@ nsTextFrame::DrawTextRun(gfxContext* const aCtx,
|
|||
// For right-to-left text runs, the soft-hyphen is positioned at the left
|
||||
// of the text, minus its own width
|
||||
gfxFloat hyphenBaselineX = aTextBaselinePt.x + mTextRun->GetDirection() * aAdvanceWidth -
|
||||
(mTextRun->IsRightToLeft() ? hyphenTextRun->GetAdvanceWidth() : 0);
|
||||
(mTextRun->IsRightToLeft() ? hyphenTextRun->GetAdvanceWidth(0, hyphenTextRun->GetLength(), nullptr) : 0);
|
||||
::DrawTextRun(hyphenTextRun.get(), aCtx,
|
||||
gfxPoint(hyphenBaselineX, aTextBaselinePt.y),
|
||||
0, hyphenTextRun->GetLength(),
|
||||
|
|
|
@ -1021,7 +1021,9 @@ static nsBoundingMetrics
|
|||
MeasureTextRun(DrawTarget* aDrawTarget, gfxTextRun* aTextRun)
|
||||
{
|
||||
gfxTextRun::Metrics metrics =
|
||||
aTextRun->MeasureText(gfxFont::TIGHT_HINTED_OUTLINE_EXTENTS, aDrawTarget);
|
||||
aTextRun->MeasureText(0, aTextRun->GetLength(),
|
||||
gfxFont::TIGHT_HINTED_OUTLINE_EXTENTS,
|
||||
aDrawTarget, nullptr);
|
||||
|
||||
nsBoundingMetrics bm;
|
||||
bm.leftBearing = NSToCoordFloor(metrics.mBoundingBox.X());
|
||||
|
|
|
@ -342,7 +342,8 @@ GetBaselinePosition(nsTextFrame* aFrame,
|
|||
{
|
||||
WritingMode writingMode = aFrame->GetWritingMode();
|
||||
gfxTextRun::Metrics metrics =
|
||||
aTextRun->MeasureText(gfxFont::LOOSE_INK_EXTENTS, nullptr);
|
||||
aTextRun->MeasureText(0, aTextRun->GetLength(), gfxFont::LOOSE_INK_EXTENTS,
|
||||
nullptr, nullptr);
|
||||
|
||||
switch (aDominantBaseline) {
|
||||
case NS_STYLE_DOMINANT_BASELINE_HANGING:
|
||||
|
|
Загрузка…
Ссылка в новой задаче