2008-11-04 Anders Carlsson <andersca@apple.com>
[webkit/qt.git] / LayoutTests / fast / dom / attribute-namespaces.xhtml
blobec7efc98b4c1df23174cad4651cffe5af44e7d6f
1 <?xml version="1.0"?>
2 <html xmlns="http://www.w3.org/1999/xhtml">
3 <script type="text/javascript">
4 function debug(str) {
5 t = document.getElementById('console').firstChild;
7 t.data += str + "\n";
10 function runTests() {
11 if (window.layoutTestController) {
12 layoutTestController.dumpAsText();
15 t = document.getElementById('test');
16 attr = t.getAttributeNodeNS('http://www.example.org/', 'attr');
17 errs = false;
19 if (!attr) {
20 debug('Could not find attribute ');
21 return;
24 if (attr.nodeName != 'test:attr') {
25 debug('attr.nodeName is ' + attr.nodeName + ', expected test:attr');
26 errs = true;
29 if (attr.namespaceURI != 'http://www.example.org/') {
30 debug('attr.namespaceURI is ' + attr.namespaceURI + ', expected http://www.example.org');
31 errs = true;
34 if (attr.prefix != 'test') {
35 debug('attr.prefix is ' + attr.prefix + ', expected test');
36 errs = true;
39 if (attr.localName != 'attr') {
40 debug('attr.localName is ' + attr.localName + ', expected attr');
41 errs = true;
44 if (!errs)
45 debug('All tests succeeded!');
48 </script>
49 <body onload="runTests();">
50 <div>
51 This tests that attributes will have the correct namespace, prefix and local name set.
52 </div>
53 <div id="test" xmlns:test="http://www.example.org/" test:attr="Attribute"></div>
54 <pre id="console">
55 </pre>
56 </body>
57 </html>