blob: 641829a68f686038dc0391623bbfd768fd75b7a6 [file] [log] [blame]
This is a test of the 'length' attribute and the indexed property access of the SVGPathSegList interface.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
Test list length/numberOfItems
PASS path1.pathSegList.length is 3
PASS path1.pathSegList.numberOfItems is 3
PASS path2.pathSegList.length is 5
PASS path2.pathSegList.numberOfItems is 5
Test item getter
PASS path1.pathSegList[0].toString() is "[object SVGPathSegMovetoAbs]"
PASS path1.pathSegList[0].x is 0
PASS path1.pathSegList[0].y is 0
PASS path1.pathSegList[1].toString() is "[object SVGPathSegLinetoAbs]"
PASS path1.pathSegList[1].x is 100
PASS path1.pathSegList[1].y is 0
PASS path1.pathSegList[2].toString() is "[object SVGPathSegLinetoAbs]"
PASS path1.pathSegList[2].x is 100
PASS path1.pathSegList[2].y is 100
PASS path1.pathSegList[3] is undefined.
PASS path2.pathSegList[0].toString() is "[object SVGPathSegMovetoAbs]"
PASS path2.pathSegList[0].x is 0
PASS path2.pathSegList[0].y is 0
PASS path2.pathSegList[1].toString() is "[object SVGPathSegLinetoAbs]"
PASS path2.pathSegList[1].x is 50
PASS path2.pathSegList[1].y is 100
PASS path2.pathSegList[2].toString() is "[object SVGPathSegLinetoHorizontalRel]"
PASS path2.pathSegList[2].x is 100
PASS path2.pathSegList[3].toString() is "[object SVGPathSegLinetoHorizontalRel]"
PASS path2.pathSegList[3].x is 100
PASS path2.pathSegList[4].toString() is "[object SVGPathSegLinetoVerticalRel]"
PASS path2.pathSegList[4].y is 100
PASS path2.pathSegList[5] is undefined.
Test item setter
PASS path1.pathSegList[2] = pathSeg1 is pathSeg1
PASS path1.pathSegList[2].toString() is "[object SVGPathSegLinetoAbs]"
PASS path1.pathSegList[2].x is 50
PASS path1.pathSegList[2].y is 50
PASS path1.pathSegList[2] = 0 threw exception TypeError: Type error.
PASS path1.pathSegList[2] = 'aString' threw exception TypeError: Type error.
PASS path1.pathSegList[2] = null threw exception TypeError: Type error.
PASS path2.pathSegList[4] = pathSeg2 is pathSeg2
PASS path2.pathSegList[4].toString() is "[object SVGPathSegLinetoVerticalAbs]"
PASS path2.pathSegList[4].y is 50
PASS path2.pathSegList[4] = 0 threw exception TypeError: Type error.
PASS path2.pathSegList[4] = 'aString' threw exception TypeError: Type error.
PASS path2.pathSegList[4] = null threw exception TypeError: Type error.
PASS successfullyParsed is true
TEST COMPLETE