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

Side by Side Diff: Source/core/svg/SVGFontData.cpp

Issue 130623002: Clean up static_cast<SVGFooElement*> by using toSVGFoo() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased Created 6 years, 11 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 | « Source/core/svg/SVGCursorElement.h ('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) 2008 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2008 Nikolas Zimmermann <zimmermann@kde.org>
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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 169
170 if (renderObject) { 170 if (renderObject) {
171 RenderObject* parentRenderObject = renderObject->isText() ? renderObject ->parent() : renderObject; 171 RenderObject* parentRenderObject = renderObject->isText() ? renderObject ->parent() : renderObject;
172 ASSERT(parentRenderObject); 172 ASSERT(parentRenderObject);
173 173
174 isVerticalText = parentRenderObject->style()->svgStyle()->isVerticalWrit ingMode(); 174 isVerticalText = parentRenderObject->style()->svgStyle()->isVerticalWrit ingMode();
175 if (Element* parentRenderObjectElement = toElement(parentRenderObject->n ode())) { 175 if (Element* parentRenderObjectElement = toElement(parentRenderObject->n ode())) {
176 language = parentRenderObjectElement->getAttribute(XMLNames::langAtt r); 176 language = parentRenderObjectElement->getAttribute(XMLNames::langAtt r);
177 177
178 if (parentRenderObjectElement->hasTagName(SVGNames::altGlyphTag)) { 178 if (parentRenderObjectElement->hasTagName(SVGNames::altGlyphTag)) {
179 SVGAltGlyphElement* altGlyph = static_cast<SVGAltGlyphElement*>( parentRenderObjectElement); 179 if (!toSVGAltGlyphElement(parentRenderObjectElement)->hasValidGl yphElements(altGlyphNames))
180 if (!altGlyph->hasValidGlyphElements(altGlyphNames))
181 altGlyphNames.clear(); 180 altGlyphNames.clear();
182 } 181 }
183 } 182 }
184 } 183 }
185 184
186 Vector<SVGGlyph> glyphs; 185 Vector<SVGGlyph> glyphs;
187 size_t altGlyphNamesSize = altGlyphNames.size(); 186 size_t altGlyphNamesSize = altGlyphNames.size();
188 if (altGlyphNamesSize) { 187 if (altGlyphNamesSize) {
189 for (size_t index = 0; index < altGlyphNamesSize; ++index) 188 for (size_t index = 0; index < altGlyphNamesSize; ++index)
190 associatedFontElement->collectGlyphsForGlyphName(altGlyphNames[index ], glyphs); 189 associatedFontElement->collectGlyphsForGlyphName(altGlyphNames[index ], glyphs);
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 mirroredCharacters.append(mirroredChar(character)); 312 mirroredCharacters.append(mirroredChar(character));
314 } 313 }
315 } 314 }
316 315
317 return mirroredCharacters.toString(); 316 return mirroredCharacters.toString();
318 } 317 }
319 318
320 } // namespace WebCore 319 } // namespace WebCore
321 320
322 #endif 321 #endif
OLDNEW
« no previous file with comments | « Source/core/svg/SVGCursorElement.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698