blob: cfba67c8fd30d2b1a3d491f5c9edc4b211871507 [file] [log] [blame]
Test SVGGeometryElement APIs for polygon.
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 500
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(250).x is within 0.1 of 160
PASS p1.getPointAtLength(250).y is within 0.1 of 110
PASS p1.getPointAtLength(400).x is within 0.1 of 10
PASS p1.getPointAtLength(400).y is within 0.1 of 110
PASS p1.getPointAtLength(500).x is within 0.1 of 10
PASS p1.getPointAtLength(500).y is within 0.1 of 10
PASS successfullyParsed is true
TEST COMPLETE