Index: LayoutTests/svg/animations/script-tests/animate-css-xml-attributeType.js |
diff --git a/LayoutTests/svg/animations/script-tests/animate-css-xml-attributeType.js b/LayoutTests/svg/animations/script-tests/animate-css-xml-attributeType.js |
index 2a3f6a3fd301e73baa90ef7eb9e503b3e23e3297..e87d52b6e35b269c74a889a82c855da18a5d9e12 100644 |
--- a/LayoutTests/svg/animations/script-tests/animate-css-xml-attributeType.js |
+++ b/LayoutTests/svg/animations/script-tests/animate-css-xml-attributeType.js |
@@ -2,61 +2,59 @@ description("Tests that XML and CSS attributeTypes can be switched between."); |
createSVGTestCase(); |
// Setup test document |
-var rect = createSVGElement("rect"); |
-rect.setAttribute("id", "rect"); |
-rect.setAttribute("x", "100"); |
-rect.setAttribute("width", "100"); |
-rect.setAttribute("height", "100"); |
-rect.setAttribute("fill", "green"); |
-rect.setAttribute("onclick", "executeTest()"); |
+var polygon = createSVGElement("polygon"); |
+polygon.setAttribute("id", "polygon"); |
+polygon.setAttribute("points", "100 0 200 0 200 100 100 100"); |
+polygon.setAttribute("fill", "green"); |
+polygon.setAttribute("onclick", "executeTest()"); |
var set = createSVGElement("set"); |
set.setAttribute("id", "set"); |
-set.setAttribute("attributeName", "x"); |
+set.setAttribute("attributeName", "points"); |
set.setAttribute("attributeType", "XML"); |
-set.setAttribute("to", "300"); |
+set.setAttribute("to", "300 0 400 0 400 100 300 100"); |
set.setAttribute("begin", "click"); |
-rect.appendChild(set); |
-rootSVGElement.appendChild(rect); |
+polygon.appendChild(set); |
+rootSVGElement.appendChild(polygon); |
// Setup animation test |
function sample1() { |
- shouldBeCloseEnough("rect.x.animVal.value", "100"); |
- shouldBe("rect.x.baseVal.value", "100"); |
+ shouldBeCloseEnough("polygon.animatedPoints.getItem(0).x", "100"); |
+ shouldBe("polygon.points.getItem(0).x", "100"); |
} |
function sample2() { |
- shouldBeCloseEnough("rect.x.animVal.value", "300"); |
+ shouldBeCloseEnough("polygon.animatedPoints.getItem(0).x", "300"); |
// change the animationType to CSS which is invalid. |
set.setAttribute("attributeType", "CSS"); |
} |
function sample3() { |
// verify that the animation resets. |
- shouldBeCloseEnough("rect.x.animVal.value", "100"); |
+ shouldBeCloseEnough("polygon.animatedPoints.getItem(0).x", "100"); |
// change the animation to a CSS animatable value. |
set.setAttribute("attributeName", "opacity"); |
set.setAttribute("to", "0.8"); |
} |
function sample4() { |
- shouldBeCloseEnough("parseFloat(getComputedStyle(rect).opacity)", "0.8"); |
+ shouldBeCloseEnough("parseFloat(getComputedStyle(polygon).opacity)", "0.8"); |
// change the animation to a non-CSS animatable value. |
- set.setAttribute("attributeName", "x"); |
- set.setAttribute("to", "200"); |
+ set.setAttribute("attributeName", "points"); |
+ set.setAttribute("to", "200 0 300 0 300 100 200 100"); |
} |
function sample5() { |
// verify that the animation does not run. |
- shouldBeCloseEnough("rect.x.animVal.value", "100"); |
- shouldBeCloseEnough("parseFloat(getComputedStyle(rect).opacity)", "1.0"); |
+ shouldBeCloseEnough("polygon.animatedPoints.getItem(0).x", "100"); |
+ shouldBeCloseEnough("parseFloat(getComputedStyle(polygon).opacity)", "1.0"); |
// change the animationType to XML which is valid. |
set.setAttribute("attributeType", "XML"); |
} |
function sample6() { |
- shouldBeCloseEnough("rect.x.animVal.value", "200"); |
- shouldBe("rect.x.baseVal.value", "100"); |
+ shouldBeCloseEnough("polygon.animatedPoints.getItem(0).x", "200"); |
+ shouldBe("polygon.points.getItem(0).x", "100"); |
} |
function executeTest() { |