Bug 1941128 - Turn off network.dns.native_https_query on Mac again
[gecko.git] / dom / svg / test / test_valueAsString.xhtml
blobab22ae146cd67df80fb433aad6a18c46d07cc03b
1 <html xmlns="http://www.w3.org/1999/xhtml">
2 <!--
3 https://bugzilla.mozilla.org/show_bug.cgi?id=539697
4 -->
5 <head>
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" />
9 </head>
10 <body>
11 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=539697">Mozilla Bug 539697</a>
12 <p id="display"></p>
13 <div id="content">
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'/>
18 </svg>
20 </div>
21 <pre id="test">
22 <script class="testbody" type="text/javascript">
23 <![CDATA[
25 SimpleTest.waitForExplicitFinish();
27 function run() {
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");
35 try {
36 c.r.baseVal.valueAsString = "rubbish";
37 ok(false, "setting a length to rubbish should fail");
38 } catch (e) {
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");
47 try {
48 m.orientAngle.baseVal.valueAsString = "rubbish";
49 ok(false, "setting an angle to rubbish should fail");
50 } catch (e) {
51 is(e.name, "SyntaxError", "syntax error expected");
52 is(e.code, DOMException.SYNTAX_ERR, "syntax error expected");
55 SimpleTest.finish();
58 window.addEventListener("load", run);
60 ]]>
61 </script>
62 </pre>
63 </body>
64 </html>