Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | 1 <script src="../../resources/testharness.js"></script> |
| 2 <html> | 2 <script src="../../resources/testharnessreport.js"></script> |
| 3 <head> | |
| 4 <script src="../../resources/js-test.js"></script> | |
| 5 </head> | |
| 6 <body> | 3 <body> |
| 7 <script src="script-tests/canvas-webkitLineDash.js"></script> | 4 |
| 5 <script> | |
| 6 test(function(t) { | |
| 7 | |
| 8 var canvas = document.createElement('canvas'); | |
| 9 document.body.appendChild(canvas); | |
| 10 canvas.width = canvas.height = 700; | |
| 11 var ctx = canvas.getContext('2d'); | |
| 12 | |
| 13 // Verify default values. | |
| 14 assert_equals(ctx.webkitLineDashOffset, undefined); | |
|
Justin Novosad
2017/02/15 20:02:28
webkit-prefixed stuff was removed from the IDL a w
zakerinasab
2017/02/16 17:32:07
Done.
| |
| 15 | |
| 16 // Set dash-style. | |
| 17 ctx.webkitLineDash = [15, 10]; | |
| 18 ctx.webkitLineDashOffset = 5; | |
| 19 ctx.strokeRect (10, 10, 100, 100); | |
| 20 | |
| 21 // Verify dash and offset. | |
| 22 var lineDash; | |
| 23 lineDash = ctx.webkitLineDash; | |
| 24 assert_equals(lineDash[0], 15); | |
| 25 assert_equals(lineDash[1], 10); | |
| 26 assert_equals(ctx.webkitLineDashOffset, 5); | |
| 27 | |
| 28 // Verify that line dash offset persists after | |
| 29 // clearRect (which causes a save/restore of the context | |
| 30 // state to the stack). | |
| 31 ctx.clearRect(0, 0, 700, 700); | |
| 32 assert_equals(ctx.webkitLineDashOffset, 5); | |
| 33 | |
| 34 }, "Basic test for webkitLineDash and webkitLineDashOffset."); | |
| 35 </script> | |
| 8 </body> | 36 </body> |
| 9 </html> | |
| OLD | NEW |