bdash | f45c4e3 | 2007-01-24 03:44:47 +0000 | [diff] [blame] | 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()"> |
| 6 | <script> |
| 7 | |
| 8 | var logOffset = 40; |
| 9 | var logOffsetIncrement = 40 |
| 10 | function log(message) |
| 11 | { |
rwlbuis | 18a4a2f | 2007-07-10 09:21:47 +0000 | [diff] [blame] | 12 | var t = document.createElementNS("http://www.w3.org/2000/svg", "text"); |
bdash | f45c4e3 | 2007-01-24 03:44:47 +0000 | [diff] [blame] | 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); |
| 18 | } |
| 19 | |
| 20 | function 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 | |
| 29 | function createTitleElement(title) |
| 30 | { |
rwlbuis | 18a4a2f | 2007-07-10 09:21:47 +0000 | [diff] [blame] | 31 | var t = document.createElementNS("http://www.w3.org/2000/svg", 'title'); |
bdash | f45c4e3 | 2007-01-24 03:44:47 +0000 | [diff] [blame] | 32 | t.appendChild(document.createTextNode(title)); |
| 33 | return t; |
| 34 | } |
| 35 | |
| 36 | function test() |
| 37 | { |
fmalita@chromium.org | 4988a3e | 2012-08-01 23:05:16 +0000 | [diff] [blame] | 38 | if (window.testRunner) |
| 39 | testRunner.dumpAsText(); |
bdash | f45c4e3 | 2007-01-24 03:44:47 +0000 | [diff] [blame] | 40 | |
| 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> |