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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | LayoutTests/fast/dom/XMLSerializer-attribute-ns-prefix-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script>
3 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.
4 li = document.createElement('li');
5 li.appendChild(document.createTextNode(str));
6 document.getElementById('console').appendChild(li);
7 }
8
9 function runTest() {
10 if (window.testRunner)
11 testRunner.dumpAsText();
adamk 2014/02/24 19:05:32 Same with this
fs 2014/02/25 08:51:35 Done.
12
13 var svgDoc = new DOMParser().parseFromString('<svg xmlns="http://www.w3.org/ 2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"></svg>', 'text/xml');
14 var svgEl = svgDoc.firstChild;
15 var imageEl = document.createElementNS('http://www.w3.org/2000/svg', 'image' );
16 imageEl.setAttributeNS('http://www.w3.org/1999/xlink', 'href', 'blah');
17 svgEl.appendChild(imageEl);
18
19 var serializer = new XMLSerializer();
20
21 debug(serializer.serializeToString(svgEl));
22 document.body.appendChild(svgDoc.removeChild(svgEl));
23 debug(serializer.serializeToString(svgEl));
24
25 document.body.removeChild(svgEl);
26 }
27 window.onload = runTest;
28 </script>
29 <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. T he 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.
30 </p>
31 <ul id=console>
32 </ul>
OLDNEW
« 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