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