Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1328)

Unified Diff: Source/core/paint/InlineTextBoxPainter.cpp

Issue 1220733012: Display transparent text when it's being searched and selected. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased and Fixed the build error Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/fast/repaint/text-match-transparent-text-expected.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/paint/InlineTextBoxPainter.cpp
diff --git a/Source/core/paint/InlineTextBoxPainter.cpp b/Source/core/paint/InlineTextBoxPainter.cpp
index c3ac41036910e1f5342fd133446834821f17b70e..c70c94431143aa87d10c22669011dd5f4ec7528c 100644
--- a/Source/core/paint/InlineTextBoxPainter.cpp
+++ b/Source/core/paint/InlineTextBoxPainter.cpp
@@ -815,6 +815,22 @@ void InlineTextBoxPainter::paintTextMatchMarker(GraphicsContext* pt, const Layou
GraphicsContextStateSaver stateSaver(*pt);
pt->clip(FloatRect(boxOrigin.x().toFloat(), (boxOrigin.y() - deltaY).toFloat(), m_inlineTextBox.logicalWidth().toFloat(), selHeight));
pt->drawHighlightForText(font, run, FloatPoint(boxOrigin.x().toFloat(), (boxOrigin.y() - deltaY).toFloat()), selHeight, color, sPos, ePos);
+
+ // Also Highlight the text with color:transparent
+ if (style.visitedDependentColor(CSSPropertyColor) == Color::transparent) {
+ int length = m_inlineTextBox.len();
+ TextPainter::Style textStyle;
+ // When we use the text as a clip, we only care about the alpha, thus we make all the colors black.
+ textStyle.currentColor = textStyle.fillColor = textStyle.strokeColor = textStyle.emphasisMarkColor = Color::black;
+ textStyle.strokeWidth = style.textStrokeWidth();
+ textStyle.shadow = 0;
+
+ LayoutRect boxRect(boxOrigin, LayoutSize(m_inlineTextBox.logicalWidth(), m_inlineTextBox.logicalHeight()));
+ LayoutPoint textOrigin(boxOrigin.x(), boxOrigin.y() + font.fontMetrics().ascent());
+ TextPainter textPainter(pt, font, run, textOrigin, boxRect, m_inlineTextBox.isHorizontal());
+
+ textPainter.paint(sPos, ePos, length, textStyle, 0);
+ }
}
}
« no previous file with comments | « LayoutTests/fast/repaint/text-match-transparent-text-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698