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

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

Issue 2395793004: Move isTargetAttributeCSSProperty to SVGAnimateElement (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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/svg/SVGAnimationElement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/svg/SVGAnimateElement.cpp
diff --git a/third_party/WebKit/Source/core/svg/SVGAnimateElement.cpp b/third_party/WebKit/Source/core/svg/SVGAnimateElement.cpp
index c4046985b7b838aad015a5ec28085b9eb0d0ca00..ca1b9b643d46af86d17cfb8df99b4f256a51660c 100644
--- a/third_party/WebKit/Source/core/svg/SVGAnimateElement.cpp
+++ b/third_party/WebKit/Source/core/svg/SVGAnimateElement.cpp
@@ -34,6 +34,12 @@ namespace blink {
namespace {
+bool isTargetAttributeCSSProperty(SVGElement& targetElement,
+ const QualifiedName& attributeName) {
+ return SVGElement::isAnimatableCSSProperty(attributeName) ||
+ targetElement.isPresentationAttribute(attributeName);
+}
+
String computeCSSPropertyValue(SVGElement* element, CSSPropertyID id) {
DCHECK(element);
// TODO(fs): StyleEngine doesn't support document without a frame.
@@ -142,7 +148,7 @@ SVGAnimateElement::shouldApplyAnimation(SVGElement* targetElement,
// Always animate CSS properties using the ApplyCSSAnimation code path,
// regardless of the attributeType value.
- if (isTargetAttributeCSSProperty(targetElement, attributeName)) {
+ if (isTargetAttributeCSSProperty(*targetElement, attributeName)) {
if (targetElement->isPresentationAttributeWithSVGDOM(attributeName))
return ApplyXMLandCSSAnimation;
@@ -287,7 +293,7 @@ void SVGAnimateElement::resetAnimatedType() {
DCHECK_EQ(shouldApply, ApplyCSSAnimation);
// CSS properties animation code-path.
- DCHECK(isTargetAttributeCSSProperty(targetElement, attributeName));
+ DCHECK(isTargetAttributeCSSProperty(*targetElement, attributeName));
String baseValue = computeCSSPropertyValue(
targetElement, cssPropertyID(attributeName.localName()));
m_animatedProperty = m_animator.createPropertyForAnimation(baseValue);
@@ -434,7 +440,7 @@ void SVGAnimateElement::checkInvalidCSSAttributeType() {
bool hasInvalidCSSAttributeType =
targetElement() && hasValidAttributeName() &&
getAttributeType() == AttributeTypeCSS &&
- !isTargetAttributeCSSProperty(targetElement(), attributeName());
+ !isTargetAttributeCSSProperty(*targetElement(), attributeName());
if (hasInvalidCSSAttributeType != m_hasInvalidCSSAttributeType) {
if (hasInvalidCSSAttributeType)
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/svg/SVGAnimationElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698