OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006 Apple Computer, Inc. | 2 * Copyright (C) 2006 Apple Computer, Inc. |
3 * Copyright (C) 2006 Alexander Kellett <lypanov@kde.org> | 3 * Copyright (C) 2006 Alexander Kellett <lypanov@kde.org> |
4 * Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz> | 4 * Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz> |
5 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> | 5 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> |
6 * Copyright (C) 2008 Rob Buis <buis@kde.org> | 6 * Copyright (C) 2008 Rob Buis <buis@kde.org> |
7 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> | 7 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> |
8 * Copyright (C) Research In Motion Limited 2010-2012. All rights reserved. | 8 * Copyright (C) Research In Motion Limited 2010-2012. All rights reserved. |
| 9 * Copyright (C) 2012 Google Inc. |
9 * | 10 * |
10 * This library is free software; you can redistribute it and/or | 11 * This library is free software; you can redistribute it and/or |
11 * modify it under the terms of the GNU Library General Public | 12 * modify it under the terms of the GNU Library General Public |
12 * License as published by the Free Software Foundation; either | 13 * License as published by the Free Software Foundation; either |
13 * version 2 of the License, or (at your option) any later version. | 14 * version 2 of the License, or (at your option) any later version. |
14 * | 15 * |
15 * This library is distributed in the hope that it will be useful, | 16 * This library is distributed in the hope that it will be useful, |
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 17 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
18 * Library General Public License for more details. | 19 * Library General Public License for more details. |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 bool stopAfterNext = false; | 170 bool stopAfterNext = false; |
170 SVGTextLayoutAttributes* previous = 0; | 171 SVGTextLayoutAttributes* previous = 0; |
171 SVGTextLayoutAttributes* next = 0; | 172 SVGTextLayoutAttributes* next = 0; |
172 findPreviousAndNextAttributes(this, text, stopAfterNext, previous, next); | 173 findPreviousAndNextAttributes(this, text, stopAfterNext, previous, next); |
173 if (previous) | 174 if (previous) |
174 affectedAttributes.append(previous); | 175 affectedAttributes.append(previous); |
175 if (next) | 176 if (next) |
176 affectedAttributes.append(next); | 177 affectedAttributes.append(next); |
177 } | 178 } |
178 | 179 |
179 void RenderSVGText::textDOMChanged() | 180 void RenderSVGText::invalidateTextPositioningElements() |
180 { | 181 { |
181 if (m_needsPositioningValuesUpdate) | 182 // Clear the text positioning elements. This should be called when either th
e children |
182 return; | 183 // of a DOM text element have changed, or the length of the text in any chil
d element |
| 184 // has changed. Failure to clear may leave us with invalid elements, as othe
r code paths |
| 185 // do not always cause the position elements to be marked invalid before use
. |
183 m_layoutAttributesBuilder.clearTextPositioningElements(); | 186 m_layoutAttributesBuilder.clearTextPositioningElements(); |
184 } | 187 } |
185 | 188 |
186 static inline void recursiveUpdateScaledFont(RenderObject* start) | 189 static inline void recursiveUpdateScaledFont(RenderObject* start) |
187 { | 190 { |
188 for (RenderObject* child = start->firstChild(); child; child = child->nextSi
bling()) { | 191 for (RenderObject* child = start->firstChild(); child; child = child->nextSi
bling()) { |
189 if (child->isSVGInlineText()) { | 192 if (child->isSVGInlineText()) { |
190 toRenderSVGInlineText(child)->updateScaledFont(); | 193 toRenderSVGInlineText(child)->updateScaledFont(); |
191 continue; | 194 continue; |
192 } | 195 } |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 size = affectedAttributes.size(); | 428 size = affectedAttributes.size(); |
426 for (size_t i = 0; i < size; ++i) | 429 for (size_t i = 0; i < size; ++i) |
427 m_layoutAttributesBuilder.rebuildMetricsForTextRenderer(affectedAttribut
es[i]->context()); | 430 m_layoutAttributesBuilder.rebuildMetricsForTextRenderer(affectedAttribut
es[i]->context()); |
428 | 431 |
429 m_layoutAttributes = newLayoutAttributes; | 432 m_layoutAttributes = newLayoutAttributes; |
430 } | 433 } |
431 | 434 |
432 } | 435 } |
433 | 436 |
434 #endif // ENABLE(SVG) | 437 #endif // ENABLE(SVG) |
OLD | NEW |