Bug 1229739 - Use the color of shadow if available for drawing emphasis marks in shadow. r=jfkthame

This commit is contained in:
Xidorn Quan 2015-12-04 16:28:34 +11:00
parent 1ed121d22a
commit 1c16c5b2cb
2 changed files with 6 additions and 3 deletions

View File

@ -6218,6 +6218,7 @@ void
nsTextFrame::DrawEmphasisMarks(gfxContext* aContext, WritingMode aWM,
const gfxPoint& aTextBaselinePt,
uint32_t aOffset, uint32_t aLength,
const nscolor* aDecorationOverrideColor,
PropertyProvider& aProvider)
{
auto info = static_cast<const EmphasisMarkInfo*>(
@ -6227,8 +6228,8 @@ nsTextFrame::DrawEmphasisMarks(gfxContext* aContext, WritingMode aWM,
return;
}
nscolor color = nsLayoutUtils::
GetColor(this, eCSSProperty_text_emphasis_color);
nscolor color = aDecorationOverrideColor ? *aDecorationOverrideColor :
nsLayoutUtils::GetColor(this, eCSSProperty_text_emphasis_color);
aContext->SetColor(Color::FromABGR(color));
gfxPoint pt(aTextBaselinePt);
if (!aWM.IsVertical()) {
@ -6747,7 +6748,8 @@ nsTextFrame::DrawTextRunAndDecorations(
aAdvanceWidth, aDrawSoftHyphen, aContextPaint, aCallbacks);
// Emphasis marks
DrawEmphasisMarks(aCtx, wm, aTextBaselinePt, aOffset, aLength, aProvider);
DrawEmphasisMarks(aCtx, wm, aTextBaselinePt, aOffset, aLength,
aDecorationOverrideColor, aProvider);
// Line-throughs
for (uint32_t i = aDecorations.mStrikes.Length(); i-- > 0; ) {

View File

@ -446,6 +446,7 @@ public:
mozilla::WritingMode aWM,
const gfxPoint& aTextBaselinePt,
uint32_t aOffset, uint32_t aLength,
const nscolor* aDecorationOverrideColor,
PropertyProvider& aProvider);
virtual nscolor GetCaretColorAt(int32_t aOffset) override;