Fix keyTimes list length of from/to/by animations.

For from/to/by animations, the length of keyTimes and keyPoints
attribute if are specified must be equal and must have at least
2 values.

R=fs@opera.com,dschulze@chromium.org
BUG=377050

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

git-svn-id: svn://svn.chromium.org/blink/trunk@180390 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 00199ec4
<!DOCTYPE html>
<svg xmlns="http://www.w3.org/2000/svg">
<circle>
<animateMotion calcMode="discrete" keyPoints="0.8" keyTimes="0" to="3"/>
</circle>
</svg>
<p>PASS if Blink does not crash in debug.</p>
<script>
if (window.testRunner) {
testRunner.waitUntilDone();
testRunner.dumpAsText();
window.onload = function() {
testRunner.notifyDone();
};
}
</script>
\ No newline at end of file
...@@ -572,6 +572,9 @@ void SVGAnimationElement::startedActiveInterval() ...@@ -572,6 +572,9 @@ void SVGAnimationElement::startedActiveInterval()
String by = byValue(); String by = byValue();
if (animationMode == NoAnimation) if (animationMode == NoAnimation)
return; return;
if ((animationMode == FromToAnimation || animationMode == FromByAnimation || animationMode == ToAnimation || animationMode == ByAnimation)
&& (fastHasAttribute(SVGNames::keyPointsAttr) && fastHasAttribute(SVGNames::keyTimesAttr) && (m_keyTimes.size() < 2 || m_keyTimes.size() != m_keyPoints.size())))
return;
if (animationMode == FromToAnimation) if (animationMode == FromToAnimation)
m_animationValid = calculateFromAndToValues(from, to); m_animationValid = calculateFromAndToValues(from, to);
else if (animationMode == ToAnimation) { else if (animationMode == ToAnimation) {
......
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