1 <?xml version=
"1.0" standalone=
"no"?>
2 <!DOCTYPE svg PUBLIC
"-//W3C//DTD SVG 1.1//EN"
3 "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4 <svg width=
"400" height=
"300" viewBox=
"0 0 600 500"
5 xmlns=
"http://www.w3.org/2000/svg" version=
"1.1" onload=
"test()">
9 var logOffsetIncrement =
40
12 var t = document.createElementNS(
"http://www.w3.org/2000/svg",
"text");
13 t.appendChild(document.createTextNode(message));
14 t.setAttribute('y', logOffset);
15 t.setAttribute('x',
0);
16 logOffset += logOffsetIncrement;
17 document.getElementById(
"console").appendChild(t);
20 function expect(expected, actual)
22 var msg =
"Expected " + expected +
", got " + actual +
": ";
23 if (expected == actual)
29 function createTitleElement(title)
31 var t = document.createElementNS(
"http://www.w3.org/2000/svg", 'title');
32 t.appendChild(document.createTextNode(title));
38 if (window.testRunner)
39 testRunner.dumpAsText();
41 expect('', document.title);
42 document.documentElement.appendChild(createTitleElement('First title'));
43 expect('First title', document.title);
44 document.documentElement.appendChild(createTitleElement('Second title'));
45 expect('First title', document.title);
46 document.documentElement.removeChild(document.getElementsByTagName('title')[
0]);
47 expect('Second title', document.title);