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

Unified Diff: Source/core/svg/SVGElement.cpp

Issue 192133002: Use isSVG*Element() helpers more in SVG code (Part 1) (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
« no previous file with comments | « Source/core/svg/SVGDocument.cpp ('k') | Source/core/svg/SVGFEComponentTransferElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/SVGElement.cpp
diff --git a/Source/core/svg/SVGElement.cpp b/Source/core/svg/SVGElement.cpp
index e2634926f1f0a57767c951b2caca93497b50db3b..d1463b2fa3c88c606a28f1fa0b958aef6cd5e0fe 100644
--- a/Source/core/svg/SVGElement.cpp
+++ b/Source/core/svg/SVGElement.cpp
@@ -239,12 +239,12 @@ String SVGElement::title() const
// At this time, SVG nodes are not allowed in non-<use> shadow trees, so any shadow root we do
// have should be a use. The assert and following test is here to catch future shadow DOM changes
// that do enable SVG in a shadow tree.
- ASSERT(!shadowHostElement || shadowHostElement->hasTagName(SVGNames::useTag));
- if (shadowHostElement && shadowHostElement->hasTagName(SVGNames::useTag)) {
- SVGUseElement* useElement = toSVGUseElement(shadowHostElement);
+ ASSERT(!shadowHostElement || isSVGUseElement(*shadowHostElement));
+ if (isSVGUseElement(shadowHostElement)) {
+ SVGUseElement& useElement = toSVGUseElement(*shadowHostElement);
// If the <use> title is not empty we found the title to use.
- String useTitle(useElement->title());
+ String useTitle(useElement.title());
if (!useTitle.isEmpty())
return useTitle;
}
@@ -515,7 +515,7 @@ SVGSVGElement* SVGElement::ownerSVGElement() const
{
ContainerNode* n = parentOrShadowHostNode();
while (n) {
- if (n->hasTagName(SVGNames::svgTag))
+ if (isSVGSVGElement(*n))
return toSVGSVGElement(n);
n = n->parentOrShadowHostNode();
@@ -530,7 +530,7 @@ SVGElement* SVGElement::viewportElement() const
// to determine the "overflow" property. <use> on <symbol> wouldn't work otherwhise.
ContainerNode* n = parentOrShadowHostNode();
while (n) {
- if (n->hasTagName(SVGNames::svgTag) || n->hasTagName(SVGNames::imageTag) || n->hasTagName(SVGNames::symbolTag))
+ if (isSVGSVGElement(*n) || isSVGImageElement(*n) || isSVGSymbolElement(*n))
return toSVGElement(n);
n = n->parentOrShadowHostNode();
« no previous file with comments | « Source/core/svg/SVGDocument.cpp ('k') | Source/core/svg/SVGFEComponentTransferElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698