Title: [152284] trunk/Source/WebCore
Revision
152284
Author
[email protected]
Date
2013-07-02 04:50:24 -0700 (Tue, 02 Jul 2013)

Log Message

Simplify SVGTextContentElement::elementFromRenderer()
https://bugs.webkit.org/show_bug.cgi?id=118284

Reviewed by Andreas Kling.

Simplify SVGTextContentElement::elementFromRenderer() by leveraging
SVGElement::isTextContent() methods instead of explicitly checking
for tag names.

No new tests, no behavior change.

* svg/SVGTextContentElement.cpp:
(WebCore::SVGTextContentElement::elementFromRenderer):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (152283 => 152284)


--- trunk/Source/WebCore/ChangeLog	2013-07-02 11:19:04 UTC (rev 152283)
+++ trunk/Source/WebCore/ChangeLog	2013-07-02 11:50:24 UTC (rev 152284)
@@ -1,3 +1,19 @@
+2013-07-02  Christophe Dumez  <[email protected]>
+
+        Simplify SVGTextContentElement::elementFromRenderer()
+        https://bugs.webkit.org/show_bug.cgi?id=118284
+
+        Reviewed by Andreas Kling.
+
+        Simplify SVGTextContentElement::elementFromRenderer() by leveraging
+        SVGElement::isTextContent() methods instead of explicitly checking
+        for tag names.
+
+        No new tests, no behavior change.
+
+        * svg/SVGTextContentElement.cpp:
+        (WebCore::SVGTextContentElement::elementFromRenderer):
+
 2013-07-02  Csaba Osztrogonác  <[email protected]>
 
         Fix cast-align warnings in WebCore/platform/graphics/texmap/TextureMapperGL.cpp

Modified: trunk/Source/WebCore/svg/SVGTextContentElement.cpp (152283 => 152284)


--- trunk/Source/WebCore/svg/SVGTextContentElement.cpp	2013-07-02 11:19:04 UTC (rev 152283)
+++ trunk/Source/WebCore/svg/SVGTextContentElement.cpp	2013-07-02 11:50:24 UTC (rev 152284)
@@ -303,20 +303,13 @@
     if (!renderer->isSVGText() && !renderer->isSVGInline())
         return 0;
 
-    Node* node = renderer->node();
-    ASSERT(node);
-    ASSERT(node->isSVGElement());
+    SVGElement* element = toSVGElement(renderer->node());
+    ASSERT(element);
 
-    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))
+    if (!element->isTextContent())
         return 0;
 
-    return static_cast<SVGTextContentElement*>(node);
+    return toSVGTextContentElement(element);
 }
 
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to