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

Side by Side 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: Update paintSelectionBackground to use new helper function 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef SVGInlineTextBoxPainter_h 5 #ifndef SVGInlineTextBoxPainter_h
6 #define SVGInlineTextBoxPainter_h 6 #define SVGInlineTextBoxPainter_h
7 7
8 #include "core/style/ComputedStyleConstants.h" 8 #include "core/style/ComputedStyleConstants.h"
9 #include "core/layout/svg/LayoutSVGResourcePaintServer.h" 9 #include "core/layout/svg/LayoutSVGResourcePaintServer.h"
10 #include "wtf/Allocator.h" 10 #include "wtf/Allocator.h"
11 11
12 namespace blink { 12 namespace blink {
13 13
14 class FloatPoint; 14 class FloatPoint;
15 class Font; 15 class Font;
16 class GraphicsContext; 16 class GraphicsContext;
17 struct PaintInfo; 17 struct PaintInfo;
18 class LayoutPoint; 18 class LayoutPoint;
19 class ComputedStyle; 19 class ComputedStyle;
20 class SVGInlineTextBox; 20 class SVGInlineTextBox;
21 struct SVGTextFragment; 21 struct SVGTextFragment;
22 class TextRun; 22 class TextRun;
23 class DocumentMarker; 23 class DocumentMarker;
24 24
25 struct SVGTextFragmentWithRange {
26 const SVGTextFragment* fragment;
fs 2015/12/17 10:10:55 Maybe add a constructor and make this a reference
ramya.v 2015/12/18 03:43:33 Done.
27 int fragmentStartPosition;
fs 2015/12/17 10:10:55 I don't think we need to be quite this verbose. Dr
ramya.v 2015/12/18 03:43:33 Done.
28 int fragmentEndPosition;
29 };
30
25 class SVGInlineTextBoxPainter { 31 class SVGInlineTextBoxPainter {
26 STACK_ALLOCATED(); 32 STACK_ALLOCATED();
27 public: 33 public:
28 SVGInlineTextBoxPainter(const SVGInlineTextBox& svgInlineTextBox) : m_svgInl ineTextBox(svgInlineTextBox) { } 34 SVGInlineTextBoxPainter(const SVGInlineTextBox& svgInlineTextBox) : m_svgInl ineTextBox(svgInlineTextBox) { }
29 void paint(const PaintInfo&, const LayoutPoint&); 35 void paint(const PaintInfo&, const LayoutPoint&);
30 void paintSelectionBackground(const PaintInfo&); 36 void paintSelectionBackground(const PaintInfo&);
31 virtual void paintTextMatchMarker(GraphicsContext&, const LayoutPoint&, Docu mentMarker*, const ComputedStyle&, const Font&); 37 virtual void paintTextMatchMarkerForeground(const PaintInfo&, const LayoutPo int&, DocumentMarker*, const ComputedStyle&, const Font&);
38 virtual void paintTextMatchMarkerBackground(const PaintInfo&, const LayoutPo int&, DocumentMarker*, const ComputedStyle&, const Font&);
fs 2015/12/17 10:10:55 Why are these virtual?
ramya.v 2015/12/18 03:43:33 Done.
ramya.v 2015/12/18 03:43:33 Since I've split paintTextMatchMarker took these i
32 39
33 private: 40 private:
34 bool shouldPaintSelection(const PaintInfo&) const; 41 bool shouldPaintSelection(const PaintInfo&) const;
35 void paintTextFragments(const PaintInfo&, LayoutObject&); 42 void paintTextFragments(const PaintInfo&, LayoutObject&);
36 void paintDecoration(const PaintInfo&, TextDecoration, const SVGTextFragment &); 43 void paintDecoration(const PaintInfo&, TextDecoration, const SVGTextFragment &);
37 void paintTextWithShadows(const PaintInfo&, const ComputedStyle&, TextRun&, const SVGTextFragment&, int startPosition, int endPosition, LayoutSVGResourceMod e); 44 void paintTextWithShadows(const PaintInfo&, const ComputedStyle&, TextRun&, const SVGTextFragment&, int startPosition, int endPosition, LayoutSVGResourceMod e);
38 void paintText(const PaintInfo&, const ComputedStyle&, const ComputedStyle& selectionStyle, const SVGTextFragment&, LayoutSVGResourceMode, bool shouldPaintS election); 45 void paintText(const PaintInfo&, const ComputedStyle&, const ComputedStyle& selectionStyle, const SVGTextFragment&, LayoutSVGResourceMode, bool shouldPaintS election);
46 Vector<SVGTextFragmentWithRange> collectTextMatches(const PaintInfo&, Docume ntMarker*);
47 Vector<SVGTextFragmentWithRange> collectFragments(int startPosition, int end Position);
39 48
40 const SVGInlineTextBox& m_svgInlineTextBox; 49 const SVGInlineTextBox& m_svgInlineTextBox;
41 }; 50 };
42 51
43 } // namespace blink 52 } // namespace blink
44 53
45 #endif // SVGInlineTextBoxPainter_h 54 #endif // SVGInlineTextBoxPainter_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698