| OLD | NEW |
| 1 description("Tests whether immutable properties can not be modified."); | 1 description("Tests whether immutable properties can not be modified."); |
| 2 | 2 |
| 3 var svgDoc = document.implementation.createDocument("http://www.w3.org/2000/svg"
, "svg", null); | 3 var svgDoc = document.implementation.createDocument("http://www.w3.org/2000/svg"
, "svg", null); |
| 4 | 4 |
| 5 // 'viewport' attribute is immutable (Spec: The object itself and its contents a
re both readonly.) | 5 // 'viewport' attribute is immutable (Spec: The object itself and its contents a
re both readonly.) |
| 6 var viewport = svgDoc.documentElement.viewport; | 6 var viewport = svgDoc.documentElement.viewport; |
| 7 | 7 |
| 8 shouldBe("viewport.x", "0"); | 8 shouldBe("viewport.x", "0"); |
| 9 viewport.x = 100; | 9 viewport.x = 100; |
| 10 | 10 |
| 11 shouldBe("viewport.x", "100"); | 11 shouldBe("viewport.x", "100"); |
| 12 shouldBe("svgDoc.documentElement.viewport.x", "0"); | 12 shouldBe("svgDoc.documentElement.viewport.x", "0"); |
| 13 | 13 |
| 14 // Every attribute of SVGZoomEvent is immutable (Spec: The object itself and its
contents are both readonly.) | 14 // Every attribute of SVGZoomEvent is immutable (Spec: The object itself and its
contents are both readonly.) |
| 15 var zoomEvent = svgDoc.createEvent("SVGZoomEvents"); | 15 var zoomEvent = svgDoc.createEvent("SVGZoomEvents"); |
| 16 | 16 |
| 17 // 'zoomRectScreen' property | 17 // 'zoomRectScreen' property |
| 18 var zoomRectScreen = zoomEvent.zoomRectScreen; | 18 var zoomRectScreen = zoomEvent.zoomRectScreen; |
| 19 | 19 |
| 20 shouldBe("zoomRectScreen.x", "0"); | 20 shouldBe("zoomRectScreen.x", "0"); |
| 21 zoomRectScreen.x = 100; | 21 shouldThrow("zoomRectScreen.x = 100;"); |
| 22 | |
| 23 shouldBe("zoomRectScreen.x", "100"); | |
| 24 shouldBe("zoomEvent.zoomRectScreen.x", "0"); | |
| 25 | 22 |
| 26 // 'previousScale' property | 23 // 'previousScale' property |
| 27 shouldBe("zoomEvent.previousScale", "0") | 24 shouldBe("zoomEvent.previousScale", "0") |
| 28 zoomEvent.previousScale = 200; | 25 zoomEvent.previousScale = 200; |
| 29 shouldBe("zoomEvent.previousScale", "0") | 26 shouldBe("zoomEvent.previousScale", "0") |
| 30 | 27 |
| 31 // 'previousTranslate' property | 28 // 'previousTranslate' property |
| 32 var previousTranslate = zoomEvent.previousTranslate; | 29 var previousTranslate = zoomEvent.previousTranslate; |
| 33 | 30 |
| 34 shouldBe("previousTranslate.x", "0"); | 31 shouldBe("previousTranslate.x", "0"); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 45 // 'newTranslate' property | 42 // 'newTranslate' property |
| 46 var newTranslate = zoomEvent.previousTranslate; | 43 var newTranslate = zoomEvent.previousTranslate; |
| 47 | 44 |
| 48 shouldBe("newTranslate.x", "0"); | 45 shouldBe("newTranslate.x", "0"); |
| 49 newTranslate.x = 300; | 46 newTranslate.x = 300; |
| 50 | 47 |
| 51 shouldBe("newTranslate.x", "300"); | 48 shouldBe("newTranslate.x", "300"); |
| 52 shouldBe("zoomEvent.newTranslate.x", "0"); | 49 shouldBe("zoomEvent.newTranslate.x", "0"); |
| 53 | 50 |
| 54 var successfullyParsed = true; | 51 var successfullyParsed = true; |
| OLD | NEW |