haikuwebkit/LayoutTests/svg/animations/animate-marker-orienttype-1...

26 lines
942 B
HTML
Raw Permalink Normal View History

Fix animation of orient attribute on marker element https://bugs.webkit.org/show_bug.cgi?id=137942 Source/WebCore: Patch by Nikos Andronikos <nikos.andronikos-webkit@cisra.canon.com.au> on 2014-11-04 Reviewed by Dirk Schulze. Fixed implementation of SVG animated angles and the SVG marker element orient attribute. SVG animated angle was missing the logic to support animation from auto to a numeric angle value - this is now added. The SVG marker element getter for orientType was not returning the animated value for orientType so in some cases (i.e. when the initial value and the animated values were of different types) the animation was not being rendered - although it was running. Tests: svg/animations/animate-marker-orienttype-1.html svg/animations/animate-marker-orienttype-2.html svg/animations/animate-marker-orienttype-3.html * svg/SVGAnimatedAngle.cpp: (WebCore::SVGAnimatedAngleAnimator::calculateAnimatedValue): Added logic to support auto to angle animation. * svg/SVGMarkerElement.cpp: (WebCore::SVGMarkerElement::orientType): This method now returns the animated value if an animation is running. * svg/SVGMarkerElement.h: LayoutTests: Patch by Nikos Andrkos Andronikos <nikos.andronikos-webkit@cisra.canon.com.au> on 2014-11-04 Reviewed by Dirk Schulze. Test the rendered result of the animation of the orient attribute. Existing tests were only testing the animated value in the DOM. * svg/animations/animate-marker-orienttype-1-expected.txt: Added. * svg/animations/animate-marker-orienttype-1.html: Added. * svg/animations/animate-marker-orienttype-2-expected.txt: Added. * svg/animations/animate-marker-orienttype-2.html: Added. * svg/animations/animate-marker-orienttype-3-expected.txt: Added. * svg/animations/animate-marker-orienttype-3.html: Added. Canonical link: https://commits.webkit.org/156182@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@175525 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-11-04 09:20:52 +00:00
<!doctype html>
<!--
Test that the renderer uses the animated value of orientType.
To test this, the final animated value must be of a different type than the initial value.
To verify rendering, DumpRenderTree output must be examined, not DOM values.
-->
<script>
function doTest() {
if (testRunner) {
var svg = document.querySelector("svg");
svg.pauseAnimations();
svg.setCurrentTime(5);
}
}
</script>
<svg xmlns="http://www.w3.org/2000/svg" viewbox="0 0 150 150" width="500" height="500" onload="doTest()">
<defs>
<marker id="arrow" orient="auto" markerWidth="10" markerHeight="10" style="overflow:visible">
<path d="M5,0 L 0,-5 L0,5 z" fill="green" opacity="0.5" />
<animate attributeName="orient" from="0" to="180" begin="0s" dur="1s" fill="freeze"/>
</marker>
</defs>
<path d="M 20,20 L 80,80" marker-start="url(#arrow)" stroke="black"/>
</svg>