Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / canvas / canvas-hit-regions-fill-rule-test.html
blob093d8ed9877c3c983ffd52350c1cb2da00f9f7c6
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <title>Canvas Hit Regions: fillRule test</title>
5 <script src="../../resources/js-test.js"></script>
6 </head>
7 <body>
8 <canvas id="canvas" width="400" height="400">
9 </canvas>
10 <script src="./resources/canvas-hit-region-event.js"></script>
11 <script>
13 var canvas = document.getElementById("canvas");
14 var context = canvas.getContext("2d");
16 context.rect(20, 20, 60, 60);
17 context.rect(0, 0, 100, 100);
18 context.addHitRegion({
19 id : "nonzero"
20 // default fillRule
21 });
23 debug("default fillRule(nonzero):");
24 shouldBe("clickCanvas(1, 1)", "'nonzero'");
25 shouldBe("clickCanvas(99, 98)", "'nonzero'");
26 shouldBe("clickCanvas(21, 21)", "'nonzero'");
27 shouldBe("clickCanvas(50, 50)", "'nonzero'");
28 debug("");
30 context.removeHitRegion("nonzero");
32 context.addHitRegion({
33 id : "evenodd",
34 fillRule : "evenodd"
35 });
37 debug("fillRule = evenodd:");
38 shouldBe("clickCanvas(1, 1)", "'evenodd'");
39 shouldBe("clickCanvas(99, 98)", "'evenodd'");
40 shouldBe("clickCanvas(21, 21)", "null");
41 shouldBe("clickCanvas(50, 50)", "null");
42 debug("");
44 context.removeHitRegion("evenodd");
46 context.addHitRegion({
47 id : "nonzero",
48 fillRule : "nonzero"
49 });
51 debug("fillRule = nonzero:");
52 shouldBe("clickCanvas(1, 1)", "'nonzero'");
53 shouldBe("clickCanvas(99, 98)", "'nonzero'");
54 shouldBe("clickCanvas(21, 21)", "'nonzero'");
55 shouldBe("clickCanvas(50, 50)", "'nonzero'");
56 debug("");
58 context.removeHitRegion("nonzero");
60 shouldThrow('context.addHitRegion({id : "nonzero", fillRule : null });');
62 context.addHitRegion({
63 id : "nonzero",
64 fillRule : undefined
65 });
67 debug("fillRule = undefined, falls back to default (nonzero):");
68 shouldBe("clickCanvas(1, 1)", "'nonzero'");
69 shouldBe("clickCanvas(99, 98)", "'nonzero'");
70 shouldBe("clickCanvas(21, 21)", "'nonzero'");
71 shouldBe("clickCanvas(50, 50)", "'nonzero'");
72 debug("");
74 </script>
75 </body>
76 </html>