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

Side by Side Diff: LayoutTests/fast/dom/XMLSerializer-element-ns-no-reemit.html

Issue 184633007: Don't emit a default namespace declaration if it's already the default (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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/inspector/elements/set-outer-html-for-xhtml-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 <title>XMLSerializer: Don't emit redundant NS declarations</title>
3 <script src=../../resources/testharness.js></script>
4 <script src=../../resources/testharnessreport.js></script>
5 <div id=log></div>
6 <script>
7 test(function() {
8 var s = '<foo xmlns="http://www.w3.org/1999/xhtml"></foo>';
9 var docFrag = new DOMParser().parseFromString(s, 'text/xml');
10 var root = docFrag.removeChild(docFrag.firstChild);
11 var child = document.createElementNS('http://www.w3.org/1999/xhtml', 'bar');
12 child.appendChild(document.createTextNode(''));
13 root.appendChild(child);
14 var result1 = new XMLSerializer().serializeToString(root);
15 assert_equals(result1, '<foo xmlns="http://www.w3.org/1999/xhtml"><bar></bar ></foo>');
16 }, 'XMLSerializer: Don\'t emit redundant declarations of the default NS.');
17
18 test(function() {
19 var s = '<foo xmlns="http://www.w3.org/1999/xhtml" xmlns:baz="http://example .org/baz"></foo>';
20 var docFrag = new DOMParser().parseFromString(s, 'text/xml');
21 var root = docFrag.removeChild(docFrag.firstChild);
22 var child = document.createElementNS('http://example.org/baz', 'baz:bar');
23 child.appendChild(document.createTextNode(''));
24 root.appendChild(child);
25 var result1 = new XMLSerializer().serializeToString(root);
26 assert_equals(result1, '<foo xmlns="http://www.w3.org/1999/xhtml" xmlns:baz= "http://example.org/baz"><baz:bar></baz:bar></foo>');
27 }, 'XMLSerializer: Don\'t emit redundant declarations of a prefix.');
28 </script>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/inspector/elements/set-outer-html-for-xhtml-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698