Ticket #4136: 4136.patch
File 4136.patch, 3.5 KB (added by , 16 years ago) |
---|
-
_source/tests/plugins/htmldataprocessor/htmldataprocessor.html
265 265 dataProcessor.writer = new CKEDITOR.htmlParser.basicWriter(); 266 266 var html = getTextAreaValue( '_TEXTAREA_3591_2' ); 267 267 var protectedHtml = dataProcessor.toHtml( html ); 268 var dataHtml = dataProcessor.toDataFormat( protectedHtml ); 268 269 269 assert.areSame( getTextAreaValue( '_TEXTAREA_3591_2' ), 270 dataProcessor.toDataFormat( protectedHtml ) ); 270 var regexes = [ 271 /<object[^>]+classid\s*=\s*['"]clsid['"]/, 272 /<object[^>]+><param[^>]+name\s*=\s*['"]movie['"]/, 273 /<object[^>]+><param[^>]+value\s*=\s*['"]movie.swf['"]/, 274 /<object[^>]+><param[^>]+><embed[^>]+src\s*=\s*['"]movie.swf['"]/, 275 /<object[^>]+><param[^>]+><embed[^>]+type\s*=\s*['"]application\/x-shockwave-flash['"]/ 276 ]; 277 278 for ( var i in regexes ) 279 { 280 assert.isTrue( regexes[ i ].test( dataHtml ), regexes[ i ].toString() ); 281 } 271 282 }, 272 283 273 284 test_ticket_3869_1 : function() … … 308 319 var editor = CKEDITOR.instances.editor1, 309 320 dataProcessor = editor.dataProcessor; 310 321 dataProcessor.writer = new CKEDITOR.htmlParser.basicWriter(); 322 var html = dataProcessor.toHtml( '<p><a href="" name="">emptylink</a></p>' ); 323 var dataHtml = dataProcessor.toDataFormat( html ); 311 324 312 assert.areSame( '<p><a href="" name="">emptylink</a></p>', 313 dataProcessor.toDataFormat( dataProcessor.toHtml( '<p><a href="" name="">emptylink</a></p>' ) ) ); 325 var regexes = [ 326 /<p><a[^>]+href\s*=\s*['"]['"]/, 327 /<p><a[^>]+name\s*=\s*['"]['"]/, 328 /<p><a[^>]+name\s*=\s*['"]['"]/, 329 /<p><a[^>]+>emptylink<\/a><\/p>/, 330 ]; 331 332 for ( var i in regexes ) 333 assert.isTrue( regexes[ i ].test( dataHtml ), regexes[ i ].toString() ); 314 334 }, 315 335 316 336 test_innerHtmlComments_ticket_3801 : function() -
_source/tests/plugins/styles/styles.html
323 323 324 324 var style = new CKEDITOR.style( { element : 'b', styles : { color : 'red', 'font-weight' : '700' } } ); 325 325 style.applyToRange( range ); 326 var html = getInnerHtml( '_P1' ); 326 327 327 assert.areSame( '<b lang="pt" style="font-size:11pt;color:red;">this<b style="font-weight:700;"> is some sample text</b></b>', getInnerHtml( '_P1' ), 'First range' ); 328 var regexes = [ 329 /<b[^>]+lang\s*=\s*['"]pt['"]/, 330 /<b[^>]+lang\s*=\s*['"]pt['"]/, 331 /<b[^>]+>[^<]+<b[^>]+> is some sample text<\/b><\/b>/, 332 ]; 333 var regexesMatch = [ 334 [ /<b[^>]+style\s*=\s*['"](.*?)['"]/, "color:red;font-size:11pt;" ], 335 [ /<b[^>]+>this<b[^>]+style\s*=\s*['"](.*?)['"]/, "font-weight:700;" ] 336 ]; 337 338 var i; 339 for ( i in regexes ) 340 assert.isTrue( regexes[ i ].test( html ), regexes[ i ].toString() ); 341 342 for ( i in regexesMatch ) 343 { 344 var match = regexesMatch[ i ]; 345 var result = html.match( match[ 0 ] ); 346 var matched = result[ 1 ].toLowerCase().replace( ' ', '' ).replace( /;$/, '' ).split( ';' ).sort().join( ';' ) + ';'; 347 assert.areSame( match[ 1 ], matched ); 348 } 328 349 }, 329 350 330 351 test_inline_nobreak1 : function()