Index: Source/core/paint/InlineTextBoxPainter.cpp |
diff --git a/Source/core/paint/InlineTextBoxPainter.cpp b/Source/core/paint/InlineTextBoxPainter.cpp |
index a7503c4527704aaa22ce931760ab6fc094b4e0ec..afd9de53d9bb139f9e321c66e3dd06c0c8a21bfb 100644 |
--- a/Source/core/paint/InlineTextBoxPainter.cpp |
+++ b/Source/core/paint/InlineTextBoxPainter.cpp |
@@ -218,6 +218,10 @@ void InlineTextBoxPainter::paint(const PaintInfo& paintInfo, const LayoutPoint& |
if (textBlobIsCacheable) |
cachedTextBlob = addToTextBlobCache(m_inlineTextBox); |
textPainter.paint(startOffset, endOffset, length, textStyle, cachedTextBlob); |
+ |
+ // Paint the text with color:transparent here in Find In Page Scenario. |
+ if (styleToUse.visitedDependentColor(CSSPropertyColor) == Color::transparent) |
+ paintTextMatchMarkerText(textPainter, length, styleToUse); |
pdr.
2015/07/21 05:59:46
Where is the black color of the text coming from?
|
} |
if ((paintSelectedTextOnly || paintSelectedTextSeparately) && selectionStart < selectionEnd) { |
@@ -305,6 +309,24 @@ void InlineTextBoxPainter::paintSingleCompositionBackgroundRun(GraphicsContext* |
context->drawHighlightForText(font, m_inlineTextBox.constructTextRun(style, font), localOrigin, selHeight, backgroundColor, sPos, ePos); |
} |
+void InlineTextBoxPainter::paintTextMatchMarkerText(TextPainter textPainter, int length, const ComputedStyle& style) |
+{ |
+ if (!m_inlineTextBox.layoutObject().node()) |
+ return; |
+ |
+ TextPainter::Style textStyle = TextPainter::textPaintingStyle(m_inlineTextBox.layoutObject(), style, true, false); |
pdr.
2015/07/21 05:59:46
We generally try not to duplicate complex logic li
|
+ DocumentMarkerVector markers = m_inlineTextBox.layoutObject().document().markers().markersFor(m_inlineTextBox.layoutObject().node()); |
+ DocumentMarkerVector::const_iterator markerIt = markers.begin(); |
+ for (; markerIt != markers.end(); ++markerIt) { |
+ DocumentMarker* marker = *markerIt; |
+ if (marker->type() == DocumentMarker::TextMatch) { |
+ int sPos = std::max(marker->startOffset() - m_inlineTextBox.start(), (unsigned)0); |
+ int ePos = std::min(marker->endOffset() - m_inlineTextBox.start(), m_inlineTextBox.len()); |
+ textPainter.paint(sPos, ePos, length, textStyle, 0); |
+ } |
+ } |
+} |
+ |
void InlineTextBoxPainter::paintDocumentMarkers(GraphicsContext* pt, const LayoutPoint& boxOrigin, const ComputedStyle& style, const Font& font, bool background) |
{ |
if (!m_inlineTextBox.layoutObject().node()) |