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

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

Issue 190793011: Use isSVG*Element() helpers more in SVG code (Part 4) (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/SVGGlyphRefElement.cpp ('k') | Source/core/svg/SVGLinearGradientElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/SVGGraphicsElement.cpp
diff --git a/Source/core/svg/SVGGraphicsElement.cpp b/Source/core/svg/SVGGraphicsElement.cpp
index 7770482b652a36c7ffc856c17f1cc35f980fe106..6d66cff05c3ac543337c1b85ff999c3df8c96507 100644
--- a/Source/core/svg/SVGGraphicsElement.cpp
+++ b/Source/core/svg/SVGGraphicsElement.cpp
@@ -60,12 +60,12 @@ PassRefPtr<SVGMatrixTearOff> SVGGraphicsElement::getTransformToElement(SVGElemen
return SVGMatrixTearOff::create(ctm);
}
-static bool isViewportElement(const Element* element)
+static bool isViewportElement(const Element& element)
{
- return (element->hasTagName(SVGNames::svgTag)
- || element->hasTagName(SVGNames::symbolTag)
- || element->hasTagName(SVGNames::foreignObjectTag)
- || element->hasTagName(SVGNames::imageTag));
+ return (isSVGSVGElement(element)
+ || isSVGSymbolElement(element)
+ || isSVGForeignObjectElement(element)
+ || isSVGImageElement(element));
}
AffineTransform SVGGraphicsElement::computeCTM(SVGElement::CTMScope mode,
@@ -87,7 +87,7 @@ AffineTransform SVGGraphicsElement::computeCTM(SVGElement::CTMScope mode,
switch (mode) {
case NearestViewportScope:
// Stop at the nearest viewport ancestor.
- done = currentElement != this && isViewportElement(currentElement);
+ done = currentElement != this && isViewportElement(*currentElement);
break;
case AncestorScope:
// Stop at the designated ancestor.
@@ -220,7 +220,7 @@ void SVGGraphicsElement::svgAttributeChanged(const QualifiedName& attrName)
SVGElement* SVGGraphicsElement::nearestViewportElement() const
{
for (Element* current = parentOrShadowHostElement(); current; current = current->parentOrShadowHostElement()) {
- if (isViewportElement(current))
+ if (isViewportElement(*current))
return toSVGElement(current);
}
@@ -231,7 +231,7 @@ SVGElement* SVGGraphicsElement::farthestViewportElement() const
{
SVGElement* farthest = 0;
for (Element* current = parentOrShadowHostElement(); current; current = current->parentOrShadowHostElement()) {
- if (isViewportElement(current))
+ if (isViewportElement(*current))
farthest = toSVGElement(current);
}
return farthest;
« no previous file with comments | « Source/core/svg/SVGGlyphRefElement.cpp ('k') | Source/core/svg/SVGLinearGradientElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698