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

Side by Side Diff: LayoutTests/svg/animations/animate-marker-orient-from-auto-to-angle.html

Issue 672853002: Implement "auto -> angle" animation on <marker> orient attribute. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 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 unified diff | Download patch
« no previous file with comments | « no previous file | LayoutTests/svg/animations/animate-marker-orient-from-auto-to-angle-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 description("Animate SVGMarkerElement orientAttr from an angle to auto"); 1 <script src="../../resources/js-test.js"></script>
2 <script src="resources/SVGTestCase.js"></script>
3 <script src="resources/SVGAnimationTestCase.js"></script>
4 <body onload="runSMILTest()">
5 <h1>SVG 1.1 dynamic animation tests</h1>
6 <script>
7 description("Animate SVGMarkerElement orientAttr from auto to an angle");
2 createSVGTestCase(); 8 createSVGTestCase();
3 9
4 // Setup test document 10 // Setup test document
5 11
6 var marker = createSVGElement("marker"); 12 var marker = createSVGElement("marker");
7 marker.setAttribute("id", "marker"); 13 marker.setAttribute("id", "marker");
8 marker.setAttribute("viewBox", "0 0 10 10"); 14 marker.setAttribute("viewBox", "0 0 10 10");
9 marker.setAttribute("markerWidth", "2"); 15 marker.setAttribute("markerWidth", "2");
10 marker.setAttribute("markerHeight", "2"); 16 marker.setAttribute("markerHeight", "2");
11 marker.setAttribute("refX", "5"); 17 marker.setAttribute("refX", "5");
(...skipping 19 matching lines...) Expand all
31 path.setAttribute("marker-end", "url(#marker)"); 37 path.setAttribute("marker-end", "url(#marker)");
32 path.setAttribute("d", "M 130 135 L 180 135 L 180 185"); 38 path.setAttribute("d", "M 130 135 L 180 135 L 180 185");
33 path.setAttribute("transform", "translate(-130, -120)"); 39 path.setAttribute("transform", "translate(-130, -120)");
34 rootSVGElement.appendChild(path); 40 rootSVGElement.appendChild(path);
35 41
36 var animate1 = createSVGElement("animate"); 42 var animate1 = createSVGElement("animate");
37 animate1.setAttribute("id", "animation"); 43 animate1.setAttribute("id", "animation");
38 animate1.setAttribute("attributeName", "orient"); 44 animate1.setAttribute("attributeName", "orient");
39 animate1.setAttribute("begin", "path.click"); 45 animate1.setAttribute("begin", "path.click");
40 animate1.setAttribute("dur", "4s"); 46 animate1.setAttribute("dur", "4s");
41 animate1.setAttribute("from", "90deg"); 47 animate1.setAttribute("from", "auto");
42 animate1.setAttribute("to", "auto"); 48 animate1.setAttribute("to", "90deg");
43 animate1.setAttribute("fill", "freeze"); 49 animate1.setAttribute("fill", "freeze");
44 marker.appendChild(animate1); 50 marker.appendChild(animate1);
45 51
46 // Setup animation test 52 // Setup animation test
47 function sample1() { 53 function sample1() {
48 shouldBeCloseEnough("marker.orientAngle.animVal.value", "0"); 54 shouldBeCloseEnough("marker.orientAngle.animVal.value", "0");
49 shouldBe("marker.orientAngle.baseVal.value", "0"); 55 shouldBe("marker.orientAngle.baseVal.value", "0");
50 56
51 shouldBe("marker.orientType.animVal", "SVGMarkerElement.SVG_MARKER_ORIENT_AN GLE"); 57 shouldBe("marker.orientType.animVal", "SVGMarkerElement.SVG_MARKER_ORIENT_AN GLE");
52 shouldBe("marker.orientType.baseVal", "SVGMarkerElement.SVG_MARKER_ORIENT_AN GLE"); 58 shouldBe("marker.orientType.baseVal", "SVGMarkerElement.SVG_MARKER_ORIENT_AN GLE");
53 } 59 }
54 60
55 function sample2() { 61 function sample2() {
62 shouldBeCloseEnough("marker.orientAngle.animVal.value", "0");
63 shouldBe("marker.orientAngle.baseVal.value", "0");
64
65 shouldBe("marker.orientType.animVal", "SVGMarkerElement.SVG_MARKER_ORIENT_AU TO");
66 shouldBe("marker.orientType.baseVal", "SVGMarkerElement.SVG_MARKER_ORIENT_AN GLE");
67 }
68
69 function sample3() {
56 shouldBeCloseEnough("marker.orientAngle.animVal.value", "90"); 70 shouldBeCloseEnough("marker.orientAngle.animVal.value", "90");
57 shouldBe("marker.orientAngle.baseVal.value", "0"); 71 shouldBe("marker.orientAngle.baseVal.value", "0");
58 72
59 shouldBe("marker.orientType.animVal", "SVGMarkerElement.SVG_MARKER_ORIENT_AN GLE"); 73 shouldBe("marker.orientType.animVal", "SVGMarkerElement.SVG_MARKER_ORIENT_AN GLE");
60 shouldBe("marker.orientType.baseVal", "SVGMarkerElement.SVG_MARKER_ORIENT_AN GLE"); 74 shouldBe("marker.orientType.baseVal", "SVGMarkerElement.SVG_MARKER_ORIENT_AN GLE");
61 } 75 }
62 76
63 function sample3() {
64 shouldBeCloseEnough("marker.orientAngle.animVal.value", "0");
65 shouldBe("marker.orientAngle.baseVal.value", "0");
66
67 shouldBe("marker.orientType.animVal", "SVGMarkerElement.SVG_MARKER_ORIENT_AU TO");
68 shouldBe("marker.orientType.baseVal", "SVGMarkerElement.SVG_MARKER_ORIENT_AN GLE");
69 }
70
71 function executeTest() { 77 function executeTest() {
72 const expectedValues = [ 78 const expectedValues = [
73 // [animationId, time, sampleCallback] 79 // [animationId, time, sampleCallback]
74 ["animation", 0.0, sample1], 80 ["animation", 0.0, sample1],
75 ["animation", 0.001, sample2], 81 ["animation", 0.001, sample2],
76 ["animation", 1.999, sample2], 82 ["animation", 1.999, sample2],
77 ["animation", 2.001, sample3], 83 ["animation", 2.001, sample3],
78 ["animation", 3.999, sample3], 84 ["animation", 3.999, sample3],
79 ["animation", 4.001, sample3] 85 ["animation", 4.001, sample3]
80 ]; 86 ];
81 87
82 runAnimationTest(expectedValues); 88 runAnimationTest(expectedValues);
83 } 89 }
84 90 </script>
85 var successfullyParsed = true; 91 </body>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/svg/animations/animate-marker-orient-from-auto-to-angle-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698