3 <p>You should see solid black and blue lines with a dashed red line in between
5 <canvas id=cnv width=
640 height=
480></canvas>
7 <p>You should see a solid black line:
</p>
8 <canvas id=cnv2 width=
640 height=
100></canvas>
10 <script type=
"text/javascript">
11 ctx = document.getElementById(
"cnv").getContext(
"2d");
12 ctx2 = document.getElementById(
"cnv2").getContext(
"2d");
14 // Draw a line segment -- should be perfectly normal.
24 // Draw a dashed line segment.
25 // ctx.installPattern([
10,
10]);
26 ctx.setLineDash([
10,
10]);
27 ctx.strokeStyle = 'red';
37 // An unrelated canvas should not be aware of the pattern.
43 // ctx.uninstallPattern();
46 // Now that we've uninstalled the pattern, should be normal again.
47 ctx.strokeStyle = 'blue';