Chromium Code Reviews| Index: Source/core/paint/InlineTextBoxPainter.cpp |
| diff --git a/Source/core/paint/InlineTextBoxPainter.cpp b/Source/core/paint/InlineTextBoxPainter.cpp |
| index a7503c4527704aaa22ce931760ab6fc094b4e0ec..c17a8fc8cb6c5fe34566782b3f379729862fc9f9 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); |
| } |
| 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) |
|
pdr.
2015/07/06 22:09:16
extra spaces around int length
Sk.kumar
2015/07/07 12:45:02
Done.
|
| +{ |
| + if (!m_inlineTextBox.layoutObject().node()) |
| + return; |
| + |
| + TextPainter::Style textStyle = TextPainter::textPaintingStyle(m_inlineTextBox.layoutObject(), style, true, false); |
|
pdr.
2015/07/06 22:09:16
We shouldn't add all of this code. Can you modify
Sk.kumar
2015/07/07 12:45:02
This is being done to maintain the flow of Paint.
|
| + 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()) |