| OLD | NEW |
| 1 description("Test animation of use element width/height"); | 1 description("Test animation of use element width/height"); |
| 2 createSVGTestCase(); | 2 createSVGTestCase(); |
| 3 | 3 |
| 4 // Setup test document | 4 // Setup test document |
| 5 var symbol = createSVGElement("symbol"); | 5 var symbol = createSVGElement("symbol"); |
| 6 symbol.setAttribute("id", "symbol"); | 6 symbol.setAttribute("id", "symbol"); |
| 7 | 7 |
| 8 var rect = createSVGElement("rect"); | 8 var rect = createSVGElement("rect"); |
| 9 rect.setAttribute("id", "rect"); | 9 rect.setAttribute("id", "rect"); |
| 10 rect.setAttribute("x", "10"); | 10 rect.setAttribute("x", "10"); |
| 11 rect.setAttribute("y", "10"); | 11 rect.setAttribute("y", "10"); |
| 12 rect.setAttribute("width", "100%"); | 12 rect.setAttribute("width", "100%"); |
| 13 rect.setAttribute("height", "100%"); | 13 rect.setAttribute("height", "100%"); |
| 14 rect.setAttribute("fill", "green"); | 14 rect.setAttribute("fill", "green"); |
| 15 rect.setAttribute("onclick", "executeTest()"); | |
| 16 symbol.appendChild(rect); | 15 symbol.appendChild(rect); |
| 17 rootSVGElement.appendChild(symbol); | 16 rootSVGElement.appendChild(symbol); |
| 18 | 17 |
| 19 var use = createSVGElement("use"); | 18 var use = createSVGElement("use"); |
| 20 use.setAttribute("id", "use"); | 19 use.setAttribute("id", "use"); |
| 21 use.setAttributeNS('http://www.w3.org/1999/xlink', 'xlink:href', '#symbol'); | 20 use.setAttributeNS('http://www.w3.org/1999/xlink', 'xlink:href', '#symbol'); |
| 22 use.setAttribute("x", "0"); | 21 use.setAttribute("x", "0"); |
| 23 use.setAttribute("y", "0"); | 22 use.setAttribute("y", "0"); |
| 24 use.setAttribute("width", "100"); | 23 use.setAttribute("width", "100"); |
| 25 use.setAttribute("height", "100"); | 24 use.setAttribute("height", "100"); |
| 25 use.setAttribute("onclick", "executeTest()"); |
| 26 rootSVGElement.appendChild(use); | 26 rootSVGElement.appendChild(use); |
| 27 | 27 |
| 28 var animate = createSVGElement("animate"); | 28 var animate = createSVGElement("animate"); |
| 29 animate.setAttribute("id", "animate"); | 29 animate.setAttribute("id", "animate"); |
| 30 animate.setAttribute("attributeName", "width"); | 30 animate.setAttribute("attributeName", "width"); |
| 31 animate.setAttribute("attributeType", "XML"); | 31 animate.setAttribute("attributeType", "XML"); |
| 32 animate.setAttribute("begin", "1s"); | 32 animate.setAttribute("begin", "1s"); |
| 33 animate.setAttribute("dur", "10s"); | 33 animate.setAttribute("dur", "10s"); |
| 34 animate.setAttribute("from", "100"); | 34 animate.setAttribute("from", "100"); |
| 35 animate.setAttribute("to", "200"); | 35 animate.setAttribute("to", "200"); |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 ["animate2", 2.5, sample4], | 113 ["animate2", 2.5, sample4], |
| 114 ["animate2", 3.5, sample5] | 114 ["animate2", 3.5, sample5] |
| 115 ]; | 115 ]; |
| 116 | 116 |
| 117 runAnimationTest(expectedValues); | 117 runAnimationTest(expectedValues); |
| 118 } | 118 } |
| 119 | 119 |
| 120 window.clickX = 50; | 120 window.clickX = 50; |
| 121 window.clickY = 50; | 121 window.clickY = 50; |
| 122 var successfullyParsed = true; | 122 var successfullyParsed = true; |
| OLD | NEW |