| 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 shouldThrow('context.addHitRegion({id : "nonzero", fillRule : null });'); | 80 context.addHitRegion({ |
| 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"); |
| 81 | 93 |
| 82 context.addHitRegion({ | 94 context.addHitRegion({ |
| 83 id : "nonzero", | 95 id : "nonzero", |
| 84 fillRule : undefined | 96 fillRule : undefined |
| 85 }); | 97 }); |
| 86 | 98 |
| 87 debug("fillRule = undefined, falls back to default (nonzero):"); | 99 debug("fillRule = undefined, falls back to default (nonzero):"); |
| 88 shouldBe("clickCanvas(1, 1)", "'nonzero'"); | 100 shouldBe("clickCanvas(1, 1)", "'nonzero'"); |
| 89 shouldBe("clickCanvas(99, 98)", "'nonzero'"); | 101 shouldBe("clickCanvas(99, 98)", "'nonzero'"); |
| 90 shouldBe("clickCanvas(21, 21)", "'nonzero'"); | 102 shouldBe("clickCanvas(21, 21)", "'nonzero'"); |
| 91 shouldBe("clickCanvas(50, 50)", "'nonzero'"); | 103 shouldBe("clickCanvas(50, 50)", "'nonzero'"); |
| 92 debug(""); | 104 debug(""); |
| 93 | 105 |
| 94 </script> | 106 </script> |
| 95 </body> | 107 </body> |
| 96 </html> | 108 </html> |
| OLD | NEW |