Ticket #2935: 2935_2.patch
File 2935_2.patch, 41.9 KB (added by , 15 years ago) |
---|
-
_source/tests/core/dom/domobject.html
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.domobject</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 CKEDITOR.test.addTestCase( (function() 14 { 15 // Local reference to mthe "assert" object. 16 var assert = CKEDITOR.test.assert; 17 var action = YAHOO.util.UserAction; 18 19 return { 20 21 /** 22 * Test dom native listener invoked correct times. 23 */ 24 test_AddEventListener1 : function() 25 { 26 var element = CKEDITOR.document.getById( 'nativeEvent' ), callbackCount = 0; 27 element.on( 'click', function() 28 { 29 callbackCount++; 30 } ); 31 element.on( 'click', function() 32 { 33 callbackCount++; 34 } ); 35 action.click( element.$ ); 36 // waits and then run assertion 37 this.wait( function() 38 { 39 assert.areEqual( 2, callbackCount, 40 'Event handler should be invoked ' + 2 + ' times.' ); 41 }, 500 ); 42 }, 43 44 /** 45 * Test prevent and stop dom native event. 46 */ 47 test_AddEventListener2 : function() 48 { 49 var element = CKEDITOR.document.getById( 'nativeEvent' ), innerElement = CKEDITOR.document 50 .getById( 'nativeEventInner' ), preventFailed = false, stopFailed = false; 51 // Test stop propagation 52 element.on( 'click', function() 53 { 54 stopFailed = true; 55 } ); 56 innerElement.on( 'click', function( evt ) 57 { 58 evt.data.preventDefault( true ); 59 } ); 60 // Test prevent others 61 innerElement.on( 'click', function() 62 { 63 preventFailed = true; 64 } ); 65 66 action.click( innerElement.$ ); 67 // waits and then run assertion 68 this.wait( function() 69 { 70 assert.isFalse( preventFailed, 'Prevent event failed.' ); 71 assert.isFalse( stopFailed, 'Stop event failed.' ); 72 }, 500 ); 73 }, 74 name : document.title 75 }; 76 })() ); 77 78 //]]> 79 </script> 80 </head> 81 <body> 82 <div id='nativeEvent'><span id='nativeEventInner'></span></div> 83 </body> 84 </html> 85 No newline at end of file -
_source/tests/core/dom/documentFragment.html
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.documentFragment</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 CKEDITOR.test.addTestCase( (function() 14 { 15 // Local reference to the "assert" object. 16 var assert = CKEDITOR.test.assert; 17 18 return { 19 20 /** 21 * Test dom native listener invoked correct times. 22 */ 23 test_AddEventListener1 : function() 24 { 25 var element = CKEDITOR.document.getById( 'nativeEvent' ), callbackCount = 0; 26 element.on( 'click', function() 27 { 28 callbackCount++; 29 } ); 30 element.on( 'click', function() 31 { 32 callbackCount++; 33 } ); 34 action.click( element.$ ); 35 // waits and then run assertion 36 this.wait( function() 37 { 38 assert.areEqual( 2, callbackCount, 39 'Event handler should be invoked ' + 2 + ' times.' ); 40 }, 500 ); 41 }, 42 43 /** 44 * Test prevent and stop dom native event. 45 */ 46 test_AddEventListener2 : function() 47 { 48 var element = CKEDITOR.document.getById( 'nativeEvent' ), innerElement = CKEDITOR.document 49 .getById( 'nativeEventInner' ), preventFailed = false, stopFailed = false; 50 // Test stop propagation 51 element.on( 'click', function() 52 { 53 stopFailed = true; 54 } ); 55 innerElement.on( 'click', function( evt ) 56 { 57 evt.data.preventDefault( true ); 58 } ); 59 // Test prevent others 60 innerElement.on( 'click', function() 61 { 62 preventFailed = true; 63 } ); 64 65 action.click( innerElement.$ ); 66 // waits and then run assertion 67 this.wait( function() 68 { 69 assert.isFalse( preventFailed, 'Prevent event failed.' ); 70 assert.isFalse( stopFailed, 'Stop event failed.' ); 71 }, 500 ); 72 }, 73 name : document.title 74 }; 75 })() ); 76 77 //]]> 78 </script> 79 </head> 80 <body> 81 <div id="fragmentContainer1"></div> 82 <div id="fragmentContainer2"><div id="fragmentSibling1"></div></div> 83 </body> 84 </html> 85 No newline at end of file -
_source/tests/core/dom/domwalker_test_data.html
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" lang="en" xml:lang="en"> 3 <head> 4 <title>FCKeditor - The text editor for Internet</title> 5 </head> 6 <body> 7 <div class="main_head"> 8 <h1> 9 <a href="/" title="FCKeditor Home">FCKeditor</a> 10 </h1> 11 <ul class="top_menu"><li><a href="/" title="Home Page" class="active">Home</a></li><li><a href="/demo" title="">Demo</a></li><li><a href="/download" title="">Download</a></li><li><a href="http://docs.fckeditor.net/" title="FCKeditor Documentation Site">Docs</a></li><li><a href="/license" title="">License</a></li><li><a href="/support" title="">Support</a></li><li><a href="/forums/" title="FCKeditor Forums">Forums</a></li><li><a href="/extras" title="">Extras!</a></li></ul> </div> 12 <table class="round_box top_box" cellpadding="0" cellspacing="0" border="0"> 13 <tr> 14 <td class="top"> 15 <div class="top_left"> 16 <div class="top_right"> 17 </div> 18 </div> 19 </td> 20 </tr> 21 <tr> 22 <td class="contents"> 23 <table cellpadding="0" cellspacing="0"> 24 <tr> 25 <td> 26 <div class="top_box_text"> 27 This HTML text editor brings to the web much of the power of 28 desktop editors like MS Word. It's <strong>lightweight</strong> and doesn't require 29 any kind of installation on the client computer. 30 </div> 31 <div class="top_box_links"> 32 <a href="/whosusing">Who's using FCKeditor?</a> 33 <a href="http://dev.fckeditor.net">Development Site</a> 34 <a href="/roadmap">Roadmap</a> 35 </div> 36 </td> 37 <td class="v_separator"> 38 39 </td> 40 <td class="current_release"> 41 <div>Current Release</div> 42 <a title="See "What's New?"" href="/whatsnew" class="release_number"> 43 2.6.4</a> </td> 44 </tr> 45 </table> 46 </td> 47 </tr> 48 <tr> 49 <td class="bottom"> 50 <div class="bottom_left"> 51 <div class="bottom_right"> 52 </div> 53 </div> 54 </td> 55 </tr> 56 </table> 57 <table class="round_box" cellpadding="0" cellspacing="0" border="0" width="100%"> 58 <tr> 59 <td class="top"> 60 <div class="top_left"> 61 <div class="top_right"> 62 </div> 63 </div> 64 </td> 65 </tr> 66 <tr> 67 <td class="contents"> 68 <table cellpadding="0" cellspacing="0" width="100%"> 69 <tr> 70 <td valign="top" style="padding-right: 10px;"> 71 <h1 class="main_title"> 72 Latest News <span class="news_archive">(<a href="/newsarchive">Archive</a>)</span></h1> 73 <div class="main_contents"> 74 <div class='view view-Home_News'><div class='view-content view-content-Home_News'><div class="last_news"><h2> 75 January 31, 2009 - FCKeditor 2.6.4 released! (<a href="/whatsnew">What's New?</a>) 76 77 </h2> 78 <p>The stabilization of FCKeditor 2.6.4 Beta has been completed successfully. We are proud to come with a brand new version of our editor, ready for production use.</p> 79 <p>As of this version, we're offering the <strong>WebSpellChecker</strong> integration, a <strong>zero-installation solution for spell checking</strong> provided by SpellChecker.net. You will now have a wonderful spell checker <strong>running out of the box</strong>, requiring no server side installations and configurations.</p> 80 <p>Several bug <strong>fixes</strong> and <strong>new features</strong> have been added, especially to our <strong>table support</strong>, including the ability of defining header rows and columns to tables. Special thanks to Alfonso Martinez and Koen Willems for their support on this.</p> 81 <p>We'll be now concentrating all our efforts on <a href="http://ckeditor.com/">CKEditor 3.0</a>. Stay in touch... you will certainly enjoy it!</p> 82 <p><a href="/forums/viewtopic.php?f=8&t=12852">Comment it at our Forums >>></a></p><h2> 83 January 28, 2009 - CKEditor 3.0 Beta released! 84 </h2> 85 <p>We've been working hard during the last year to produce our new generation editor. It is something completely new, out of comparison to any solution available in the market.</p> 86 <p><strong>CKEditor 3.0</strong> is not ready yet, but its foundation is complete, and we want to start showing to public the results of it.</p> 87 <p>This version is still buggy and misses several features. <strong>It's not to be used on production web sites</strong>. If you are looking for a powerful and stable editor, then stay with FCKeditor for now.</p> 88 <p><a href="http://ckeditor.com/">Visit the CKEditor web site</a> to have a taste of it. Your comments are welcome!</p> 89 <p>Enjoy it!</p> 90 <p><a href="/forums/viewtopic.php?f=8&t=12819">Comment it at our Forums >>></a></p><h2> 91 January 15, 2009 - FCKeditor 2.6.4 Beta released (<a href="/whatsnew">What's New?</a>) 92 93 </h2> 94 <p>This new version introduces the <strong>WebSpellChecker</strong> integration, a <strong>zero-installation solution for spell checking</strong> provided by SpellChecker.net. You will now have a wonderful spell checker <strong>running out of the box</strong>, requiring no server side installations and configurations.</p> 95 <p>Several bug <strong>fixes</strong> and <strong>new features</strong> have been added, especially to our <strong>table support</strong>, including the ability of defining header rows and columns to tables. Special thanks to Alfonso Martinez and Koen Willems for their support on this.</p> 96 <p>We'll be now following our usual stabilization period for this release. Let us know if you find anything wrong with it, by <a href="http://dev.fckeditor.net/">opening tickets at our dev site</a>.</p> 97 <p><a href="/forums/viewtopic.php?f=8&t=12671">Comment it at our Forums >>></a></p><h2> 98 December 16, 2008 - CKFinder 1.3 released 99 </h2> 100 <p>A fresh new release of CKFinder is now available. It contains several new features and some security fixes, so <strong>upgrading is strongly recommended</strong>.</p> 101 <p>The list of changes is available on the <a href="http://www.ckfinder.com/whatsnew">CKFinder web site</a>, so I'll just mention the two features that you will definitely like: the control over the startup location and the ability to select a thumbnail from the context menu.</p> 102 <p>Check out the <a href="http://www.ckfinder.com/whatsnew">CKFinder web site</a> for more information.</p> 103 <p><a href="/forums/viewtopic.php?f=8&t=12384&start=0">Comment it at our Forums >>></a></p></div></div></div> 104 </div><div class="current_poll"> 105 Poll: <a href="/poll" title="Click to vote and see results">Should FCKeditor change its name?</a> 106 </div><h1 class="main_title"> 107 Demo</h1> 108 <div class="main_contents"> 109 <table cellspacing="0" cellpadding="0"> 110 <tbody> 111 <tr> 112 <td style="padding-right: 10px" valign="middle" align="center"> 113 Click the image to see the editor in action! 114 <br /> 115 <br /> 116 <div class="start_demo" align="center"> 117 <a href="http://www.fckeditor.net/demo">Start Demo</a></div> 118 </td> 119 <td width="300"> 120 <a href="http://www.fckeditor.net/demo"> 121 <img height="100" alt="" src="/images/demo_screenshot.gif" width="300" border="0" /></a></td> 122 </tr> 123 </tbody> 124 </table></div><h1 class="main_title"> 125 Features</h1> 126 <div class="main_contents"> 127 <table cellspacing="0" cellpadding="0" width="100%" border="0"> 128 <tbody> 129 <tr valign="top"> 130 <td width="50%"> 131 <ul style="MARGIN-BOTTOM: 0px"> 132 <li><strong>Multi browser compatibility</strong> </li> 133 <li>Outputs <strong>XHTML</strong> 1.0 </li> 134 <li><strong>CSS support</strong> for better integration with your web site<strong> </strong></li> 135 <li><strong>Font formatting</strong>: type, size, color, style, bold, italic, etc </li> 136 <li><strong>Text formatting</strong>: alignment, indentation, bullets list, etc </li> 137 <li>Cut, Paste, and Paste as Plain Text, Undo and Redo </li> 138 <li>Paste from <strong>Word</strong> cleanup with auto detection </li> 139 <li>Link and anchors support </li> 140 <li>Image insertion, with <strong>upload</strong> and <strong>server browsing</strong> support </li> 141 <li>Table creation and editing (add, delete rows, etc) - one of the best systems on the market. </li> 142 <li>Table cells editing (size, colors, etc) </li> 143 <li>Form fields </li> 144 <li>Right click <strong>context menus</strong> support </li> 145 </ul> 146 </td> 147 <td width="50%"> 148 <ul style="MARGIN-BOTTOM: 0px"> 149 <li>Complete <strong>toolbar customization</strong> </li> 150 <li>Skins support </li> 151 <li>Plugins support </li> 152 <li>Spell checker </li> 153 <li><strong>Multi-language</strong> support with <strong>automatic</strong> user language <strong>detection</strong>. Including Right to Left scripting. </li> 154 <li>Complete page editing (from <HTML> to </HTML>) or just contents. </li> 155 <li>Lightweight and fast </li> 156 <li>Automatic <strong>browser detection</strong> and customization </li> 157 <li>Integration with <strong>ASP, ASP.NET, Java, ColdFusion, Perl, PHP, </strong><strong>JavaScript and more</strong>. </li> 158 <li>Image and file <strong>links upload</strong> and server repository browser. </li> 159 <li>For web developers it is easy to install and customize </li> 160 <li>For web users it's simple and easy to use! </li> 161 </ul> 162 </td> 163 </tr> 164 </tbody> 165 </table></div> </td> 166 <td valign="top" width="260"> 167 <table class="round_box_white" cellpadding="0" cellspacing="0" border="0" width="100%"> 168 <tr> 169 <td class="top" valign="top"> 170 <div class="top_left"> 171 <div class="top_right title_bar"> 172 <div class="Block_Title"> 173 Compatibility </div> 174 </div> 175 </div> 176 </td> 177 </tr> 178 <tr> 179 <td class="contents"> 180 <table cellspacing="0" cellpadding="0" align="center" class="compat_logos" id="xCompatBrowsers"> 181 <tbody> 182 <tr> 183 <td class="ie" id="xCompat_ie"> </td> 184 <td class="firefox" id="xCompat_firefox"> </td> 185 <td class="safari" id="xCompat_safari"> </td> 186 <td class="opera" id="xCompat_opera"> </td> 187 <td class="chrome" id="xCompat_chrome"> </td> 188 <td class="camino" id="xCompat_camino"> </td> 189 </tr> 190 </tbody> 191 </table> 192 <table cellspacing="0" cellpadding="0" align="center" class="compat_logos" id="xCompatOSs"> 193 <tbody> 194 <tr> 195 <td class="windows" id="xCompat_windows"> </td> 196 <td class="mac" id="xCompat_mac"> </td> 197 <td class="linux" id="xCompat_linux"> </td> 198 </tr> 199 </tbody> 200 </table> 201 <div id="xCompatTitle">Compatible browsers and OSs</div> 202 <div class="Block_Content_Separator"> </div> 203 <p>On the server side, FCKeditor offers a complete integration pack for:</p> 204 <table width="90%" cellspacing="0" cellpadding="0" border="0" align="center"> 205 <tbody> 206 <tr valign="top"> 207 <td width="50%" nowrap="nowrap"> 208 <ul class="NoBottomMargin"> 209 <li>ASP.Net</li> 210 <li>ASP</li> 211 <li>ColdFusion</li> 212 <li>PHP</li> 213 <li>Java</li> 214 </ul> 215 </td> 216 <td width="50%" nowrap="nowrap"> 217 <ul class="NoBottomMargin"> 218 <li>Active-FoxPro</li> 219 <li>Lasso</li> 220 <li>Perl</li> 221 <li>P<span>y</span>thon</li> 222 </ul> 223 </td> 224 </tr> 225 </tbody> 226 </table> </td> 227 </tr> 228 <tr> 229 <td class="bottom"> 230 <div class="bottom_left"> 231 <div class="bottom_right"> 232 </div> 233 </div> 234 </td> 235 </tr> 236 </table> 237 <div style="margin-top: 10px;"> 238 <table class="round_box_white" cellpadding="0" cellspacing="0" border="0" width="100%"> 239 <tr> 240 <td class="top" valign="top"> 241 <div class="top_left"> 242 <div class="top_right title_bar"> 243 <div class="Block_Title"> 244 Commercial License </div> 245 </div> 246 </div> 247 </td> 248 </tr> 249 <tr> 250 <td class="contents"> 251 <p>For many companies and products, Open Source licenses or the donation mechanism is not an option. To avoid any legal issues and <strong>to have complete freedom</strong> in integrating and distributing FCKeditor, the <strong>CDL</strong> license has been created.</p> 252 <div class="Block_Content_Separator"> </div> 253 <div align="center"><a href="/license/commercial">Click here to find out more</a></div> </td> 254 </tr> 255 <tr> 256 <td class="bottom"> 257 <div class="bottom_left"> 258 <div class="bottom_right"> 259 </div> 260 </div> 261 </td> 262 </tr> 263 </table> 264 </div> 265 <div style="margin-top: 10px;"> 266 <table class="round_box_white" cellpadding="0" cellspacing="0" border="0" width="100%"> 267 <tr> 268 <td class="top" valign="top"> 269 <div class="top_left"> 270 <div class="top_right title_bar"> 271 <div class="Block_Title"> 272 Extras! </div> 273 </div> 274 </div> 275 </td> 276 </tr> 277 <tr> 278 <td class="contents"> 279 <p align="center"><a href="http://www.ckfinder.com/">CKFinder - The Advanced File Browser for FCKeditor</a></p> 280 <p align="center"><img width="175" height="100" src="/images/ckfinder/CKFinder_Mini.gif" alt="" /></p> 281 <p>Bring <strong>thumbnails</strong>, <strong>easy to use</strong> and intuitive <strong>context menu</strong> support to your FCKeditor installation with CKFinder, our advanced <strong>Ajax based File Manager</strong>. <a href="http://www.ckfinder.com/">Visit site...</a></p> 282 <div class="Block_Content_Separator"> </div> 283 <div align="center"><a href="/extras">More Extras!</a></div> </td> 284 </tr> 285 <tr> 286 <td class="bottom"> 287 <div class="bottom_left"> 288 <div class="bottom_right"> 289 </div> 290 </div> 291 </td> 292 </tr> 293 </table> 294 </div> 295 <div style="margin-top: 10px;"> 296 <table class="round_box_white" cellpadding="0" cellspacing="0" border="0" width="100%"> 297 <tr> 298 <td class="top" valign="top"> 299 <div class="top_left"> 300 <div class="top_right title_bar"> 301 <div class="Block_Title"> 302 Download </div> 303 </div> 304 </div> 305 </td> 306 </tr> 307 <tr> 308 <td class="contents"> 309 <div align="center"> <strong>3,643,349</strong> downloads!<br />(2,176 yesterday) </div> 310 <div class="Block_Content_Separator"> </div> 311 <div align="center"><a href="/download">Download Now!</a><br /> 312 <a href="https://sourceforge.net/project/stats/detail.php?group_id=75348&ugn=fckeditor&type=prdownload&mode=alltime&package_id=0&release_id=0" target="_blank">View Statistics</a> (New Window)<br /> 313 </div> </td> 314 </tr> 315 <tr> 316 <td class="bottom"> 317 <div class="bottom_left"> 318 <div class="bottom_right"> 319 </div> 320 </div> 321 </td> 322 </tr> 323 </table> 324 </div> 325 <div style="margin-top: 10px;"> 326 <table class="round_box_white" cellpadding="0" cellspacing="0" border="0" width="100%"> 327 <tr> 328 <td class="top" valign="top"> 329 <div class="top_left"> 330 <div class="top_right title_bar"> 331 <div class="Block_Title"> 332 Sponsors </div> 333 </div> 334 </div> 335 </td> 336 </tr> 337 <tr> 338 <td class="contents"> 339 <div align="center"> 340 </div> 341 342 <div class="Block_Content_Separator"> </div> 343 <div align="center"><a href="/sponsors">All Sponsors</a> - <a href="/sponsors/apply">Become a Sponsor</a></div> 344 345 <!-- 346 <p style="text-align: center;">We have just opened our <b>Sponsorship Opportunities</b>. <a href="/sponsors/apply">Click here</a> to find out more and join us.</p> 347 --> </td> 348 </tr> 349 <tr> 350 <td class="bottom"> 351 <div class="bottom_left"> 352 <div class="bottom_right"> 353 </div> 354 </div> 355 </td> 356 </tr> 357 </table> 358 </div> 359 <div style="margin-top: 10px;"> 360 <table class="round_box_white" cellpadding="0" cellspacing="0" border="0" width="100%"> 361 <tr> 362 <td class="top" valign="top"> 363 <div class="top_left"> 364 <div class="top_right title_bar"> 365 <div class="Block_Title"> 366 Our Team </div> 367 </div> 368 </div> 369 </td> 370 </tr> 371 <tr> 372 <td class="contents"> 373 <p>The FCKeditor project is managed and maintained by <strong>FredCK.com</strong>.</p> 374 <p>Many other dedicated people have worked hard to develop and improve the FCKeditor.</p> 375 <div class="Block_Content_Separator"> </div> 376 <div align="center"><a href="/developers">Find out more about us!</a></div> </td> 377 </tr> 378 <tr> 379 <td class="bottom"> 380 <div class="bottom_left"> 381 <div class="bottom_right"> 382 </div> 383 </div> 384 </td> 385 </tr> 386 </table> 387 </div> 388 </td> 389 </tr> 390 </table> 391 </td> 392 </tr> 393 <tr> 394 <td class="bottom"> 395 <div class="bottom_left"> 396 <div class="bottom_right"> 397 </div> 398 </div> 399 </td> 400 </tr> 401 </table> 402 <div class="bottom"> 403 <div class="bottomlinks"> 404 <a href="/jobs">Jobs!</a> 405 - <a href="/terms">Terms of Use</a> 406 - <a href="/privacy">Privacy</a> 407 - <a title="Contact us" href="/contact">Contact</a> 408 </div> 409 <div class="copyright"> 410 <div> 411 © 2003 - 2009 Frederico Caldeira Knabben (<a href="http://www.fredck.com/">FredCK.com</a>). All rights reserved. 412 </div> 413 </div> 414 <div class="bottom_buttons"> 415 <div class="button_xhtml"> 416 <a href="http://validator.w3.org/check?uri=referer" rel="nofollow" title="Valid XHTML 1.0 Transitional"> 417 Valid XHTML 1.0 Transitional</a> 418 </div> 419 <div class="button_sf"> 420 <a href="http://sourceforge.net/projects/fckeditor/" rel="nofollow" title="You can find FCKeditor at SourceForge.net"> 421 You can find FCKeditor at SourceForge.net</a> 422 </div> 423 </div> 424 </div> 425 <div style="clear:both"> 426 427 </div> 428 </body> 429 </html> -
_source/tests/core/dom/element.html
46 46 var element = new CKEDITOR.dom.element( document.getElementById( 'test1' ) ); 47 47 assert.isNull( element.getNameAtt() ); 48 48 }, 49 /** 50 * Test dynamic created all elements which support 'name' attribute. 51 */ 52 test_getNameAtt2 : function() 53 { 54 var supportNameTags = [ 'a', 'applet', 'button', 'embed', 'form', 55 'frame', 'iframe', 'input', 'meta', 'object', 'param', 'select' ], element; 56 57 var i, l = supportNameTags.length; 58 for ( i = 0 ; i < l ; i++ ) 59 { 60 element = new CKEDITOR.dom.element( supportNameTags[ i ] ); 61 element.setAttribute( 'name', 'test' ); 62 assert.areEqual( 'test', element.getNameAtt(), 63 'name attribute doesn\'t match on ' + supportNameTags[ i ] ); 64 } 65 }, 49 66 50 67 test_getName : function() 51 68 { … … 75 92 76 93 assert.areEqual( '', nativeElement.style.display ); 77 94 }, 95 /** 96 * Test display inheritance 97 */ 98 test_show2 : function() 99 { 100 var element = CKEDITOR.document.getById( 'show2' ); 101 element.show(); 102 assert.areEqual( 'block', element.getComputedStyle( 'display' ), 103 '"display" doesn\'t match' ); 104 }, 105 106 /** 107 * Test visibility inheritance 108 */ 109 test_show3 : function() 110 { 111 var element = CKEDITOR.document.getById( 'show2' ); 112 element.show(); 113 assert.areEqual( 'visible', element.getComputedStyle( 'visibility' ), 114 '"visibility" doesn\'t match' ); 115 }, 78 116 79 117 test_createFromHtml : function() 80 118 { … … 233 271 assert.areEqual( 'absolute', document.getElementById( 'setStyle' ).style.position ); 234 272 assert.areEqual( 'right', document.getElementById( 'setStyle' ).style.cssFloat ); 235 273 }, 274 /** 275 * Test boundary opacity style values. 276 */ 277 test_setOpacity : function() 278 { 279 var opacityValues = [ 1, 0.5, 0 ]; 280 281 var i, l = opacityValues.length; 282 for ( i = 0 ; i < l ; i++ ) 283 { 284 var element = new CKEDITOR.dom.element( 'span' ); 285 element.setOpacity( opacityValues[ i ] ); 286 assert.areEqual( opacityValues[ i ], element 287 .getComputedStyle( 'opacity' ), "Opacity style value of " 288 + opacityValues[ i ] + " doesn\'t match." ); 289 } 290 }, 236 291 237 292 test_setText1 : function() 238 293 { … … 400 455 var element = new CKEDITOR.dom.element( document.getElementById( 'tabIndexScriptDef' ) ); 401 456 assert.areEqual( null, element.getAttribute( 'tabindex' ) ); 402 457 }, 458 459 test_getAttribute_Style : function() 460 { 461 var element = new CKEDITOR.dom.element( 'span' ); 462 if ( CKEDITOR.env.ie ) 463 element.$.style.cssText = 'float:right'; 464 else 465 element.$.setAttribute( 'style', 'float:right' ); 466 467 assert.areSame( 'float: right;', element.getAttribute( 'style' ) ); 468 }, 403 469 404 470 test_getTabIndex1 : function() 405 471 { … … 486 552 var element = new CKEDITOR.dom.element( document.getElementsByTagName( 'small' )[0] ); 487 553 assert.isTrue( element.hasAttributes() ); 488 554 }, 555 /** 556 * Test dynamic attribute existence 557 */ 558 test_hasAttributes3 : function() 559 { 560 var element = new CKEDITOR.dom.element( 'span' ); 561 element.setAttribute( 'class', 'testclass' ); 562 element.removeAttribute( 'class' ); 563 assert.isFalse( element.hasAttributes() ); 564 }, 565 566 /** 567 * Test attribute abbreviation 568 */ 569 test_hasAttributes4 : function() 570 { 571 var element = CKEDITOR.document.getById( 'attributed1' ); 572 assert.isTrue( element.hasAttributes() ); 573 }, 574 /** 575 * Test 'float' style computed value 576 */ 577 test_getComputedStyle1 : function() 578 { 579 var element = document.createElement( 'span' ); 580 if ( CKEDITOR.env.ie ) 581 element.style.cssText = 'float:right'; 582 else 583 element.setAttribute( 'style', 'float:right' ); 584 585 element = new CKEDITOR.dom.element( element ); 586 assert.areSame( 'right', element.getComputedStyle( 'float' ), 587 'float style doesn\'t match' ); 588 element.remove(); 589 }, 590 591 /** 592 * Test box-model computed styles. 593 */ 594 test_getComputedStyle2 : function() 595 { 596 var element = CKEDITOR.document.getById( 'test-computed' ); 597 var nativeElement = element.$; 598 599 nativeElement.style.zoom = 1; 600 nativeElement.style.border = 'medium solid #000'; 601 602 var bw = CKEDITOR.env.ie ? 4 : 3; 603 var h = nativeElement.offsetHeight - 20 - 2 * bw; 604 assert.areEqual( bw + 'px', element 605 .getComputedStyle( 'border-top-width' ), 606 'borderTopWidth: medium doesn\'t match' ); 607 assert.areEqual( h, Math.round( parseFloat( element 608 .getComputedStyle( 'height' ) ) ), 609 'height: auto (offset minus padding and border) doesn\'t match' ); 610 nativeElement.style.padding = '1em'; 611 assert.areEqual( '16px', element.getComputedStyle( 'padding-top' ), 612 'padding:1em doesn\'t match' ); 613 nativeElement.style.margin = 'auto'; 614 assert.areEqual( '0px', element.getComputedStyle( 'margin-top' ), 615 'margin:auto doesn\'t match' ); 616 assert.areEqual( 493, 617 parseInt( element.getComputedStyle( 'width' ) ), 618 'percent:width (from CSS) doesn\'t match' ); 619 assert.areEqual( 'visible', 620 element.getComputedStyle( 'visibility' ), 621 'visibility doesn\'t match' ); 622 nativeElement.parentNode.style.visibility = 'hidden'; 623 assert.areEqual( 'hidden', 624 element.getComputedStyle( 'visibility' ), 625 'visibility doesn\'t match' ); 626 nativeElement.parentNode.style.visibility = 'visible'; 627 assert.areEqual( 2, element.getComputedStyle( 'z-index' ), 628 'element.getComputedStyle("zIndex") doesn\'t match' ); 629 }, 630 test_getComputedStyle2 : function() 631 { 632 var element = new CKEDITOR.dom.element( 'span' ); 633 element.setOpacity( 0.75 ); 634 assert.areSame( 0.75, element.getComputedStyle( 'opacity' ), 635 'opacity style doesn\'t match' ); 636 element.remove(); 637 }, 638 639 test_moveChildren1 : function() 640 { 641 var source = CKEDITOR.document.getById('childrenParent1'), 642 target = CKEDITOR.document.getById('childrenTarget1'), 643 firstChild = CKEDITOR.document.getById('firstChild1'); 644 645 source.moveChildren(target); 646 assert.areSame(firstChild.$, target.$.childNodes[1]); 647 }, 648 649 test_moveChildren2 : function() 650 { 651 var source = CKEDITOR.document.getById('childrenParent2'), 652 target = CKEDITOR.document.getById('childrenTarget2'), 653 secondChild = CKEDITOR.document.getById('firstChild2'); 654 655 source.moveChildren(target, true); 656 assert.areSame(secondChild.$, target.$.childNodes[0]); 657 }, 658 659 660 661 test_Markers : function() 662 { 663 var element1 = new CKEDITOR.dom.element( 'span' ), 664 element2 = new CKEDITOR.dom.element( 'span' ), 665 db = {}; 666 var markerName = 'fck_test_touched'; 667 668 CKEDITOR.dom.element.setMarker(db, element1, markerName, true); 669 assert.areSame(true, element1.getCustomData(markerName), 'Set marker of value: '+true+' failed.'); 670 CKEDITOR.dom.element.setMarker(db, element2, markerName, 1); 671 assert.areSame(1, element2.getCustomData(markerName), 'Set marker of value: '+1+' failed.'); 672 673 CKEDITOR.dom.element.clearAllMarkers(db); 674 assert.isNull(element1.getCustomData(markerName), 'Bounch clear markers failed.'); 675 assert.isNull(element2.getCustomData(markerName), 'Bounch clear markers failed.'); 676 677 }, 489 678 490 679 name : document.title 491 680 }; … … 493 682 494 683 //]]> 495 684 </script> 685 <style type="text/css" media="screen"> 686 #test-computed { 687 width:50%; 688 margin:auto; 689 padding:10px; 690 z-index: 2; 691 } 692 </style> 496 693 </head> 497 694 <body> 498 695 <textarea id="test1" rows="10" cols="80"></textarea> … … 515 712 B</div> 516 713 <big>Test</big> 517 714 <small title="Testing">Test</small> 715 <input id="attributed1" checked /> 716 <div style="display:none"><div id="show2"></div></div> 717 <div style="visibility:hidden"><div id="show3"></div></div> 718 <div id="childrenParent1"><span id="firstChild1">text</span></div> 719 <div id="childrenTarget1"><span>text</span></div> 720 <div id="childrenParent2"><span id="firstChild2">text</span></div> 721 <div id="childrenTarget2"><span>text</span></div> 722 <div id="test-computed">test computed style</div> 518 723 </body> 519 724 </html> -
_source/tests/core/dom/domwalker.html
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.domwalker</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.test.addTestCase( ( function() 13 { 14 // Local reference to the "assert" object. 15 var assert = CKEDITOR.test.assert; 16 17 // Temporary 'getName' compensate for textnode. 18 CKEDITOR.dom.text.prototype.getName = function() 19 { 20 return '#text'; 21 }; 22 23 var tranverseSequence = [ "div", "h1", "a", "#text", "ul", "li", "#text", 24 "li", "#text", "br", "table", "tbody", "tr", "td", "#text", "span", 25 "form", "fieldset", "legend", "#text", "label", "#text", "input" ]; 26 return { 27 28 test_forward : function() 29 { 30 var steps = [], resultSteps = tranverseSequence.concat(); 31 32 var walker = new CKEDITOR.dom.domWalker( CKEDITOR.document 33 .getById( 'walkerStartMark1' ) ); 34 walker.on( 'step', function( evt ) 35 { 36 var node = evt.data.node; 37 steps.push( node.getName() ); 38 } ); 39 walker.forward( function( evt ) 40 { 41 var to = evt.data.to; 42 var id; 43 if ( ( to.type == CKEDITOR.NODE_ELEMENT ) 44 && ( id = to.getAttribute( 'id' ) ) 45 && id == 'walkerEndMark' ) 46 this.stop(); 47 } ); 48 assert.isTrue( CKEDITOR.tools.arrayCompare( resultSteps, steps ), 49 'Walking steps forward doesn\'t match.' ); 50 }, 51 52 test_reverse : function() 53 { 54 var steps = [], resultSteps = tranverseSequence.concat().reverse(); 55 56 var walker = new CKEDITOR.dom.domWalker( CKEDITOR.document 57 .getById( 'walkerEndMark' ) ); 58 walker.on( 'step', function( evt ) 59 { 60 var node = evt.data.node; 61 steps.push( node.getName() ); 62 } ); 63 walker.reverse( function( evt ) 64 { 65 var to = evt.data.to; 66 var id; 67 if ( ( to.type == CKEDITOR.NODE_ELEMENT ) 68 && ( id = to.getAttribute( 'id' ) ) 69 && id == 'walkerStartMark1' ) 70 this.stop(); 71 } ); 72 assert.isTrue( CKEDITOR.tools.arrayCompare( resultSteps, steps ), 73 'Walking steps reversely doesn\'t match.' ); 74 }, 75 76 test_stopBlockBoundary1 : function() 77 { 78 var walker = new CKEDITOR.dom.domWalker( CKEDITOR.document 79 .getById( 'walkerStartMark2' ) ); 80 var endNode = walker.forward( CKEDITOR.dom.domWalker 81 .blockBoundary() ).node, resultNode = CKEDITOR.document 82 .getById( 'walkerEndMark2' ); 83 assert.isTrue( resultNode.equals( endNode ), 84 'Walking foward doesn\'t stop at block boundaries.' ); 85 86 walker = new CKEDITOR.dom.domWalker( CKEDITOR.document 87 .getById( 'walkerStartMark3' ) ); 88 var startNode = walker.reverse( CKEDITOR.dom.domWalker 89 .blockBoundary() ).node; 90 resultNode = CKEDITOR.document.getById( 'walkerEndMark3' ); 91 assert.isTrue( resultNode.equals( startNode ), 92 'Walking reversely doesn\'t stop at block boundaries.' ); 93 }, 94 95 test_stopBlockBoundary2 : function() 96 { 97 var walker = new CKEDITOR.dom.domWalker( CKEDITOR.document 98 .getById( 'walkerStartMark6' ) ); 99 var endNode = walker.forward( CKEDITOR.dom.domWalker 100 .blockBoundary() ).node, resultNode = CKEDITOR.document 101 .getById( 'walkerEndMark6' ); 102 assert.isTrue( resultNode.equals( endNode ), 103 'Walking forward doesn\'t stop at block boundaries.' ); 104 }, 105 106 test_stopListItemBoundary : function() 107 { 108 var walker = new CKEDITOR.dom.domWalker( CKEDITOR.document 109 .getById( 'walkerStartMark4' ) ); 110 var endNode = walker.forward( CKEDITOR.dom.domWalker 111 .listItemBoundary() ).node, resultNode = CKEDITOR.document 112 .getById( 'walkerEndMark4' ); 113 assert.isTrue( resultNode.equals( endNode ), 114 'Walking forward doesn\'t stop at list items boundaries.' ); 115 116 walker = new CKEDITOR.dom.domWalker( CKEDITOR.document 117 .getById( 'walkerStartMark5' ) ); 118 var startNode = walker.reverse( CKEDITOR.dom.domWalker 119 .blockBoundary() ).node; 120 resultNode = CKEDITOR.document.getById( 'walkerEndMark5' ); 121 assert.isTrue( resultNode.equals( startNode ), 122 'Walking reversely doesn\'t stop at list items boundaries.' ); 123 }, 124 125 name :document.title 126 }; 127 } )() ); 128 //]]> 129 </script> 130 </head> 131 <body> 132 <span id="walkerStartMark1"></span><div><h1><a>text</a></h1><ul><li>text</li><li>text</li></ul><br/><table><tbody><tr><td>text</td></tr></tbody></table><span><form><fieldset><legend>text</legend><label>text</label><input type="text"/></fieldset></form></span></div><span id="walkerEndMark"></span> 133 134 <span id="walkerStartMark2"></span><span><b>text</b>text<input id="walkerEndMark2" type="hidden" /><p>text</p></span> 135 <span><p>text</p><input id="walkerEndMark3" type="hidden" /><b>text</b><span id="walkerStartMark3"></span></span> 136 137 <span id="walkerStartMark4"></span><span><b>text</b>text<input id="walkerEndMark4" type="hidden" /><br/></span> 138 <ul><li><input id="walkerEndMark5" type="hidden" /><b>text</b><span id="walkerStartMark5"></span></li></ul> 139 140 <table><tr><td><span id="walkerStartMark6"><span>text</span><input id="walkerEndMark6" type="hidden" /></td><td></td></tr></table> 141 </body> 142 </html> 143 No newline at end of file -
_source/tests/core/dom/document.html
89 89 assert.areSame( document.body, doc.getBody().$, '1st call failed' ); 90 90 assert.areSame( document.body, doc.getBody().$, '2nd call failed' ); 91 91 }, 92 test_createText : function() 93 { 94 var doc = new CKEDITOR.dom.document( document ), contentText = 'text content'; 95 var textNode = doc.createText( contentText ); 96 assert.areSame( contentText, textNode.getText(), 97 'Create text node content doesn\'t match.' ); 92 98 99 }, 100 101 test_getByAddress1 : function() 102 { 103 var doc = new CKEDITOR.dom.document( document ); 104 var node = doc.getByAddress( [ 1, 3, 0, 1, 0, 0 ] ); 105 assert.areSame( 'target', node.getText(), 106 'Addressing target doesn\'t match.' ); 107 }, 108 /** 109 * Test get address of normalized text nodes. 110 */ 111 test_getByAddress2 : function() 112 { 113 var doc = new CKEDITOR.dom.document( document ); 114 var target = doc.getById( 'addressTarget2' ); 115 target.insertBeforeMe( new CKEDITOR.dom.text( 'text' ) ); 116 target.insertBeforeMe( new CKEDITOR.dom.text( 'text' ) ); 117 var node = doc.getByAddress( [ 1, 5, 1, 0 ], true ); 118 assert.areSame( 'target', node.getText(), 119 'Addressing normalized target doesn\'t match.' ); 120 }, 93 121 name : document.title 94 122 }; 95 123 })() ); … … 99 127 </head> 100 128 <body> 101 129 <div id="test1"></div> 130 <div><p>text<span><b id="addressTarget1">target</b>text</span>text</p></div> 131 <span ><b id="addressTarget2">target</b></span> 102 132 </body> 103 133 </html> -
_source/tests/core/tools.html
46 46 assert.areSame( 'Good' , target.prop6, 'prop6 doesn\'t match' ); 47 47 assert.areSame( fakeArray , target.prop7, 'prop7 doesn\'t match' ); 48 48 }, 49 49 /** 50 * Test arguments and context object correctness. 51 */ 52 test_bind : function() 53 { 54 var context = {}, 55 args = ['string',1,true, /^/]; 56 var unbind = function(){ 57 assert.areSame( context, this, 'function context object doesn\'t match'); 58 var i, l = arguments.length; 59 for (i = 0; i < l; i++) { 60 assert.areSame( arguments[i], args[i], 'argument '+i+' doesn\t match'); 61 } 62 }; 63 64 CKEDITOR.tools.bind( unbind, context )(args[0], 65 args[1], args[2], args[3]); 66 }, 67 68 /** 69 * Test strict comparison of array element 70 */ 71 test_indexOf : function() 72 { 73 var array = [ 1 ]; 74 75 assert.areSame( -1, CKEDITOR.tools.indexOf(array, '1'), 'Doesn\'t distinguish array element type'); 76 }, 77 50 78 test_isArray1 : function() 51 79 { 52 80 assert.isTrue( CKEDITOR.tools.isArray( [] ) ); … … 66 94 { 67 95 assert.isFalse( CKEDITOR.tools.isArray( window.x ) ); 68 96 }, 69 97 test_isArray5 : function() 98 { 99 var iframe = document.createElement('iframe'); 100 document.body.appendChild(iframe); 101 xArray = window.frames[window.frames.length-1].Array; 102 var array = new xArray(1,2,3); // [1,2,3] 103 assert.isTrue ( CKEDITOR.tools.isArray(array) ); 104 }, 70 105 test_htmlEncode1 : function() 71 106 { 72 107 assert.areSame( '<b>Test</b>', CKEDITOR.tools.htmlEncode( '<b>Test</b>' ) );