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

Side by Side Diff: Source/core/layout/svg/LayoutSVGInlineText.h

Issue 1150383003: Don't iterate past the end of the metrics list (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz> 2 * Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz>
3 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved. 3 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved.
4 * Copyright (C) 2008 Rob Buis <buis@kde.org> 4 * Copyright (C) 2008 Rob Buis <buis@kde.org>
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 } 99 }
100 100
101 const SVGTextMetrics& metrics() const 101 const SVGTextMetrics& metrics() const
102 { 102 {
103 ASSERT(m_textLayoutObject && m_metricsListOffset < metricsList().size()) ; 103 ASSERT(m_textLayoutObject && m_metricsListOffset < metricsList().size()) ;
104 return metricsList()[m_metricsListOffset]; 104 return metricsList()[m_metricsListOffset];
105 } 105 }
106 const Vector<SVGTextMetrics>& metricsList() const { return m_textLayoutObjec t->layoutAttributes()->textMetricsValues(); } 106 const Vector<SVGTextMetrics>& metricsList() const { return m_textLayoutObjec t->layoutAttributes()->textMetricsValues(); }
107 unsigned metricsListOffset() const { return m_metricsListOffset; } 107 unsigned metricsListOffset() const { return m_metricsListOffset; }
108 unsigned characterOffset() const { return m_characterOffset; } 108 unsigned characterOffset() const { return m_characterOffset; }
109 bool isAtEnd() const { return m_metricsListOffset == metricsList().size(); }
109 110
110 private: 111 private:
111 void reset(const LayoutSVGInlineText* textLayoutObject) 112 void reset(const LayoutSVGInlineText* textLayoutObject)
112 { 113 {
113 m_textLayoutObject = textLayoutObject; 114 m_textLayoutObject = textLayoutObject;
114 m_characterOffset = 0; 115 m_characterOffset = 0;
115 m_metricsListOffset = 0; 116 m_metricsListOffset = 0;
116 } 117 }
117 118
118 const LayoutSVGInlineText* m_textLayoutObject; 119 const LayoutSVGInlineText* m_textLayoutObject;
119 unsigned m_metricsListOffset; 120 unsigned m_metricsListOffset;
120 unsigned m_characterOffset; 121 unsigned m_characterOffset;
121 }; 122 };
122 123
123 } 124 }
124 125
125 #endif // LayoutSVGInlineText_h 126 #endif // LayoutSVGInlineText_h
OLDNEW
« no previous file with comments | « LayoutTests/svg/text/unpaired-surrogate-crash-expected.txt ('k') | Source/core/layout/svg/SVGTextLayoutEngine.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698