Index: LayoutTests/fast/dom/XMLSerializer-attribute-ns-prefix.html |
diff --git a/LayoutTests/fast/dom/XMLSerializer-attribute-ns-prefix.html b/LayoutTests/fast/dom/XMLSerializer-attribute-ns-prefix.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..335932addc6a4cac75a4d3d7df8c5f6a1ef8810a |
--- /dev/null |
+++ b/LayoutTests/fast/dom/XMLSerializer-attribute-ns-prefix.html |
@@ -0,0 +1,32 @@ |
+<!DOCTYPE html> |
+<script> |
+function debug(str) { |
adamk
2014/02/24 19:05:32
You'd get this for free if you used
<script src="
fs
2014/02/25 08:51:35
Done.
|
+ li = document.createElement('li'); |
+ li.appendChild(document.createTextNode(str)); |
+ document.getElementById('console').appendChild(li); |
+} |
+ |
+function runTest() { |
+ if (window.testRunner) |
+ testRunner.dumpAsText(); |
adamk
2014/02/24 19:05:32
Same with this
fs
2014/02/25 08:51:35
Done.
|
+ |
+ var svgDoc = new DOMParser().parseFromString('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"></svg>', 'text/xml'); |
+ var svgEl = svgDoc.firstChild; |
+ var imageEl = document.createElementNS('http://www.w3.org/2000/svg', 'image'); |
+ imageEl.setAttributeNS('http://www.w3.org/1999/xlink', 'href', 'blah'); |
+ svgEl.appendChild(imageEl); |
+ |
+ var serializer = new XMLSerializer(); |
+ |
+ debug(serializer.serializeToString(svgEl)); |
+ document.body.appendChild(svgDoc.removeChild(svgEl)); |
+ debug(serializer.serializeToString(svgEl)); |
+ |
+ document.body.removeChild(svgEl); |
+} |
+window.onload = runTest; |
+</script> |
+<p>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.</p> |
adamk
2014/02/24 19:05:32
And then you'd pass this to the description() func
fs
2014/02/25 08:51:35
Done.
|
+</p> |
+<ul id=console> |
+</ul> |