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

Unified Diff: third_party/WebKit/Source/core/layout/svg/LayoutSVGInlineText.h

Issue 1411123014: [Line Layout API] Convert SVGTextLayoutEngine and SVGTextLayoutEngineBaseline to line Layout API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months 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/layout/svg/LayoutSVGInlineText.h
diff --git a/third_party/WebKit/Source/core/layout/svg/LayoutSVGInlineText.h b/third_party/WebKit/Source/core/layout/svg/LayoutSVGInlineText.h
index 5bdb876dd21f7666dd106d65b739fc036dfcecb0..0825c8ed679965cfd10add7fc84e302339a44234 100644
--- a/third_party/WebKit/Source/core/layout/svg/LayoutSVGInlineText.h
+++ b/third_party/WebKit/Source/core/layout/svg/LayoutSVGInlineText.h
@@ -69,59 +69,6 @@ private:
DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutSVGInlineText, isSVGInlineText());
-class SVGInlineTextMetricsIterator {
- DISALLOW_NEW();
-public:
- SVGInlineTextMetricsIterator() { reset(nullptr); }
-
- void advanceToTextStart(const LayoutSVGInlineText* textLayoutObject, unsigned startCharacterOffset)
- {
- ASSERT(textLayoutObject);
- if (m_textLayoutObject != textLayoutObject) {
- reset(textLayoutObject);
- ASSERT(!metricsList().isEmpty());
- }
-
- if (m_characterOffset == startCharacterOffset)
- return;
-
- // TODO(fs): We could walk backwards through the metrics list in these cases.
- if (m_characterOffset > startCharacterOffset)
- reset(textLayoutObject);
-
- while (m_characterOffset < startCharacterOffset)
- next();
- }
-
- void next()
- {
- m_characterOffset += metrics().length();
- ++m_metricsListOffset;
- }
-
- const SVGTextMetrics& metrics() const
- {
- ASSERT(m_textLayoutObject && m_metricsListOffset < metricsList().size());
- return metricsList()[m_metricsListOffset];
- }
- const Vector<SVGTextMetrics>& metricsList() const { return m_textLayoutObject->layoutAttributes()->textMetricsValues(); }
- unsigned metricsListOffset() const { return m_metricsListOffset; }
- unsigned characterOffset() const { return m_characterOffset; }
- bool isAtEnd() const { return m_metricsListOffset == metricsList().size(); }
-
-private:
- void reset(const LayoutSVGInlineText* textLayoutObject)
- {
- m_textLayoutObject = textLayoutObject;
- m_characterOffset = 0;
- m_metricsListOffset = 0;
- }
-
- const LayoutSVGInlineText* m_textLayoutObject;
- unsigned m_metricsListOffset;
- unsigned m_characterOffset;
-};
-
}
#endif // LayoutSVGInlineText_h

Powered by Google App Engine
This is Rietveld 408576698