3 <script src=
"../dashed-canvas.js"></script>
6 <p>You should see solid black and blue lines with a dashed red line in between
8 <canvas id=cnv width=
640 height=
480></canvas>
10 <p>You should see a solid black line:
</p>
11 <canvas id=cnv2 width=
640 height=
100></canvas>
13 <script type=
"text/javascript">
14 ctx = document.getElementById(
"cnv").getContext(
"2d");
15 ctx2 = document.getElementById(
"cnv2").getContext(
"2d");
17 // Draw a line segment -- should be perfectly normal.
27 // Draw a dashed line segment.
28 ctx.installPattern([
10,
10]);
29 ctx.strokeStyle = 'red';
39 // An unrelated canvas should not be aware of the pattern.
45 ctx.uninstallPattern();
47 // Now that we've uninstalled the pattern, should be normal again.
48 ctx.strokeStyle = 'blue';