Chromium Code Reviews| 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); |
| } |
| } |