blob: c9d70dec80d656255e9b68d9f8abd6801710b0ff [file] [log] [blame]
Test SVGGeometryElement APIs for polyline.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
Test isPointInFill()
PASS p1.isPointInFill({}) is false
PASS p1.isPointInFill({x: 9, y: 9}) is false
PASS p1.isPointInFill({x: 10, y: 10}) is true
PASS p1.isPointInFill({x: 159, y: 9}) is false
PASS p1.isPointInFill({x: 160, y: 10}) is true
PASS p1.isPointInFill({x: 161, y: 110}) is false
PASS p1.isPointInFill({x: 160, y: 109}) is true
PASS p1.isPointInFill({x: 9, y: 109}) is false
PASS p1.isPointInFill({x: 10, y: 110}) is true
Test isPointInStroke()
PASS p1.isPointInStroke({x: 20, y: 20}) is true
PASS p1.isPointInStroke({x: 21, y: 21}) is false
PASS p1.isPointInStroke({x: 150, y: 20}) is true
PASS p1.isPointInStroke({x: 149, y: 21}) is false
PASS p1.isPointInStroke({x: 150, y: 100}) is true
PASS p1.isPointInStroke({x: 149, y: 99}) is false
PASS p1.isPointInStroke({x: 20, y: 100}) is true
PASS p1.isPointInStroke({x: 21, y: 99}) is false
Test getTotalLength()
PASS p1.getTotalLength() is within 1 of 400
Test getPointAtLength()
PASS p1.getPointAtLength(0).x is within 0.1 of 10
PASS p1.getPointAtLength(0).y is within 0.1 of 10
PASS p1.getPointAtLength(150).x is within 0.1 of 160
PASS p1.getPointAtLength(150).y is within 0.1 of 10
PASS p1.getPointAtLength(200).x is within 0.1 of 160
PASS p1.getPointAtLength(200).y is within 0.1 of 60
PASS p1.getPointAtLength(300).x is within 0.1 of 110
PASS p1.getPointAtLength(300).y is within 0.1 of 110
PASS p1.getPointAtLength(450).x is within 0.1 of 10
PASS p1.getPointAtLength(450).y is within 0.1 of 110
PASS successfullyParsed is true
TEST COMPLETE