| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"> |
| <html> |
| <head> |
| <title>Bugzilla</title> |
| </head> |
| <body> |
| |
| <div id="foodiv"><!foo id="foo"></!foo></div> |
| <div id="doctypediv"><!doctype id="doctype"></!doctype></div> |
| |
| <script> |
| if (window.testRunner) |
| testRunner.dumpAsText(); |
| |
| var fooDiv = document.getElementById("foodiv"); |
| var doctypeDiv = document.getElementById("doctypediv"); |
| var fooList = document.getElementsByName("!foo"); |
| var doctypeList = document.getElementsByName("!doctype"); |
| var foo = document.getElementById("foo"); |
| var doctype = document.getElementById("doctype"); |
| |
| document.open(); |
| document.writeln("<p>!foo elements count: " + fooList.length + "</p>"); |
| document.writeln("<p>!doctype elements count: " + doctypeList.length + "</p>"); |
| document.writeln("<p>!foo with id \"foo\": " + foo + "</p>"); |
| document.writeln("<p>!doctype with id \"doctype\": " + doctype + "</p>"); |
| document.writeln("<p>!foo div child count: " + fooDiv.childNodes.length + "</p>"); |
| var node = fooDiv.firstChild; |
| var count = 0; |
| while(node) { |
| document.writeln("<p>child " + ++count + " -- nodeName: " + node.nodeName + " nodeValue: " + node.nodeValue + "</p>"); |
| node = node.nextSibling; |
| } |
| document.writeln("<p>!doctype div child count: " + doctypeDiv.childNodes.length + "</p>"); |
| node = doctypeDiv.firstChild; |
| count = 0; |
| while(node) { |
| document.writeln("<p>child " + ++count + " -- nodeName: " + node.nodeName + " nodeValue: " + node.nodeValue + "</p>"); |
| node = node.nextSibling; |
| } |
| document.close(); |
| |
| </script> |
| </body> |
| </html> |
| |