| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <script src="../../resources/js-test.js"></script> | 2 <script src="../../resources/js-test.js"></script> |
| 3 <script> | 3 <script> |
| 4 description("Checks that attributes created setAttributeNS() don't cause two ide
ntical xmlns attributes to be serialized"); | 4 description("Checks that attributes created setAttributeNS() don't cause two ide
ntical xmlns attributes to be serialized"); |
| 5 window.doc = (new DOMParser()).parseFromString('<test/>', 'text/xml'); | 5 window.doc = (new DOMParser()).parseFromString('<test/>', 'text/xml'); |
| 6 doc.documentElement.setAttributeNS('http://www.example.com', 'ns:attr', 'value')
; | 6 doc.documentElement.setAttributeNS('http://www.example.com', 'ns:attr', 'value')
; |
| 7 doc.documentElement.setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:ns',
'http://www.example.com'); | 7 doc.documentElement.setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:ns',
'http://www.example.com'); |
| 8 | 8 |
| 9 // Check the DOM construction. | 9 // Check the DOM construction. |
| 10 shouldBe('doc.documentElement.getAttributeNS("http://www.example.com", "attr")',
'"value"'); | 10 shouldBe('doc.documentElement.getAttributeNS("http://www.example.com", "attr")',
'"value"'); |
| 11 | 11 |
| 12 window.xmlText = (new XMLSerializer()).serializeToString(doc); // exported for d
ebugging | 12 window.xmlText = (new XMLSerializer()).serializeToString(doc); // exported for d
ebugging |
| 13 window.parsedDoc = (new DOMParser()).parseFromString(xmlText, 'text/xml'); | 13 window.parsedDoc = (new DOMParser()).parseFromString(xmlText, 'text/xml'); |
| 14 | 14 |
| 15 // Check the serialization result. | 15 // Check the serialization result. |
| 16 shouldBe('parsedDoc.documentElement.getAttributeNS("http://www.example.com", "at
tr")', '"value"'); | 16 shouldBe('parsedDoc.documentElement.getAttributeNS("http://www.example.com", "at
tr")', '"value"'); |
| 17 </script> | 17 </script> |
| OLD | NEW |