2 <title>Canvas test:
2d.shadow.attributes.shadowOffset
.2</title>
3 <script src=
"/MochiKit/MochiKit.js"></script>
4 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
5 <link rel=
"stylesheet" href=
"/tests/SimpleTest/test.css">
7 <canvas id=
"c" width=
"100" height=
"50"><p class=
"fallback">FAIL (fallback content)
</p></canvas>
10 SimpleTest
.waitForExplicitFinish();
11 MochiKit
.DOM
.addLoadEvent(function () {
13 var canvas
= document
.getElementById('c');
14 var ctx
= canvas
.getContext('2d');
16 var _thrown
= undefined; try {
17 ctx
.shadowOffsetX
= Infinity
;
18 } catch (e
) { _thrown
= e
}; todo(_thrown
&& _thrown
.code
== DOMException
.NOT_SUPPORTED_ERR
, "should throw NOT_SUPPORTED_ERR");
19 var _thrown
= undefined; try {
20 ctx
.shadowOffsetX
= -Infinity
;
21 } catch (e
) { _thrown
= e
}; todo(_thrown
&& _thrown
.code
== DOMException
.NOT_SUPPORTED_ERR
, "should throw NOT_SUPPORTED_ERR");
22 var _thrown
= undefined; try {
23 ctx
.shadowOffsetX
= NaN
;
24 } catch (e
) { _thrown
= e
}; todo(_thrown
&& _thrown
.code
== DOMException
.NOT_SUPPORTED_ERR
, "should throw NOT_SUPPORTED_ERR");
25 var _thrown
= undefined; try {
26 ctx
.shadowOffsetY
= Infinity
;
27 } catch (e
) { _thrown
= e
}; todo(_thrown
&& _thrown
.code
== DOMException
.NOT_SUPPORTED_ERR
, "should throw NOT_SUPPORTED_ERR");
28 var _thrown
= undefined; try {
29 ctx
.shadowOffsetY
= -Infinity
;
30 } catch (e
) { _thrown
= e
}; todo(_thrown
&& _thrown
.code
== DOMException
.NOT_SUPPORTED_ERR
, "should throw NOT_SUPPORTED_ERR");
31 var _thrown
= undefined; try {
32 ctx
.shadowOffsetY
= NaN
;
33 } catch (e
) { _thrown
= e
}; todo(_thrown
&& _thrown
.code
== DOMException
.NOT_SUPPORTED_ERR
, "should throw NOT_SUPPORTED_ERR");