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

Side by Side Diff: LayoutTests/fast/dom/XMLSerializer-entities.html

Issue 26193002: XMLSerializer escapes < > & correctly inside <script> and <style> tags. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Addressed feedback. Created 7 years, 1 month 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
OLDNEW
(Empty)
1 <html>
2 <head>
3 <script type="text/javascript">
4 function runTest()
5 {
6 if (window.testRunner)
7 testRunner.dumpAsText();
8
9 var ns = 'http://www.w3.org/1999/xhtml';
10 var xhtml = document.implementation.createDocument(ns , 'html', null);
11
12 var p = xhtml.createElementNS(ns, 'p');
13 p.textContent = '(0 < 1 && 1 > 0)';
14 xhtml.documentElement.appendChild(p);
15
16 var script = xhtml.createElementNS(ns, 'script');
17 script.textContent = 'if (0 < 1 && 1 > 0) { };';
18 xhtml.documentElement.appendChild(script);
19
20 var style = xhtml.createElementNS(ns, 'style');
21 style.textContent = '/* < > & */';
22 xhtml.documentElement.appendChild(style);
23
24 var serializer = new XMLSerializer();
25 var xmlString = serializer.serializeToString(xhtml);
26
27 var outputText = document.getElementById("output");
28 outputText.textContent = xmlString;
29 }
30 </script>
31 </head>
32 <body onload="runTest()">
33 <div id="output"/>
34 </body>
35 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698