| 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.range</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 | |
| 13 | var tc; |
| 14 | |
| 15 | CKEDITOR.test.addTestCase( tc = ( function() |
| 16 | { |
| 17 | // Local references. |
| 18 | var assert = CKEDITOR.test.assert, |
| 19 | arrayAssert = YAHOO.util.ArrayAssert; |
| 20 | |
| 21 | var doc = new CKEDITOR.dom.document( document ); |
| 22 | |
| 23 | return { |
| 24 | |
| 25 | /** |
| 26 | * When range is collapsed, boundary nodes should be 'null'. |
| 27 | */ |
| 28 | test_getBoundaryNodes : function() |
| 29 | { |
| 30 | //<span id="first">1</span><p id="second">^2</p><span id="last">3<span> |
| 31 | var range = new CKEDITOR.dom.range( doc ); |
| 32 | range.setStartAt( doc.getById( 'second' ), CKEDITOR.POSITION_AFTER_START ); |
| 33 | var boundaries = range.getBoundaryNodes(), |
| 34 | start = boundaries.startNode, |
| 35 | end = boundaries.endNode; |
| 36 | |
| 37 | assert.isNull( start ); |
| 38 | assert.isNull( end ); |
| 39 | }, |
| 40 | |
| 41 | name : document.title |
| 42 | }; |
| 43 | })() ); |
| 44 | |
| 45 | |
| 46 | //]]> |
| 47 | </script> |
| 48 | </head> |
| 49 | <body><span id="first">1</span><p id="second">2</p><span id="last">3<span></body> |
| 50 | </html> |