OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 LineLayoutSVGInlineText_h | 5 #ifndef LineLayoutSVGInlineText_h |
6 #define LineLayoutSVGInlineText_h | 6 #define LineLayoutSVGInlineText_h |
7 | 7 |
8 #include "core/layout/api/LineLayoutText.h" | 8 #include "core/layout/api/LineLayoutText.h" |
9 #include "core/layout/svg/LayoutSVGInlineText.h" | 9 #include "core/layout/svg/LayoutSVGInlineText.h" |
10 | 10 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 const LayoutSVGInlineText* toSVGInlineText() const | 61 const LayoutSVGInlineText* toSVGInlineText() const |
62 { | 62 { |
63 return toLayoutSVGInlineText(layoutObject()); | 63 return toLayoutSVGInlineText(layoutObject()); |
64 } | 64 } |
65 }; | 65 }; |
66 | 66 |
67 class SVGInlineTextMetricsIterator { | 67 class SVGInlineTextMetricsIterator { |
68 DISALLOW_NEW(); | 68 DISALLOW_NEW(); |
69 public: | 69 public: |
70 SVGInlineTextMetricsIterator() { reset(LineLayoutSVGInlineText()); } | 70 SVGInlineTextMetricsIterator() { reset(LineLayoutSVGInlineText()); } |
| 71 explicit SVGInlineTextMetricsIterator(LineLayoutSVGInlineText textLineLayout
) { reset(textLineLayout); } |
71 | 72 |
72 void advanceToTextStart(LineLayoutSVGInlineText textLineLayout, unsigned sta
rtCharacterOffset) | 73 void advanceToTextStart(LineLayoutSVGInlineText textLineLayout, unsigned sta
rtCharacterOffset) |
73 { | 74 { |
74 ASSERT(textLineLayout); | 75 ASSERT(textLineLayout); |
75 if (!m_textLineLayout || m_textLineLayout != textLineLayout) { | 76 if (!m_textLineLayout || m_textLineLayout != textLineLayout) { |
76 reset(textLineLayout); | 77 reset(textLineLayout); |
77 ASSERT(!metricsList().isEmpty()); | 78 ASSERT(!metricsList().isEmpty()); |
78 } | 79 } |
79 | 80 |
80 if (m_characterOffset == startCharacterOffset) | 81 if (m_characterOffset == startCharacterOffset) |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 } | 117 } |
117 | 118 |
118 LineLayoutSVGInlineText m_textLineLayout; | 119 LineLayoutSVGInlineText m_textLineLayout; |
119 unsigned m_metricsListOffset; | 120 unsigned m_metricsListOffset; |
120 unsigned m_characterOffset; | 121 unsigned m_characterOffset; |
121 }; | 122 }; |
122 | 123 |
123 } // namespace blink | 124 } // namespace blink |
124 | 125 |
125 #endif // LineLayoutSVGInlineText_h | 126 #endif // LineLayoutSVGInlineText_h |
OLD | NEW |