blob: 97b38cf11b504a19b3a174b738e6d018627e4d05 [file] [log] [blame]
bdashf45c4e32007-01-24 03:44:47 +00001<?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()">
6<script>
7
8var logOffset = 40;
9var logOffsetIncrement = 40
10function log(message)
11{
rwlbuis18a4a2f2007-07-10 09:21:47 +000012 var t = document.createElementNS("http://www.w3.org/2000/svg", "text");
bdashf45c4e32007-01-24 03:44:47 +000013 t.appendChild(document.createTextNode(message));
14 t.setAttribute('y', logOffset);
15 t.setAttribute('x', 0);
16 logOffset += logOffsetIncrement;
17 document.getElementById("console").appendChild(t);
18}
19
20function expect(expected, actual)
21{
22 var msg = "Expected " + expected + ", got " + actual + ": ";
23 if (expected == actual)
24 log(msg + "PASS");
25 else
26 log(msg + "FAIL");
27}
28
29function createTitleElement(title)
30{
rwlbuis18a4a2f2007-07-10 09:21:47 +000031 var t = document.createElementNS("http://www.w3.org/2000/svg", 'title');
bdashf45c4e32007-01-24 03:44:47 +000032 t.appendChild(document.createTextNode(title));
33 return t;
34}
35
36function test()
37{
fmalita@chromium.org4988a3e2012-08-01 23:05:16 +000038 if (window.testRunner)
39 testRunner.dumpAsText();
bdashf45c4e32007-01-24 03:44:47 +000040
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}
47</script>
48<g id="console">
49</g>
50</svg>