Commit 9b01d8cf authored by fs@opera.com's avatar fs@opera.com

Always reset the animated property for CSS-type SVG animation

When resetting the animated property value for animations that is applied
as a CSS property always create a new property, or additive animations
will accumulate incorrectly to the underlying value.

BUG=349052

Review URL: https://codereview.chromium.org/183973023

git-svn-id: svn://svn.chromium.org/blink/trunk@168475 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 5a5a8872
PASS getComputedStyle(document.querySelector('rect')).fill is 'rgb(0, 128, 0)'
PASS successfullyParsed is true
TEST COMPLETE
<!DOCTYPE html>
<script src="../../resources/js-test.js"></script>
<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100">
<rect width="100" height="100" color="green" fill="black">
<animate attributeName="fill" from="currentColor" to="currentColor" begin="0s" dur="0.01s" fill="freeze" additive="sum" onend="checkResult()"/>
</rect>
</svg>
<script>
var jsTestIsAsync = true;
function checkResult() {
shouldBe("getComputedStyle(document.querySelector('rect')).fill", "'rgb(0, 128, 0)'");
finishJSTest();
}
</script>
......@@ -228,8 +228,7 @@ void SVGAnimateElement::resetAnimatedType()
computeCSSPropertyValue(targetElement, cssPropertyID(attributeName.localName()), baseValue);
}
if (!m_animatedProperty)
m_animatedProperty = animator->constructFromString(baseValue);
m_animatedProperty = animator->constructFromString(baseValue);
}
static inline void applyCSSPropertyToTarget(SVGElement* targetElement, CSSPropertyID id, const String& value)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment