OLD | NEW |
| (Empty) |
1 description("Basic test for webkitLineDash and webkitLineDashOffset"); | |
2 | |
3 var canvas = document.createElement('canvas'); | |
4 document.body.appendChild(canvas); | |
5 canvas.setAttribute('width', '700'); | |
6 canvas.setAttribute('height', '700'); | |
7 var ctx = canvas.getContext('2d'); | |
8 | |
9 // Verify default values. | |
10 shouldBe('ctx.webkitLineDashOffset', '0'); | |
11 | |
12 // Set dash-style. | |
13 ctx.webkitLineDash = [15, 10]; | |
14 ctx.webkitLineDashOffset = 5; | |
15 ctx.strokeRect (10,10,100,100); | |
16 | |
17 // Verify dash and offset. | |
18 var lineDash; | |
19 lineDash = ctx.webkitLineDash; | |
20 shouldBe('lineDash[0]', '15'); | |
21 shouldBe('lineDash[1]', '10'); | |
22 shouldBe('ctx.webkitLineDashOffset', '5'); | |
23 | |
24 // Verify that line dash offset persists after | |
25 // clearRect (which causes a save/restore of the context | |
26 // state to the stack). | |
27 ctx.clearRect(0, 0, 700, 700); | |
28 shouldBe('ctx.webkitLineDashOffset', '5'); | |
OLD | NEW |