71 lines
3.6 KiB
Plaintext
71 lines
3.6 KiB
Plaintext
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 parent classes like SVGZoomAndPan/SVGFitToViewBox
|
|
PASS currentView.zoomAndPan = SVGViewElement.SVG_ZOOMANDPAN_DISABLE threw exception NoModificationAllowedError: The object can not be modified..
|
|
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: The object can not be modified..
|
|
PASS currentView.viewBox.baseVal.x is 0
|
|
PASS currentView.viewBox.baseVal.y = 20 threw exception NoModificationAllowedError: The object can not be modified..
|
|
PASS currentView.viewBox.baseVal.y is 0
|
|
PASS currentView.viewBox.baseVal.width = 50 threw exception NoModificationAllowedError: The object can not be modified..
|
|
PASS currentView.viewBox.baseVal.width is 0
|
|
PASS currentView.viewBox.baseVal.height = 100 threw exception NoModificationAllowedError: The object can not be modified..
|
|
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: The object can not be modified..
|
|
PASS currentView.preserveAspectRatio.baseVal.align is SVGPreserveAspectRatio.SVG_PRESERVEASPECTRATIO_XMIDYMID
|
|
PASS currentView.preserveAspectRatio.baseVal.meetOrSlice = SVGPreserveAspectRatio.SVG_MEETORSLICE_SLICE threw exception NoModificationAllowedError: The object can not be modified..
|
|
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: The object can not be modified..
|
|
PASS currentView.transform.numberOfItems is 0
|
|
PASS successfullyParsed is true
|
|
|
|
TEST COMPLETE
|
|
|