| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <script src="../../resources/js-test.js"></script> | 2 <title>Test that the fill and stroke style attributes yield opaque black when se
t to 'currentcolor' on an OffscreenCanvasRenderingContext2D.</title> |
| 3 <script src="../../resources/testharness.js"></script> |
| 4 <script src="../../resources/testharnessreport.js"></script> |
| 3 <script> | 5 <script> |
| 4 description("Test that the fill and stroke style attribute yield opaque black wh
en set to 'currentcolor' on an OffscreenCanvasRenderingContext2D"); | 6 test(function() { |
| 7 var aCanvas = new OffscreenCanvas(50, 50); |
| 8 var ctx = aCanvas.getContext('2d'); |
| 9 ctx.fillStyle = 'red'; |
| 10 ctx.fillStyle = 'currentcolor' |
| 11 assert_equals(ctx.fillStyle, '#000000'); |
| 5 | 12 |
| 6 // Tests onstructor of OffscreenCanvas and length/width change | 13 ctx.strokeStyle = 'red'; |
| 7 var aCanvas = new OffscreenCanvas(50, 50); | 14 ctx.strokeStyle = 'currentcolor' |
| 8 var ctx = aCanvas.getContext('2d'); | 15 assert_equals(ctx.strokeStyle, '#000000'); |
| 9 ctx.fillStyle = 'red'; | 16 }); |
| 10 ctx.fillStyle = 'currentcolor' | |
| 11 shouldBe("ctx.fillStyle", "'#000000'"); | |
| 12 | |
| 13 ctx.strokeStyle = 'red'; | |
| 14 ctx.strokeStyle = 'currentcolor' | |
| 15 shouldBe("ctx.strokeStyle", "'#000000'"); | |
| 16 | |
| 17 </script> | 17 </script> |
| OLD | NEW |