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

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

Issue 18358002: Simplify SVGTextContentElement::elementFromRenderer() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 5 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
« no previous file with comments | « no previous file | 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) 2004, 2005, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Rob Buis <buis@kde.org>
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 } 294 }
295 295
296 SVGTextContentElement* SVGTextContentElement::elementFromRenderer(RenderObject* renderer) 296 SVGTextContentElement* SVGTextContentElement::elementFromRenderer(RenderObject* renderer)
297 { 297 {
298 if (!renderer) 298 if (!renderer)
299 return 0; 299 return 0;
300 300
301 if (!renderer->isSVGText() && !renderer->isSVGInline()) 301 if (!renderer->isSVGText() && !renderer->isSVGInline())
302 return 0; 302 return 0;
303 303
304 Node* node = renderer->node(); 304 SVGElement* element = toSVGElement(renderer->node());
305 ASSERT(node); 305 ASSERT(element);
Stephen Chennney 2013/07/01 13:55:16 Leave these 2 lines. We still want to catch cases
do-not-use 2013/07/01 13:58:59 ASSERT(element) would cover that case in the new p
Stephen Chennney 2013/07/01 14:09:54 You're right. That's what I get for reviewing befo
306 ASSERT(node->isSVGElement());
307 306
308 if (!node->hasTagName(SVGNames::textTag) 307 if (!element->isTextContent())
309 && !node->hasTagName(SVGNames::tspanTag)
310 #if ENABLE(SVG_FONTS)
311 && !node->hasTagName(SVGNames::altGlyphTag)
312 #endif
313 && !node->hasTagName(SVGNames::trefTag)
314 && !node->hasTagName(SVGNames::textPathTag))
315 return 0; 308 return 0;
316 309
317 return static_cast<SVGTextContentElement*>(node); 310 return toSVGTextContentElement(element);
318 } 311 }
319 312
320 } 313 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698