| | 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| | 2 | <html xmlns="http://www.w3.org/1999/xhtml"> |
| | 3 | <head> |
| | 4 | <title>CKEDITOR.dom.node</title> |
| | 5 | <link rel="stylesheet" type="text/css" href="../../test.css" /> |
| | 6 | <script type="text/javascript" src="../../../../ckeditor_source.js"></script> <!-- %REMOVE_LINE% |
| | 7 | <script type="text/javascript" src="../../../ckeditor.js"></script> |
| | 8 | %REMOVE_LINE% --> |
| | 9 | <script type="text/javascript" src="../../test.js"></script> |
| | 10 | <script type="text/javascript"> |
| | 11 | //<![CDATA[ |
| | 12 | CKEDITOR.plugins.load( 'htmldataprocessor' ); |
| | 13 | |
| | 14 | CKEDITOR.test.addTestCase( (function() |
| | 15 | { |
| | 16 | // Local reference to the "assert" object. |
| | 17 | var assert = CKEDITOR.test.assert, |
| | 18 | doc = CKEDITOR.document; |
| | 19 | |
| | 20 | // In these tests, we may "reset" the writer rules to avoid it formatting |
| | 21 | // the output, making the assertion easier to the done. We don't need to |
| | 22 | // test formatting features here, so this is ok. |
| | 23 | var getDataProcessor = function() |
| | 24 | { |
| | 25 | var dataProcessor = new CKEDITOR.htmlDataProcessor(); |
| | 26 | dataProcessor.writer._.rules = []; |
| | 27 | return dataProcessor; |
| | 28 | }; |
| | 29 | |
| | 30 | return { |
| | 31 | |
| | 32 | /** |
| | 33 | * Recursively strip all cloned element 'id'. |
| | 34 | */ |
| | 35 | test_clone: function() |
| | 36 | { |
| | 37 | var target = doc.getById( 'cloneTarget' ); |
| | 38 | assert.areSame( '<span><b>text</b></span>' , |
| | 39 | getDataProcessor().toHtml( target.clone( true ).getOuterHtml() ) ); |
| | 40 | }, |
| | 41 | |
| | 42 | name : document.title |
| | 43 | }; |
| | 44 | })() ); |
| | 45 | |
| | 46 | //]]> |
| | 47 | </script> |
| | 48 | </head> |
| | 49 | <body> |
| | 50 | <span id="cloneTarget"><b id="nestedCloneTarget">text</b></span> |
| | 51 | </body> |
| | 52 | </html> |