Index: /CKEditor/tests/tt/6568/1.html
===================================================================
--- /CKEditor/tests/tt/6568/1.html	(revision 6497)
+++ /CKEditor/tests/tt/6568/1.html	(revision 6497)
@@ -0,0 +1,146 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+	"http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+	<title>Ticket: #6568 Insert Row and column before and after splited cell</title>
+	<meta name="tags" content="editor,unit,all">
+	<script type="text/javascript" src="../../cktester/cell.js"></script>
+	<script>
+( function()
+{
+	var ts, tc, assert = CKEDITOR.test.assert, test = CKEDITOR.test, selector = YAHOO.util.Selector;
+
+	YAHOO.tool.TestRunner.add( ts = new CKEDITOR.test.suites.editorTestSuite(
+		{
+				editorName : 'test_editor_1',
+				name :document.title
+		} ) );
+
+	ts.add( tc = new YAHOO.tool.TestCase(
+	{
+		setUp : function ()
+		{
+			// Force result data un-formatted.
+			ts.editor.dataProcessor.writer._.rules = {};
+			ts.editor.focus();
+		},
+
+		test_insert_row_before: function()
+		{
+			var editor = ts.editor,
+				output = '<table border="1" cellpadding="1" cellspacing="1" style="width:500px;"><tbody><tr><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td rowspan="2">&nbsp;</td><td>&nbsp;</td></tr><tr><td>&nbsp;</td></tr></tbody></table><p>&nbsp;</p>',
+				outputGecko = '<table border="1" cellpadding="1" cellspacing="1" style="width: 500px;"><tbody><tr><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td rowspan="2">&nbsp;</td><td>&nbsp;</td></tr><tr><td>&nbsp;</td></tr></tbody></table><p>&nbsp;</p>';
+				
+			contentWithSelection = test.getValueAsHtml( 'input_1' );
+			test.setHtmlWithSelection( editor.document.getBody(), contentWithSelection );
+			
+			editor.execCommand( 'rowInsertBefore' );
+			
+			this.wait( function ()
+			{											
+				assert.areSame( CKEDITOR.env.gecko? outputGecko : 
+								CKEDITOR.env.ie? outputGecko : 
+								output, editor.getData() );
+			}, 1000 );
+		},
+		
+		test_insert_row_after: function()
+		{
+			var editor = ts.editor,
+				output = '<table border="1" cellpadding="1" cellspacing="1" style="width:500px;"><tbody><tr><td rowspan="3">&nbsp;</td><td>&nbsp;</td></tr><tr><td>&nbsp;</td></tr><tr><td>&nbsp;</td></tr></tbody></table><p>&nbsp;</p>',
+				outputGecko = '<table border="1" cellpadding="1" cellspacing="1" style="width: 500px;"><tbody><tr><td rowspan="3">&nbsp;</td><td>&nbsp;</td></tr><tr><td>&nbsp;</td></tr><tr><td>&nbsp;</td></tr></tbody></table><p>&nbsp;</p>';
+				
+			contentWithSelection = test.getValueAsHtml( 'input_1' );
+			test.setHtmlWithSelection( editor.document.getBody(), contentWithSelection );
+			
+			editor.execCommand( 'rowInsertAfter' );
+			
+			this.wait( function ()
+			{											
+				assert.areSame( CKEDITOR.env.gecko? outputGecko : 
+								CKEDITOR.env.ie? outputGecko : 
+								output, editor.getData() );
+			}, 1000 );
+		},
+		
+		test_insert_column_before: function()
+		{
+			var editor = ts.editor,
+				outputGecko = '<table border="1" cellpadding="1" cellspacing="1" style="width: 500px;"><tbody><tr><td rowspan="2">&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr></tbody></table><p>&nbsp;</p>',
+				output = '<table border="1" cellpadding="1" cellspacing="1" style="width:500px;"><tbody><tr><td rowspan="2">&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr></tbody></table><p>&nbsp;</p>';
+				
+			contentWithSelection = test.getValueAsHtml( 'input_2' );
+			test.setHtmlWithSelection( editor.document.getBody(), contentWithSelection );
+			
+			editor.execCommand( 'columnInsertBefore' );
+			
+			this.wait( function ()
+			{											
+				assert.areSame( CKEDITOR.env.gecko? outputGecko : 
+								CKEDITOR.env.ie? outputGecko : 
+								output, editor.getData() );
+			}, 1000 );
+		},
+		
+		test_insert_column_after: function()
+		{
+			var editor = ts.editor,
+				outputGecko = '<table border="1" cellpadding="1" cellspacing="1" style="width: 500px;"><tbody><tr><td rowspan="2">&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr></tbody></table><p>&nbsp;</p>',
+				output = '<table border="1" cellpadding="1" cellspacing="1" style="width:500px;"><tbody><tr><td rowspan="2">&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr></tbody></table><p>&nbsp;</p>';
+				
+			contentWithSelection = test.getValueAsHtml( 'input_2' );
+			test.setHtmlWithSelection( editor.document.getBody(), contentWithSelection );
+			
+			editor.execCommand( 'columnInsertAfter' );
+			
+			this.wait( function ()
+			{											
+				assert.areSame( CKEDITOR.env.gecko? outputGecko : 
+								CKEDITOR.env.ie? outputGecko : 
+								output, editor.getData() );
+			}, 1000 );
+		}
+	} ) );
+} )();
+	</script>
+</head>
+<body>
+<textarea id='input_1'>
+<table border="1" cellpadding="1" cellspacing="1" style="width: 500px">
+	<tbody>
+		<tr>
+			<td rowspan="2">
+			&nbsp;</td>
+			<td>
+			&nbsp;^</td>
+		</tr> <tr>
+			<td>
+			&nbsp;</td>
+		</tr>
+	</tbody>
+</table>
+</textarea>
+<textarea id='input_2'>
+<table border="1" cellpadding="1" cellspacing="1" style="width:500px;">
+	<tbody>
+		<tr>
+			<td rowspan="2">
+				&nbsp;</td>
+			<td>
+				&nbsp;^</td>
+		</tr>
+		<tr>
+			<td>
+				&nbsp;</td>
+		</tr>
+		<tr>
+			<td>
+				&nbsp;</td>
+			<td>
+				&nbsp;</td>
+		</tr>
+	</tbody>
+</table>
+</textarea>
+</body>
+</html>
Index: /CKEditor/tests/tt/6568/2.html
===================================================================
--- /CKEditor/tests/tt/6568/2.html	(revision 6497)
+++ /CKEditor/tests/tt/6568/2.html	(revision 6497)
@@ -0,0 +1,146 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+	"http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+	<title>Ticket: #6568 Insert Row and column before and after merged cell</title>
+	<meta name="tags" content="editor,unit,all">
+	<script type="text/javascript" src="../../cktester/cell.js"></script>
+	<script>
+( function()
+{
+	var ts, tc, assert = CKEDITOR.test.assert, test = CKEDITOR.test, selector = YAHOO.util.Selector;
+
+	YAHOO.tool.TestRunner.add( ts = new CKEDITOR.test.suites.editorTestSuite(
+		{
+				editorName : 'test_editor_1',
+				name :document.title
+		} ) );
+
+	ts.add( tc = new YAHOO.tool.TestCase(
+	{
+		setUp : function ()
+		{
+			// Force result data un-formatted.
+			ts.editor.dataProcessor.writer._.rules = {};
+			ts.editor.focus();
+		},
+
+		test_insert_row_before: function()
+		{
+			var editor = ts.editor,
+				outputGecko = '<table border="1" cellpadding="1" cellspacing="1" style="width: 500px;"><tbody><tr><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td rowspan="2">&nbsp;</td><td>&nbsp;</td></tr><tr><td>&nbsp;</td></tr></tbody></table><p>&nbsp;</p>',
+				output = '<table border="1" cellpadding="1" cellspacing="1" style="width:500px;"><tbody><tr><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td rowspan="2">&nbsp;</td><td>&nbsp;</td></tr><tr><td>&nbsp;</td></tr></tbody></table><p>&nbsp;</p>';
+				
+			contentWithSelection = test.getValueAsHtml( 'input_1' );
+			test.setHtmlWithSelection( editor.document.getBody(), contentWithSelection );
+			
+			editor.execCommand( 'rowInsertBefore' );
+			
+			this.wait( function ()
+			{											
+				assert.areSame( CKEDITOR.env.gecko? outputGecko : 
+								CKEDITOR.env.ie? outputGecko : 
+								output, editor.getData() );
+			}, 1000 );
+		},
+		
+		test_insert_row_after: function()
+		{
+			var editor = ts.editor,
+				outputGecko = '<table border="1" cellpadding="1" cellspacing="1" style="width: 500px;"><tbody><tr><td rowspan="2">&nbsp;</td><td>&nbsp;</td></tr><tr><td>&nbsp;</td></tr><tr><td>&nbsp;</td><td>&nbsp;</td></tr></tbody></table><p>&nbsp;</p>',
+				output = '<table border="1" cellpadding="1" cellspacing="1" style="width:500px;"><tbody><tr><td rowspan="2">&nbsp;</td><td>&nbsp;</td></tr><tr><td>&nbsp;</td></tr><tr><td>&nbsp;</td><td>&nbsp;</td></tr></tbody></table><p>&nbsp;</p>';
+				
+			contentWithSelection = test.getValueAsHtml( 'input_1' );
+			test.setHtmlWithSelection( editor.document.getBody(), contentWithSelection );
+			
+			editor.execCommand( 'rowInsertAfter' );
+			
+			this.wait( function ()
+			{											
+				assert.areSame( CKEDITOR.env.gecko? outputGecko : 
+								CKEDITOR.env.ie? outputGecko : 
+								output, editor.getData() );
+			}, 1000 );
+		},
+		
+		test_insert_column_before: function()
+		{
+			var editor = ts.editor,
+				outputGecko = '<table border="1" cellpadding="1" cellspacing="1" style="width: 500px;"><tbody><tr><td rowspan="2">&nbsp;</td><td rowspan="2">&nbsp;</td><td>&nbsp;</td></tr><tr><td>&nbsp;</td></tr><tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr></tbody></table><p>&nbsp;</p>',
+				output = '<table border="1" cellpadding="1" cellspacing="1" style="width:500px;"><tbody><tr><td rowspan="2">&nbsp;</td><td rowspan="2">&nbsp;</td><td>&nbsp;</td></tr><tr><td>&nbsp;</td></tr><tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr></tbody></table><p>&nbsp;</p>';
+				
+			contentWithSelection = test.getValueAsHtml( 'input_2' );
+			test.setHtmlWithSelection( editor.document.getBody(), contentWithSelection );
+			
+			editor.execCommand( 'columnInsertBefore' );
+			
+			this.wait( function ()
+			{											
+				assert.areSame( CKEDITOR.env.gecko? outputGecko : 
+								CKEDITOR.env.ie? outputGecko : 
+								output, editor.getData() );
+			}, 1000 );
+		},
+		
+		test_insert_column_after: function()
+		{
+			var editor = ts.editor,
+				outputGecko = '<table border="1" cellpadding="1" cellspacing="1" style="width: 500px;"><tbody><tr><td rowspan="2">&nbsp;</td><td rowspan="2">&nbsp;</td><td>&nbsp;</td></tr><tr><td>&nbsp;</td></tr><tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr></tbody></table><p>&nbsp;</p>',
+				output = '<table border="1" cellpadding="1" cellspacing="1" style="width:500px;"><tbody><tr><td rowspan="2">&nbsp;</td><td rowspan="2">&nbsp;</td><td>&nbsp;</td></tr><tr><td>&nbsp;</td></tr><tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr></tbody></table><p>&nbsp;</p>';
+				
+			contentWithSelection = test.getValueAsHtml( 'input_2' );
+			test.setHtmlWithSelection( editor.document.getBody(), contentWithSelection );
+			
+			editor.execCommand( 'columnInsertAfter' );
+			
+			this.wait( function ()
+			{											
+				assert.areSame( CKEDITOR.env.gecko? outputGecko : 
+								CKEDITOR.env.ie? outputGecko : 
+								output, editor.getData() );
+			}, 1000 );
+		}
+	} ) );
+} )();
+	</script>
+</head>
+<body>
+<textarea id='input_1'>
+<table border="1" cellpadding="1" cellspacing="1" style="width: 500px">
+	<tbody>
+		<tr>
+			<td rowspan="2">
+			&nbsp;^</td>
+			<td>
+			&nbsp;</td>
+		</tr> <tr>
+			<td>
+			&nbsp;</td>
+		</tr>
+	</tbody>
+</table>
+</textarea>
+<textarea id='input_2'>
+<table border="1" cellpadding="1" cellspacing="1" style="width:500px;">
+	<tbody>
+		<tr>
+			<td rowspan="2">
+				&nbsp;^</td>
+			<td>
+				&nbsp;</td>
+		</tr>
+		<tr>
+			<td>
+				&nbsp;</td>
+		</tr>
+		<tr>
+			<td>
+				&nbsp;</td>
+			<td>
+				&nbsp;</td>
+		</tr>
+	</tbody>
+</table>
+</textarea>
+</body>
+</html>
