1 description("Tests whether immutable properties can not be modified.");
3 var svgDoc = document.implementation.createDocument("http://www.w3.org/2000/svg", "svg", null);
5 // 'viewport' attribute is immutable (Spec: The object itself and its contents are both readonly.)
6 var viewport = svgDoc.documentElement.viewport;
8 shouldBe("viewport.x", "0");
11 shouldBe("viewport.x", "100");
12 shouldBe("svgDoc.documentElement.viewport.x", "0");
14 // Every attribute of SVGZoomEvent is immutable (Spec: The object itself and its contents are both readonly.)
15 var zoomEvent = svgDoc.createEvent("SVGZoomEvents");
17 // 'zoomRectScreen' property
18 var zoomRectScreen = zoomEvent.zoomRectScreen;
20 shouldBe("zoomRectScreen.x", "0");
21 shouldThrow("zoomRectScreen.x = 100;");
23 // 'previousScale' property
24 shouldBe("zoomEvent.previousScale", "0")
25 zoomEvent.previousScale = 200;
26 shouldBe("zoomEvent.previousScale", "0")
28 // 'previousTranslate' property
29 var previousTranslate = zoomEvent.previousTranslate;
31 shouldBe("previousTranslate.x", "0");
32 shouldThrow("previousTranslate.x = 300;");
34 shouldBe("zoomEvent.previousTranslate.x", "0");
36 // 'newScale' property
37 shouldBe("zoomEvent.newScale", "0");
38 shouldThrow("zoomEvent.newScale = 200;");
39 shouldBe("zoomEvent.newScale", "0");
41 // 'newTranslate' property
42 var newTranslate = zoomEvent.newTranslate;
44 shouldBe("newTranslate.x", "0");
45 shouldThrow("newTranslate.x = 300;");
46 shouldBe("newTranslate.x", "0");
48 var successfullyParsed = true;