| OLD | NEW |
| 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <script src="../../../resources/js-test.js"></script> | 4 <script src="../../../resources/js-test.js"></script> |
| 5 </head> | 5 </head> |
| 6 <body> | 6 <body> |
| 7 <script src="script-tests/normalize-with-cdata.js"></script> | 7 <script> |
| 8 description('Test of normalize on an XML document with CDATA.'); |
| 9 |
| 10 var parser = new DOMParser(); |
| 11 var serializer = new XMLSerializer(); |
| 12 |
| 13 var xmlChunk = parser.parseFromString( |
| 14 '<foo>' + |
| 15 'This is some text before the CDATA' + |
| 16 '<![CDATA[This is some <bold>markup</bold> inside of a CDATA]]>' + |
| 17 'This is some text after the CDATA' + |
| 18 '</foo>', |
| 19 'application/xml'); |
| 20 |
| 21 debug('Before normalize'); |
| 22 shouldBe('serializer.serializeToString(xmlChunk)', '"<foo>This is some text befo
re the CDATA<![CDATA[This is some <bold>markup</bold> inside of a CDATA]]>This i
s some text after the CDATA</foo>"'); |
| 23 shouldBe('xmlChunk.documentElement.childNodes.length', '3'); |
| 24 xmlChunk.documentElement.normalize(); |
| 25 debug('After normalize'); |
| 26 shouldBe('serializer.serializeToString(xmlChunk)', '"<foo>This is some text befo
re the CDATA<![CDATA[This is some <bold>markup</bold> inside of a CDATA]]>This i
s some text after the CDATA</foo>"'); |
| 27 shouldBe('xmlChunk.documentElement.childNodes.length', '3'); |
| 28 </script> |
| 8 </body> | 29 </body> |
| 9 </html> | 30 </html> |
| OLD | NEW |