blob: da73070948c08ae51ea8b357fff16c3aa9716ca1 [file] [log] [blame]
This test checks the SVGViewSpec API
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
Check initial SVGSVGElement.currentView values on a SVGSVGElement
PASS currentView.transform.numberOfItems is 0
PASS currentView.viewTarget is null
PASS currentView.zoomAndPan is SVGViewElement.SVG_ZOOMANDPAN_MAGNIFY
PASS currentView.viewBox.baseVal.x is 0
PASS currentView.viewBox.baseVal.y is 0
PASS currentView.viewBox.baseVal.width is 0
PASS currentView.viewBox.baseVal.height is 0
PASS currentView.preserveAspectRatio.baseVal.align is SVGPreserveAspectRatio.SVG_PRESERVEASPECTRATIO_XMIDYMID
PASS currentView.preserveAspectRatio.baseVal.meetOrSlice is SVGPreserveAspectRatio.SVG_MEETORSLICE_MEET
PASS currentView.viewBoxString is "0 0 0 0"
PASS currentView.preserveAspectRatioString is "xMidYMid meet"
PASS currentView.transformString is ""
PASS currentView.viewTargetString is ""
PASS currentView.zoomAndPan is SVGViewElement.SVG_ZOOMANDPAN_MAGNIFY
Try changing zoomAndPan - none of these will work, as SVGViewSpec is fully readonly - even the animated properties it inherits from supplmental classes like SVGViewElement/SVGFitToViewBox
PASS currentView.zoomAndPan = SVGViewElement.SVG_ZOOMANDPAN_DISABLE threw exception NoModificationAllowedError: An attempt was made to modify an object where modifications are not allowed..
PASS currentView.zoomAndPan is SVGViewElement.SVG_ZOOMANDPAN_MAGNIFY
Try changing viewBox - this has no affect on the SVGSVGElement the viewSpec belongs to - it exposed all its properties as read-only
PASS currentView.viewBox.baseVal.x = 10 threw exception NoModificationAllowedError: Failed to set the 'x' property on 'SVGRect': The attribute is read-only..
PASS currentView.viewBox.baseVal.x is 0
PASS currentView.viewBox.baseVal.y = 20 threw exception NoModificationAllowedError: Failed to set the 'y' property on 'SVGRect': The attribute is read-only..
PASS currentView.viewBox.baseVal.y is 0
PASS currentView.viewBox.baseVal.width = 50 threw exception NoModificationAllowedError: Failed to set the 'width' property on 'SVGRect': The attribute is read-only..
PASS currentView.viewBox.baseVal.width is 0
PASS currentView.viewBox.baseVal.height = 100 threw exception NoModificationAllowedError: Failed to set the 'height' property on 'SVGRect': The attribute is read-only..
PASS currentView.viewBox.baseVal.height is 0
PASS currentView.viewBoxString is "0 0 0 0"
Try changing viewBoxString
PASS currentView.viewBoxString = '1 2 3 4' is "1 2 3 4"
PASS currentView.viewBoxString is "0 0 0 0"
Try changing preserveAspectRatio
PASS currentView.preserveAspectRatio.baseVal.align = SVGPreserveAspectRatio.SVG_PRESERVEASPECTRATIO_XMINYMIN threw exception NoModificationAllowedError: Failed to set the 'align' property on 'SVGPreserveAspectRatio': The attribute is read-only..
PASS currentView.preserveAspectRatio.baseVal.align is SVGPreserveAspectRatio.SVG_PRESERVEASPECTRATIO_XMIDYMID
PASS currentView.preserveAspectRatio.baseVal.meetOrSlice = SVGPreserveAspectRatio.SVG_MEETORSLICE_SLICE threw exception NoModificationAllowedError: Failed to set the 'meetOrSlice' property on 'SVGPreserveAspectRatio': The attribute is read-only..
PASS currentView.preserveAspectRatio.baseVal.meetOrSlice is SVGPreserveAspectRatio.SVG_MEETORSLICE_MEET
Try changing preserveAspectRatioString
PASS currentView.preserveAspectRatioString = 'xMinYMin slice' is "xMinYMin slice"
PASS currentView.preserveAspectRatioString is "xMidYMid meet"
Try changing transformString
PASS currentView.transformString = 'rotate(90)' is "rotate(90)"
PASS currentView.transformString is ""
Try changing viewTarget
PASS currentView.viewTarget = svgElement is svgElement
PASS currentView.viewTarget is null
Try changing viewTargetString
PASS currentView.viewTargetString = '#test' is "#test"
PASS currentView.viewTargetString is ""
Try changing transform
PASS currentView.transform.clear() threw exception NoModificationAllowedError: An attempt was made to modify an object where modifications are not allowed..
PASS currentView.transform.numberOfItems is 0
PASS successfullyParsed is true
TEST COMPLETE