1 <html xmlns=
"http://www.w3.org/1999/xhtml">
3 https://bugzilla.mozilla.org/show_bug.cgi?id=630760
6 <title>Tests specific to SVGLengthList
</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=515116">Mozilla Bug
630760</a>
13 <div id=
"content" style=
"display:none;">
14 <svg id=
"svg" xmlns=
"http://www.w3.org/2000/svg" width=
"100" height=
"100">
16 <set attributeName=
"x" to=
"10 20 30 40" begin=
"0" dur=
"indefinite"/>
21 <script class=
"testbody" type=
"text/javascript">
24 SimpleTest.waitForExplicitFinish();
26 function run_tests() {
27 var svg = document.getElementById(
"svg");
28 svg.pauseAnimations();
30 // Check that the animVal list for 'x' on
<text> gives the correct number of
31 // items when examined for the FIRST time DURING animation:
33 var text = document.getElementById(
"text");
34 var list = text.x.animVal;
36 is(list.numberOfItems,
4,
"Checking numberOfItems");
38 // Check that items at an index larger than
255 (max value for PRUint8) are
39 // returning the correct values:
42 list = text.x.baseVal;
43 for (var i =
0; i <
256; ++i) {
44 item = svg.createSVGLength();
46 list.appendItem(item);
48 item = svg.createSVGLength();
50 list.appendItem(item);
52 is(list.getItem(
0).value,
1,
"Check value of first item");
53 is(list.getItem(
256).value,
2,
"Check value of item at index > 255");
58 window.addEventListener(
"load", run_tests);