Bug 1277937 - Fix SELECTION_URLSTRIKEOUT. r=jfkthame

MozReview-Commit-ID: LumW94mTX4X
This commit is contained in:
Xidorn Quan
2016-06-07 16:12:15 -07:00
parent b43f631b45
commit 8b9905ef1a

View File

@@ -5521,9 +5521,8 @@ nsTextFrame::DrawSelectionDecorations(gfxContext* aContext,
aWidth, ComputeSelectionUnderlineHeight(aTextPaintStyle.PresContext(),
aFontMetrics, aType));
params.ascent = aAscent;
gfxFloat offset = aDecoration == NS_STYLE_TEXT_DECORATION_LINE_UNDERLINE ?
aFontMetrics.underlineOffset : aFontMetrics.maxAscent;
params.offset = offset * aDecorationOffsetDir;
params.offset = aDecoration == NS_STYLE_TEXT_DECORATION_LINE_UNDERLINE ?
aFontMetrics.underlineOffset : aFontMetrics.maxAscent;
params.decoration = aDecoration;
params.decorationType = DecorationType::Selection;
params.callbacks = aCallbacks;
@@ -5613,14 +5612,15 @@ nsTextFrame::DrawSelectionDecorations(gfxContext* aContext,
GetFirstFontMetrics(GetFontGroupForFrame(this, inflation), aVertical);
relativeSize = 2.0f;
offset = metrics.strikeoutOffset + 0.5;
aDecoration = NS_STYLE_TEXT_DECORATION_LINE_LINE_THROUGH;
params.offset = metrics.strikeoutOffset + 0.5;
params.decoration = NS_STYLE_TEXT_DECORATION_LINE_LINE_THROUGH;
break;
}
default:
NS_WARNING("Requested selection decorations when there aren't any");
return;
}
params.offset *= aDecorationOffsetDir;
params.lineSize.height *= relativeSize;
params.icoordInFrame = (aVertical ? params.pt.y - aPt.y
: params.pt.x - aPt.x) + aICoordInFrame;