| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <title>Canvas Hit Regions: fillRule test</title> | 4 <title>Canvas Hit Regions: fillRule test</title> |
| 5 <script src="../../resources/js-test.js"></script> | 5 <script src="../../resources/js-test.js"></script> |
| 6 </head> | 6 </head> |
| 7 <body> | 7 <body> |
| 8 <canvas id="canvas" width="400" height="400"> | 8 <canvas id="canvas" width="400" height="400"> |
| 9 </canvas> | 9 </canvas> |
| 10 <script> | 10 <script> |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 | 70 |
| 71 debug("fillRule = nonzero:"); | 71 debug("fillRule = nonzero:"); |
| 72 shouldBe("clickCanvas(1, 1)", "'nonzero'"); | 72 shouldBe("clickCanvas(1, 1)", "'nonzero'"); |
| 73 shouldBe("clickCanvas(99, 98)", "'nonzero'"); | 73 shouldBe("clickCanvas(99, 98)", "'nonzero'"); |
| 74 shouldBe("clickCanvas(21, 21)", "'nonzero'"); | 74 shouldBe("clickCanvas(21, 21)", "'nonzero'"); |
| 75 shouldBe("clickCanvas(50, 50)", "'nonzero'"); | 75 shouldBe("clickCanvas(50, 50)", "'nonzero'"); |
| 76 debug(""); | 76 debug(""); |
| 77 | 77 |
| 78 context.removeHitRegion("nonzero"); | 78 context.removeHitRegion("nonzero"); |
| 79 | 79 |
| 80 context.addHitRegion({ | 80 shouldThrow('context.addHitRegion({id : "nonzero", fillRule : null });'); |
| 81 id : "nonzero", | |
| 82 fillRule : null | |
| 83 }); | |
| 84 | |
| 85 debug("fillRule = null, falls back to default (nonzero):"); | |
| 86 shouldBe("clickCanvas(1, 1)", "'nonzero'"); | |
| 87 shouldBe("clickCanvas(99, 98)", "'nonzero'"); | |
| 88 shouldBe("clickCanvas(21, 21)", "'nonzero'"); | |
| 89 shouldBe("clickCanvas(50, 50)", "'nonzero'"); | |
| 90 debug(""); | |
| 91 | |
| 92 context.removeHitRegion("nonzero"); | |
| 93 | 81 |
| 94 context.addHitRegion({ | 82 context.addHitRegion({ |
| 95 id : "nonzero", | 83 id : "nonzero", |
| 96 fillRule : undefined | 84 fillRule : undefined |
| 97 }); | 85 }); |
| 98 | 86 |
| 99 debug("fillRule = undefined, falls back to default (nonzero):"); | 87 debug("fillRule = undefined, falls back to default (nonzero):"); |
| 100 shouldBe("clickCanvas(1, 1)", "'nonzero'"); | 88 shouldBe("clickCanvas(1, 1)", "'nonzero'"); |
| 101 shouldBe("clickCanvas(99, 98)", "'nonzero'"); | 89 shouldBe("clickCanvas(99, 98)", "'nonzero'"); |
| 102 shouldBe("clickCanvas(21, 21)", "'nonzero'"); | 90 shouldBe("clickCanvas(21, 21)", "'nonzero'"); |
| 103 shouldBe("clickCanvas(50, 50)", "'nonzero'"); | 91 shouldBe("clickCanvas(50, 50)", "'nonzero'"); |
| 104 debug(""); | 92 debug(""); |
| 105 | 93 |
| 106 </script> | 94 </script> |
| 107 </body> | 95 </body> |
| 108 </html> | 96 </html> |
| OLD | NEW |