| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
| <html xmlns="http://www.w3.org/1999/xhtml"> | |
| <head> | |
| <script type="text/javascript" src="../security/resources/cross-frame-access.js"></script> | |
| </head> | |
| <body> | |
| <pre id="console"></pre> | |
| <script type="text/javascript" id="scriptTag"> | |
| if (window.testRunner) | |
| testRunner.dumpAsText(); | |
| log("This test was written to address rdar://problem/4976879. And tests how namespaceURI's are assigned."); | |
| log(""); | |
| log("Test1: document.namespaceURI") | |
| shouldBe("document.namespaceURI", "null"); | |
| log(""); | |
| log("Test2: document.createElement().namespaceURI") | |
| shouldBe("document.createElement(\"div\").namespaceURI", "'http://www.w3.org/1999/xhtml'"); | |
| log(""); | |
| var myScriptTag = document.getElementById("scriptTag"); | |
| log("Test3: script tag.namespaceURI"); | |
| shouldBe("myScriptTag.namespaceURI", "'http://www.w3.org/1999/xhtml'"); | |
| log(""); | |
| var newDoc = document.implementation.createDocument("http://www.w3.org/1999/xhtml", "", null); | |
| log("Test4: created document.namespaceURI"); | |
| shouldBe("newDoc.namespaceURI", "null"); | |
| log(""); | |
| log("Test5: created document.createElement.namespaceURI"); | |
| shouldBe("newDoc.createElement(\"div\").namespaceURI", "'http://www.w3.org/1999/xhtml'"); | |
| </script> | |
| </body> | |
| </html> |