4 <title>Test that the clip state persists across frame boundaries.
</title>
7 <canvas id='canvas1' width='
100' height='
100'
></canvas>
8 <canvas id='canvas2' width='
100' height='
100'
></canvas>
9 <canvas id='canvas3' width='
100' height='
100'
></canvas>
10 <canvas id='canvas4' width='
100' height='
100'
></canvas>
12 var canvas1
= document
.getElementById('canvas1');
13 var canvas2
= document
.getElementById('canvas2');
14 var canvas3
= document
.getElementById('canvas3');
15 var canvas4
= document
.getElementById('canvas4');
16 var ctx1
= canvas1
.getContext('2d');
17 var ctx2
= canvas2
.getContext('2d');
18 var ctx3
= canvas3
.getContext('2d');
19 var ctx4
= canvas4
.getContext('2d');
21 ctx1
.fillStyle
= 'green';
22 ctx1
.fillRect(0, 0, 100, 100);
28 ctx1
.fillStyle
= 'yellow';
29 ctx1
.fillRect(0, 0, 100, 100);
31 ctx2
.drawImage(canvas1
, 0, 0);
32 ctx2
.fillStyle
= 'green';
33 ctx2
.fillRect(0, 0, 50, 100);
35 ctx3
.drawImage(canvas1
, 0, 0);
37 // ctx4 transformed clip
38 ctx4
.fillStyle
= 'green';
39 ctx4
.fillRect(0, 0, 10, 100);
40 ctx4
.drawImage(canvas1
, 10, 0);