| OLD | NEW |
| (Empty) | |
| 1 <!DOCTYPE HTML> |
| 2 <script src="../../resources/testharness.js"></script> |
| 3 <script src="../../resources/testharnessreport.js"></script> |
| 4 <script> |
| 5 test(function() { |
| 6 var offscreenCanvas = new OffscreenCanvas(100, 50); |
| 7 var ctx = offscreenCanvas.getContext('2d'); |
| 8 |
| 9 ctx.rect(0, 0, 20, 20); |
| 10 assert_true(ctx.isPointInPath(10, 10)); |
| 11 assert_false(ctx.isPointInPath(30, 10)); |
| 12 |
| 13 var path = new Path2D(); |
| 14 path.rect(20, 20, 100, 100); |
| 15 assert_true(ctx.isPointInPath(path, 20, 20)); |
| 16 assert_false(ctx.isPointInPath(path, 130, 20)); |
| 17 }, 'Test the behavior of isPointInPath APIs for OffscreenCanvas'); |
| 18 |
| 19 |
| 20 test(function() { |
| 21 var offscreenCanvas = new OffscreenCanvas(100, 50); |
| 22 var ctx = offscreenCanvas.getContext('2d'); |
| 23 |
| 24 ctx.strokeStyle = '#0f0'; |
| 25 ctx.beginPath(); |
| 26 ctx.rect(0, 0, 20, 20); |
| 27 assert_true(ctx.isPointInStroke(0, 0)); |
| 28 assert_false(ctx.isPointInStroke(30, 10)); |
| 29 |
| 30 var path = new Path2D(); |
| 31 path.rect(20, 20, 100, 100); |
| 32 assert_true(ctx.isPointInStroke(path, 20, 20)); |
| 33 assert_true(ctx.isPointInStroke(path, 120, 20)); |
| 34 }, 'Test the behavior of isPointInStroke APIs for OffscreenCanvas'); |
| 35 </script> |
| OLD | NEW |