Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(164)

Unified Diff: LayoutTests/fast/dom/XMLSerializer-attribute-ns-prefix.html

Issue 177763002: Fix serialization of (xlink:)href attributes in document fragments (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/dom/XMLSerializer-attribute-ns-prefix-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 &lt;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>
« no previous file with comments | « no previous file | LayoutTests/fast/dom/XMLSerializer-attribute-ns-prefix-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698