3 <script src=
"../src/polyfills/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.setLineDash([
10,
10]);
30 ctx.strokeStyle = 'red';
40 // An unrelated canvas should not be aware of the pattern.
46 // ctx.uninstallPattern();
49 // Now that we've uninstalled the pattern, should be normal again.
50 ctx.strokeStyle = 'blue';