summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/dom/XMLSerializer-double-xmlns.html
blob: b15fb1b9ee53ec334af6da7c2549577f2c387a04 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<!DOCTYPE html>
<script src="../../resources/js-test.js"></script>
<script>
description("Checks that attributes created setAttributeNS() don't cause two identical xmlns attributes to be serialized");
window.doc = (new DOMParser()).parseFromString('<test/>', 'text/xml');
doc.documentElement.setAttributeNS('http://www.example.com', 'ns:attr', 'value');
doc.documentElement.setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:ns', 'http://www.example.com');

// Check the DOM construction.
shouldBe('doc.documentElement.getAttributeNS("http://www.example.com", "attr")', '"value"');

window.xmlText = (new XMLSerializer()).serializeToString(doc); // exported for debugging
window.parsedDoc = (new DOMParser()).parseFromString(xmlText, 'text/xml');

// Check the serialization result.
shouldBe('parsedDoc.documentElement.getAttributeNS("http://www.example.com", "attr")', '"value"');
</script>