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

Unified 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, 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/SVGTextContentElement.cpp
diff --git a/Source/core/svg/SVGTextContentElement.cpp b/Source/core/svg/SVGTextContentElement.cpp
index 14001eba56d26f9bae4248f985993f4d04038c5c..f0787f420aa8a11ef011dbab1cc18ded9827d10a 100644
--- a/Source/core/svg/SVGTextContentElement.cpp
+++ b/Source/core/svg/SVGTextContentElement.cpp
@@ -301,20 +301,13 @@ SVGTextContentElement* SVGTextContentElement::elementFromRenderer(RenderObject*
if (!renderer->isSVGText() && !renderer->isSVGInline())
return 0;
- Node* node = renderer->node();
- ASSERT(node);
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
- ASSERT(node->isSVGElement());
-
- if (!node->hasTagName(SVGNames::textTag)
- && !node->hasTagName(SVGNames::tspanTag)
-#if ENABLE(SVG_FONTS)
- && !node->hasTagName(SVGNames::altGlyphTag)
-#endif
- && !node->hasTagName(SVGNames::trefTag)
- && !node->hasTagName(SVGNames::textPathTag))
+ SVGElement* element = toSVGElement(renderer->node());
+ ASSERT(element);
+
+ if (!element->isTextContent())
return 0;
- return static_cast<SVGTextContentElement*>(node);
+ return toSVGTextContentElement(element);
}
}
« 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