2 <?xml-stylesheet href=
"chrome://global/skin/" type=
"text/css"?>
3 <window id=
"test-canvas" title=
"Canvas in XUL test"
4 xmlns=
"http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
5 xmlns:
html=
"http://www.w3.org/1999/xhtml" onload=
"workWithCanvas();">
6 <script type=
"text/javascript">
7 function workWithCanvas()
9 var c = document.getElementById(
"canvas");
10 var ctx = c.getContext(
"2d");
11 ctx.fillStyle =
"#ff0000";
12 ctx.fillRect(
0,
0,
100,
100);
15 <html:canvas id=
"canvas" width=
"100" height=
"100"
16 style=
"width: 100px; height: 100px; max-height: 100px; max-width: 100px;"/>