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

Unified Diff: Source/core/rendering/svg/RenderSVGTextPath.cpp

Issue 191003007: Use isSVG*Element() helpers more in SVG code (Part 3) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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
Index: Source/core/rendering/svg/RenderSVGTextPath.cpp
diff --git a/Source/core/rendering/svg/RenderSVGTextPath.cpp b/Source/core/rendering/svg/RenderSVGTextPath.cpp
index 26d2055777ad9c8f2bef86d6c04f19089e4c1330..c1ff87495f56da67545fb48171945741778572c3 100644
--- a/Source/core/rendering/svg/RenderSVGTextPath.cpp
+++ b/Source/core/rendering/svg/RenderSVGTextPath.cpp
@@ -41,7 +41,8 @@ bool RenderSVGTextPath::isChildAllowed(RenderObject* child, RenderStyle*) const
#if ENABLE(SVG_FONTS)
// 'altGlyph' is supported by the content model for 'textPath', but...
- if (child->node()->hasTagName(SVGNames::altGlyphTag))
+ ASSERT(child->node());
+ if (isSVGAltGlyphElement(*child->node()))
return false;
#endif
@@ -52,20 +53,20 @@ Path RenderSVGTextPath::layoutPath() const
{
SVGTextPathElement* textPathElement = toSVGTextPathElement(node());
Element* targetElement = SVGURIReference::targetElementFromIRIString(textPathElement->href()->currentValue()->value(), textPathElement->document());
- if (!targetElement || !targetElement->hasTagName(SVGNames::pathTag))
+ if (!isSVGPathElement(targetElement))
return Path();
- SVGPathElement* pathElement = toSVGPathElement(targetElement);
+ SVGPathElement& pathElement = toSVGPathElement(*targetElement);
Path pathData;
- updatePathFromGraphicsElement(pathElement, pathData);
+ updatePathFromGraphicsElement(&pathElement, pathData);
// Spec: The transform attribute on the referenced 'path' element represents a
// supplemental transformation relative to the current user coordinate system for
// the current 'text' element, including any adjustments to the current user coordinate
// system due to a possible transform attribute on the current 'text' element.
// http://www.w3.org/TR/SVG/text.html#TextPathElement
- pathData.transform(pathElement->animatedLocalTransform());
+ pathData.transform(pathElement.animatedLocalTransform());
return pathData;
}
« no previous file with comments | « Source/core/rendering/svg/RenderSVGTSpan.cpp ('k') | Source/core/rendering/svg/RenderSVGTransformableContainer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698