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

Side by Side Diff: Source/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.cpp

Issue 9429058: Merge 107862 - REGRESSION(r105057): Dynamically changing <tspan> offsets is broken (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1025/
Patch Set: Created 8 years, 10 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
« no previous file with comments | « LayoutTests/svg/text/tspan-dynamic-positioning.svg ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. 2 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 Vector<SVGTextLayoutAttributes*>& layoutAttributes = textRoot->layoutAttribu tes(); 72 Vector<SVGTextLayoutAttributes*>& layoutAttributes = textRoot->layoutAttribu tes();
73 73
74 size_t layoutAttributesSize = layoutAttributes.size(); 74 size_t layoutAttributesSize = layoutAttributes.size();
75 for (size_t i = 0; i < layoutAttributesSize; ++i) 75 for (size_t i = 0; i < layoutAttributesSize; ++i)
76 m_metricsBuilder.measureTextRenderer(layoutAttributes[i]->context()); 76 m_metricsBuilder.measureTextRenderer(layoutAttributes[i]->context());
77 } 77 }
78 78
79 bool SVGTextLayoutAttributesBuilder::buildLayoutAttributesIfNeeded(RenderSVGText * textRoot) 79 bool SVGTextLayoutAttributesBuilder::buildLayoutAttributesIfNeeded(RenderSVGText * textRoot)
80 { 80 {
81 ASSERT(textRoot); 81 ASSERT(textRoot);
82 if (!m_textPositions.isEmpty())
83 return m_textLength;
84 82
85 m_textLength = 0; 83 if (m_textPositions.isEmpty()) {
86 const UChar* lastCharacter = 0; 84 m_textLength = 0;
87 collectTextPositioningElements(textRoot, lastCharacter); 85 const UChar* lastCharacter = 0;
86 collectTextPositioningElements(textRoot, lastCharacter);
87 }
88 88
89 m_characterDataMap.clear(); 89 m_characterDataMap.clear();
90 if (!m_textLength) 90 if (!m_textLength)
91 return false; 91 return false;
92 92
93 buildLayoutAttributes(textRoot); 93 buildLayoutAttributes(textRoot);
94 return true; 94 return true;
95 } 95 }
96 96
97 static inline void processRenderSVGInlineText(RenderSVGInlineText* text, unsigne d& atCharacter, const UChar*& lastCharacter) 97 static inline void processRenderSVGInlineText(RenderSVGInlineText* text, unsigne d& atCharacter, const UChar*& lastCharacter)
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 continue; 247 continue;
248 } 248 }
249 249
250 it->second.rotate = lastRotation; 250 it->second.rotate = lastRotation;
251 } 251 }
252 } 252 }
253 253
254 } 254 }
255 255
256 #endif // ENABLE(SVG) 256 #endif // ENABLE(SVG)
OLDNEW
« no previous file with comments | « LayoutTests/svg/text/tspan-dynamic-positioning.svg ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698