summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/dom/setAttributeNS-empty-namespace.html
blob: f7a9e98afd080bccc7bcc575ba4fdb52a577a623 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
<body>
<p>Test that setAttributeNS("", ...) creates an attribute in null namespace. Per DOM 3 Core,</p>
<pre>In programming languages where empty strings can be differentiated from null, empty strings, when given as a namespace URI, are converted to null.</pre>
<script>
if (window.testRunner)
    testRunner.dumpAsText();

document.body.setAttributeNS("", "a", "b");
var attrNamespace = document.body.getAttributeNodeNS("", "a").namespaceURI;
document.write(attrNamespace === null ? "PASS" : ("FAIL: '" + attrNamespace + "'"));
</script>
</body>