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

Unified Diff: third_party/WebKit/Source/core/paint/SVGInlineTextBoxPainter.h

Issue 1468913002: Find In Page hides the text when text color matches text search hightlight color. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments Created 5 years 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
Index: third_party/WebKit/Source/core/paint/SVGInlineTextBoxPainter.h
diff --git a/third_party/WebKit/Source/core/paint/SVGInlineTextBoxPainter.h b/third_party/WebKit/Source/core/paint/SVGInlineTextBoxPainter.h
index 8e2e09bf32faebfd888c9ff89f3bdefe9f7aa539..5704099fd95dd16d6b194ca0eda128110980ee26 100644
--- a/third_party/WebKit/Source/core/paint/SVGInlineTextBoxPainter.h
+++ b/third_party/WebKit/Source/core/paint/SVGInlineTextBoxPainter.h
@@ -22,13 +22,26 @@ struct SVGTextFragment;
class TextRun;
class DocumentMarker;
+struct SVGTextFragmentWithRange {
+ SVGTextFragmentWithRange(const SVGTextFragment& fragment, int startPosition, int endPosition)
+ : fragment(fragment)
+ , startPosition(startPosition)
+ , endPosition(endPosition)
+ {
+ }
+ const SVGTextFragment& fragment;
+ int startPosition;
+ int endPosition;
+};
+
class SVGInlineTextBoxPainter {
STACK_ALLOCATED();
public:
SVGInlineTextBoxPainter(const SVGInlineTextBox& svgInlineTextBox) : m_svgInlineTextBox(svgInlineTextBox) { }
void paint(const PaintInfo&, const LayoutPoint&);
void paintSelectionBackground(const PaintInfo&);
- virtual void paintTextMatchMarker(GraphicsContext&, const LayoutPoint&, DocumentMarker*, const ComputedStyle&, const Font&);
+ void paintTextMatchMarkerForeground(const PaintInfo&, const LayoutPoint&, DocumentMarker*, const ComputedStyle&, const Font&);
+ void paintTextMatchMarkerBackground(const PaintInfo&, const LayoutPoint&, DocumentMarker*, const ComputedStyle&, const Font&);
private:
bool shouldPaintSelection(const PaintInfo&) const;
@@ -37,6 +50,8 @@ private:
bool setupTextPaint(const PaintInfo&, const ComputedStyle&, LayoutSVGResourceMode, SkPaint&);
void paintText(const PaintInfo&, TextRun&, const SVGTextFragment&, int startPosition, int endPosition, const SkPaint&);
void paintText(const PaintInfo&, const ComputedStyle&, const ComputedStyle& selectionStyle, const SVGTextFragment&, LayoutSVGResourceMode, bool shouldPaintSelection);
+ Vector<SVGTextFragmentWithRange> collectTextMatches(DocumentMarker*) const;
+ Vector<SVGTextFragmentWithRange> collectFragmentsInRange(int startPosition, int endPosition) const;
const SVGInlineTextBox& m_svgInlineTextBox;
};

Powered by Google App Engine
This is Rietveld 408576698