Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge r164933 - Ensure keySplines is valid in SMIL animations
<http://webkit.org/b/129547> <rdar://problem/15676128> Reviewed by Darin Adler. Merged from Blink (patch by Philip Rogers): https://src.chromium.org/viewvc/blink?revision=156452&view=revision http://crbug.com/276111 This patch fixes a crash in SMIL animations when keySplines are not specified. The SMIL spec is clear on this: http://www.w3.org/TR/2001/REC-smil-animation-20010904/#AnimFuncCalcMode "If there are any errors in the keyTimes specification (bad values, too many or too few values), the animation will have no effect." This patch simply checks that keyTimes is not empty. Previously, splinesCount was set to be m_keySplines.size() + 1 in SVGAnimationElement.cpp; this patch changes splinesCount to be equal to m_keySplines.size() to make the logic easier to follow and to match other checks in SVGAnimationElement::startedActiveInterval. Source/WebCore: Test: svg/animations/animate-keysplines-crash.html * svg/SVGAnimationElement.cpp: (WebCore::SVGAnimationElement::startedActiveInterval): LayoutTests: * svg/animations/animate-keysplines-crash-expected.txt: Added. * svg/animations/animate-keysplines-crash.html: Added.
- Loading branch information
1 parent
a95aa0c
commit e1b99c0
Showing
5 changed files
with
90 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
LayoutTests/svg/animations/animate-keysplines-crash-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
PASS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<!DOCTYPE HTML> | ||
<html> | ||
<body> | ||
Test for crbug.com/276111: This test passes if it does not crash. | ||
<svg xmlns="http://www.w3.org/2000/svg"> | ||
<rect> | ||
<animateMotion path="M 1 2Z" id="animateMotionElement" calcMode="spline" values="M 1 2Z; M3 4Z"/> | ||
</rect> | ||
</svg> | ||
<script> | ||
if (window.testRunner) { | ||
testRunner.dumpAsText(); | ||
testRunner.waitUntilDone(); | ||
} | ||
|
||
function removePathAndFinishTest() { | ||
animateMotionElement.removeAttribute('path'); | ||
setTimeout(function() { | ||
document.write("PASS"); | ||
if (window.testRunner) | ||
testRunner.notifyDone(); | ||
}, 0); | ||
} | ||
|
||
setTimeout('removePathAndFinishTest()', 0); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters