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

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

Issue 896773002: [svg2] Make 'x' and 'y' presentation attributes (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 5 years, 10 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/layout/svg/SVGPathData.cpp ('k') | Source/core/svg/SVGAnimatedTypeAnimator.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/SVGAnimateElement.cpp
diff --git a/Source/core/svg/SVGAnimateElement.cpp b/Source/core/svg/SVGAnimateElement.cpp
index 4a57892489e0f5844de22f21d33aca981d3a1696..0b0b95c6d8f2a456c11a63bc2b8ca4f7a6446f66 100644
--- a/Source/core/svg/SVGAnimateElement.cpp
+++ b/Source/core/svg/SVGAnimateElement.cpp
@@ -162,7 +162,7 @@ void SVGAnimateElement::resetAnimatedType()
if (shouldApply == DontApplyAnimation)
return;
- if (shouldApply == ApplyXMLAnimation) {
+ if (shouldApply == ApplyXMLAnimation || shouldApply == ApplyXMLandCSSAnimation) {
// SVG DOM animVal animation code-path.
SVGElementInstances animatedElements = findElementInstances(targetElement);
ASSERT(!animatedElements.isEmpty());
@@ -282,7 +282,10 @@ void SVGAnimateElement::clearAnimatedType(SVGElement* targetElement)
return;
}
- if (ensureAnimator()->isAnimatingCSSProperty()) {
+ ShouldApplyAnimation shouldApply = shouldApplyAnimation(targetElement, attributeName());
+ if (shouldApply == ApplyXMLandCSSAnimation) {
+ removeCSSPropertyFromTargetAndInstances(targetElement, attributeName());
+ } else if (ensureAnimator()->isAnimatingCSSProperty()) {
// CSS properties animation code-path.
removeCSSPropertyFromTargetAndInstances(targetElement, attributeName());
m_animatedProperty.clear();
@@ -309,7 +312,11 @@ void SVGAnimateElement::applyResultsToTarget()
if (!m_animatedProperty)
return;
- if (m_animator->isAnimatingCSSProperty()) {
+ // We do update the style and the animation property independent of each other.
+ ShouldApplyAnimation shouldApply = shouldApplyAnimation(targetElement(), attributeName());
+ if (shouldApply == ApplyXMLandCSSAnimation) {
+ applyCSSPropertyToTargetAndInstances(targetElement(), attributeName(), m_animatedProperty->valueAsString());
+ } else if (m_animator->isAnimatingCSSProperty()) {
// CSS properties animation code-path.
// Convert the result of the animation to a String and apply it as CSS property on the target & all instances.
applyCSSPropertyToTargetAndInstances(targetElement(), attributeName(), m_animatedProperty->valueAsString());
« no previous file with comments | « Source/core/layout/svg/SVGPathData.cpp ('k') | Source/core/svg/SVGAnimatedTypeAnimator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698