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

Unified Diff: third_party/WebKit/Source/core/svg/SVGAnimateMotionElement.cpp

Issue 2386013002: Hoist target element null-checks out of SVGAnimateElement::calculate* (Closed)
Patch Set: Created 4 years, 2 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: third_party/WebKit/Source/core/svg/SVGAnimateMotionElement.cpp
diff --git a/third_party/WebKit/Source/core/svg/SVGAnimateMotionElement.cpp b/third_party/WebKit/Source/core/svg/SVGAnimateMotionElement.cpp
index b9ca17df7b6cafd9c4eb8042cc752c034b3ab695..7d467b58f0df4f01a4757b7605f58abd54c29a23 100644
--- a/third_party/WebKit/Source/core/svg/SVGAnimateMotionElement.cpp
+++ b/third_party/WebKit/Source/core/svg/SVGAnimateMotionElement.cpp
@@ -51,11 +51,13 @@ bool SVGAnimateMotionElement::hasValidAttributeType() {
if (!targetElement)
return false;
- // We don't have a special attribute name to verify the animation type. Check the element name instead.
+ // We don't have a special attribute name to verify the animation type. Check
+ // the element name instead.
if (!targetElement->isSVGGraphicsElement())
return false;
// Spec: SVG 1.1 section 19.2.15
- // FIXME: svgTag is missing. Needs to be checked, if transforming <svg> could cause problems.
+ // FIXME: svgTag is missing. Needs to be checked, if transforming <svg> could
+ // cause problems.
return (
isSVGGElement(*targetElement) || isSVGDefsElement(*targetElement) ||
isSVGUseElement(*targetElement) || isSVGImageElement(*targetElement) ||
@@ -207,8 +209,7 @@ void SVGAnimateMotionElement::calculateAnimatedValue(float percentage,
unsigned repeatCount,
SVGSMILElement*) {
SVGElement* targetElement = this->targetElement();
- if (!targetElement)
- return;
+ DCHECK(targetElement);
AffineTransform* transform = targetElement->animateMotionTransform();
if (!transform)
return;
@@ -261,7 +262,8 @@ void SVGAnimateMotionElement::calculateAnimatedValue(float percentage,
}
void SVGAnimateMotionElement::applyResultsToTarget() {
- // We accumulate to the target element transform list so there is not much to do here.
+ // We accumulate to the target element transform list so there is not much to
+ // do here.
SVGElement* targetElement = this->targetElement();
if (!targetElement)
return;
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGAnimateElement.cpp ('k') | third_party/WebKit/Source/core/svg/SVGAnimationElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698