| OLD | NEW |
| 1 description("This test checks the SVGViewSpec API"); | 1 description("This test checks the SVGViewSpec API"); |
| 2 | 2 |
| 3 var svgElement = document.createElementNS("http://www.w3.org/2000/svg", "svg"); | 3 var svgElement = document.createElementNS("http://www.w3.org/2000/svg", "svg"); |
| 4 var currentView = svgElement.currentView; | 4 var currentView = svgElement.currentView; |
| 5 svgElement.setAttribute("id", "test"); | 5 svgElement.setAttribute("id", "test"); |
| 6 svgElement.setAttribute("width", "150"); | 6 svgElement.setAttribute("width", "150"); |
| 7 svgElement.setAttribute("height", "50"); | 7 svgElement.setAttribute("height", "50"); |
| 8 svgElement.setAttribute("display", "block"); | 8 svgElement.setAttribute("display", "block"); |
| 9 | 9 |
| 10 debug(""); | 10 debug(""); |
| 11 debug("Check initial SVGSVGElement.currentView values on a SVGSVGElement"); | 11 debug("Check initial SVGSVGElement.currentView values on a SVGSVGElement"); |
| 12 shouldBe("currentView.transform.numberOfItems", "0"); | 12 shouldBe("currentView.transform.numberOfItems", "0"); |
| 13 shouldBeNull("currentView.viewTarget"); | 13 shouldBeNull("currentView.viewTarget"); |
| 14 shouldBe("currentView.zoomAndPan", "SVGZoomAndPan.SVG_ZOOMANDPAN_MAGNIFY"); | 14 shouldBe("currentView.zoomAndPan", "SVGViewElement.SVG_ZOOMANDPAN_MAGNIFY"); |
| 15 shouldBe("currentView.viewBox.baseVal.x", "0"); | 15 shouldBe("currentView.viewBox.baseVal.x", "0"); |
| 16 shouldBe("currentView.viewBox.baseVal.y", "0"); | 16 shouldBe("currentView.viewBox.baseVal.y", "0"); |
| 17 shouldBe("currentView.viewBox.baseVal.width", "0"); | 17 shouldBe("currentView.viewBox.baseVal.width", "0"); |
| 18 shouldBe("currentView.viewBox.baseVal.height", "0"); | 18 shouldBe("currentView.viewBox.baseVal.height", "0"); |
| 19 shouldBe("currentView.preserveAspectRatio.baseVal.align", "SVGPreserveAspectRati
o.SVG_PRESERVEASPECTRATIO_XMIDYMID"); | 19 shouldBe("currentView.preserveAspectRatio.baseVal.align", "SVGPreserveAspectRati
o.SVG_PRESERVEASPECTRATIO_XMIDYMID"); |
| 20 shouldBe("currentView.preserveAspectRatio.baseVal.meetOrSlice", "SVGPreserveAspe
ctRatio.SVG_MEETORSLICE_MEET"); | 20 shouldBe("currentView.preserveAspectRatio.baseVal.meetOrSlice", "SVGPreserveAspe
ctRatio.SVG_MEETORSLICE_MEET"); |
| 21 shouldBeEqualToString("currentView.viewBoxString", "0 0 0 0"); | 21 shouldBeEqualToString("currentView.viewBoxString", "0 0 0 0"); |
| 22 shouldBeEqualToString("currentView.preserveAspectRatioString", "xMidYMid meet"); | 22 shouldBeEqualToString("currentView.preserveAspectRatioString", "xMidYMid meet"); |
| 23 shouldBeEqualToString("currentView.transformString", ""); | 23 shouldBeEqualToString("currentView.transformString", ""); |
| 24 shouldBeEqualToString("currentView.viewTargetString", ""); | 24 shouldBeEqualToString("currentView.viewTargetString", ""); |
| 25 shouldBe("currentView.zoomAndPan", "SVGZoomAndPan.SVG_ZOOMANDPAN_MAGNIFY"); | 25 shouldBe("currentView.zoomAndPan", "SVGViewElement.SVG_ZOOMANDPAN_MAGNIFY"); |
| 26 | 26 |
| 27 debug(""); | 27 debug(""); |
| 28 debug("Try changing zoomAndPan - none of these will work, as SVGViewSpec is full
y readonly - even the animated properties it inherits from parent classes like S
VGZoomAndPan/SVGFitToViewBox"); | 28 debug("Try changing zoomAndPan - none of these will work, as SVGViewSpec is full
y readonly - even the animated properties it inherits from supplmental classes l
ike SVGViewElement/SVGFitToViewBox"); |
| 29 shouldThrow("currentView.zoomAndPan = SVGZoomAndPan.SVG_ZOOMANDPAN_DISABLE"); | 29 shouldThrow("currentView.zoomAndPan = SVGViewElement.SVG_ZOOMANDPAN_DISABLE"); |
| 30 shouldBe("currentView.zoomAndPan", "SVGZoomAndPan.SVG_ZOOMANDPAN_MAGNIFY"); | 30 shouldBe("currentView.zoomAndPan", "SVGViewElement.SVG_ZOOMANDPAN_MAGNIFY"); |
| 31 | 31 |
| 32 debug(""); | 32 debug(""); |
| 33 debug("Try changing viewBox - this has no affect on the SVGSVGElement the viewSp
ec belongs to - it exposed all its properties as read-only"); | 33 debug("Try changing viewBox - this has no affect on the SVGSVGElement the viewSp
ec belongs to - it exposed all its properties as read-only"); |
| 34 shouldThrow("currentView.viewBox.baseVal.x = 10"); | 34 shouldThrow("currentView.viewBox.baseVal.x = 10"); |
| 35 shouldBe("currentView.viewBox.baseVal.x", "0"); | 35 shouldBe("currentView.viewBox.baseVal.x", "0"); |
| 36 shouldThrow("currentView.viewBox.baseVal.y = 20"); | 36 shouldThrow("currentView.viewBox.baseVal.y = 20"); |
| 37 shouldBe("currentView.viewBox.baseVal.y", "0"); | 37 shouldBe("currentView.viewBox.baseVal.y", "0"); |
| 38 shouldThrow("currentView.viewBox.baseVal.width = 50"); | 38 shouldThrow("currentView.viewBox.baseVal.width = 50"); |
| 39 shouldBe("currentView.viewBox.baseVal.width", "0"); | 39 shouldBe("currentView.viewBox.baseVal.width", "0"); |
| 40 shouldThrow("currentView.viewBox.baseVal.height = 100"); | 40 shouldThrow("currentView.viewBox.baseVal.height = 100"); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 debug("Try changing viewTargetString"); | 75 debug("Try changing viewTargetString"); |
| 76 shouldBeEqualToString("currentView.viewTargetString = '#test'", "#test"); | 76 shouldBeEqualToString("currentView.viewTargetString = '#test'", "#test"); |
| 77 shouldBeEqualToString("currentView.viewTargetString", ""); | 77 shouldBeEqualToString("currentView.viewTargetString", ""); |
| 78 | 78 |
| 79 debug(""); | 79 debug(""); |
| 80 debug("Try changing transform"); | 80 debug("Try changing transform"); |
| 81 shouldThrow("currentView.transform.clear()"); | 81 shouldThrow("currentView.transform.clear()"); |
| 82 shouldBe("currentView.transform.numberOfItems", "0"); | 82 shouldBe("currentView.transform.numberOfItems", "0"); |
| 83 | 83 |
| 84 successfullyParsed = true; | 84 successfullyParsed = true; |
| OLD | NEW |