| 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('Tests the serialization of special XML namespaces on attributes, as
reported in <a href="http://crbug.com/395950">bug 395950</a>.'); | 4 description('Tests the serialization of special XML namespaces on attributes, as
reported in <a href="http://crbug.com/395950">bug 395950</a>.'); |
| 5 | 5 |
| 6 var xmlDocument = (new DOMParser()).parseFromString('<outer />', 'text/xml'); | 6 var xmlDocument = (new DOMParser()).parseFromString('<outer />', 'text/xml'); |
| 7 | 7 |
| 8 var inner1 = xmlDocument.createElementNS(null, 'inner1'); | 8 var inner1 = xmlDocument.createElementNS(null, 'inner1'); |
| 9 // The xlink's namespace prefix is xlink by default, not auto-generated. | 9 // The xlink's namespace prefix is xlink by default, not auto-generated. |
| 10 inner1.setAttributeNS('http://www.w3.org/1999/xlink', 'href', 'http://www.google
.com'); | 10 inner1.setAttributeNS('http://www.w3.org/1999/xlink', 'href', 'http://www.google
.com'); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 shouldBeEqualToString('parsedDoc.querySelector("inner2").getAttributeNS("http://
www.w3.org/1999/xlink", "href")', 'http://www.google.com'); | 36 shouldBeEqualToString('parsedDoc.querySelector("inner2").getAttributeNS("http://
www.w3.org/1999/xlink", "href")', 'http://www.google.com'); |
| 37 shouldBeEqualToString('parsedDoc.querySelector("inner2").getAttribute("xl:href")
', 'http://www.google.com'); | 37 shouldBeEqualToString('parsedDoc.querySelector("inner2").getAttribute("xl:href")
', 'http://www.google.com'); |
| 38 shouldBeEqualToString('parsedDoc.querySelector("inner2").getAttributeNS("http://
www.w3.org/XML/1998/namespace", "attr")', 'value'); | 38 shouldBeEqualToString('parsedDoc.querySelector("inner2").getAttributeNS("http://
www.w3.org/XML/1998/namespace", "attr")', 'value'); |
| 39 shouldBeEqualToString('parsedDoc.querySelector("inner2").getAttribute("xml:attr"
)', 'value'); | 39 shouldBeEqualToString('parsedDoc.querySelector("inner2").getAttribute("xml:attr"
)', 'value'); |
| 40 | 40 |
| 41 // Check that the correct xmlns definitions were emitted. | 41 // Check that the correct xmlns definitions were emitted. |
| 42 shouldBeEqualToNumber('xmlString.indexOf("xmlns:xml")', -1); | 42 shouldBeEqualToNumber('xmlString.indexOf("xmlns:xml")', -1); |
| 43 shouldNotBe('xmlString.indexOf("xmlns:xlink")', '-1'); | 43 shouldNotBe('xmlString.indexOf("xmlns:xlink")', '-1'); |
| 44 shouldNotBe('xmlString.indexOf("xmlns:xl")', '-1'); | 44 shouldNotBe('xmlString.indexOf("xmlns:xl")', '-1'); |
| 45 </script> | 45 </script> |
| OLD | NEW |