1 <html xmlns=
"http://www.w3.org/1999/xhtml">
3 https://bugzilla.mozilla.org/show_bug.cgi?id=539697
6 <title>Test valueAsString behavior
</title>
7 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
8 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css" />
11 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=539697">Mozilla Bug
539697</a>
15 <svg xmlns=
"http://www.w3.org/2000/svg" width=
"100%" height=
"1" id=
"svg">
16 <circle id='c' r='
1em' display='none'
/>
17 <marker id='m' orient='
20rad' display='none'
/>
22 <script class=
"testbody" type=
"text/javascript">
25 SimpleTest.waitForExplicitFinish();
28 var c = document.getElementById(
"c");
29 var m = document.getElementById(
"m");
31 is(SVGLength.SVG_LENGTHTYPE_EMS, c.r.baseVal.unitType,
"unexpected units");
32 c.r.baseVal.valueAsString =
"2px";
33 is(SVGLength.SVG_LENGTHTYPE_PX, c.r.baseVal.unitType,
"unexpected units");
36 c.r.baseVal.valueAsString =
"rubbish";
37 ok(false,
"setting a length to rubbish should fail");
39 is(e.name,
"SyntaxError",
"syntax error expected");
40 is(e.code, DOMException.SYNTAX_ERR,
"syntax error expected");
43 is(SVGAngle.SVG_ANGLETYPE_RAD, m.orientAngle.baseVal.unitType,
"unexpected units");
44 m.orientAngle.baseVal.valueAsString =
"2grad";
45 is(SVGAngle.SVG_ANGLETYPE_GRAD, m.orientAngle.baseVal.unitType,
"unexpected units");
48 m.orientAngle.baseVal.valueAsString =
"rubbish";
49 ok(false,
"setting an angle to rubbish should fail");
51 is(e.name,
"SyntaxError",
"syntax error expected");
52 is(e.code, DOMException.SYNTAX_ERR,
"syntax error expected");
58 window.addEventListener(
"load", run);