3 <script src=
"../../resources/js-test.js"></script>
6 description('This tests that XMLSerializer emits a correct namespace declaration for the <image> element. The first line is serialized as part of a DocumentFragment. The second line is serialized as part of the Document.');
8 var svgDoc
= new DOMParser().parseFromString('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"></svg>', 'text/xml');
9 var svgEl
= svgDoc
.firstChild
;
10 var imageEl
= document
.createElementNS('http://www.w3.org/2000/svg', 'image');
11 imageEl
.setAttributeNS('http://www.w3.org/1999/xlink', 'href', 'blah');
12 svgEl
.appendChild(imageEl
);
14 var serializer
= new XMLSerializer();
16 debug(escapeHTML(serializer
.serializeToString(svgEl
)));
17 document
.body
.appendChild(svgDoc
.removeChild(svgEl
));
18 debug(escapeHTML(serializer
.serializeToString(svgEl
)));
20 document
.body
.removeChild(svgEl
);