Index: /CKEditor/tests/tt/4696/1.html
===================================================================
--- /CKEditor/tests/tt/4696/1.html	(revision 4513)
+++ /CKEditor/tests/tt/4696/1.html	(revision 4513)
@@ -0,0 +1,267 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+	"http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+	<title>Ticket: #4696</title>
+	<meta name="tags" content="editor,unit,all">
+	<script type="text/javascript" src="../../cktester/cell.js"></script>
+	<script>
+( function()
+{
+	var ts, tc,
+			test = CKEDITOR.test,
+			assert = test.assert,
+			doc = CKEDITOR.document;
+
+	YAHOO.tool.TestRunner.add( ts = new CKEDITOR.test.suites.editorTestSuite(
+		{
+				editorName : 'editor1',
+				name :document.title
+		} ) );
+
+	ts.add( tc = new YAHOO.tool.TestCase(
+		{
+//			shouldIgnoreAllBut : [ 'test_insert_pagebreak' ],
+			
+			setUp : function ()
+			{
+				var editor = ts.editor;
+				editor.focus();
+			},
+
+			// First we introducing several tests for the enhanced CKEDITOR.dom.range::splitBlock method,
+			// the expected result is it could now splitting up blocks as well as blockLimits.
+			
+			// Test we could split up a whole table. 
+			test_split_table : function ()
+			{
+				var editor = ts.editor,
+					contentWithSelection = test.getValueAsHtml( 'split_table_input' );
+
+				test.setHtmlWithSelection( editor.document.getBody(), contentWithSelection );
+				var range = editor.getSelection().getRanges()[ 0 ],
+					current,
+					dtd;
+				while ( ( current = range.getCommonAncestor( false, true ) ) && !current.is( 'body' ) )
+					range.splitBlock();
+				assert.areEqual( test.getValueAsHtml( 'split_table_output' ),
+								 editor.getData(), 'editor output data doesn\'t match.' );
+			},
+
+			// Test we could split up a whole list. 
+			test_split_list : function ()
+			{
+				var editor = ts.editor,
+					contentWithSelection = test.getValueAsHtml( 'split_list_input' );
+
+				test.setHtmlWithSelection( editor.document.getBody(), contentWithSelection );
+				var range = editor.getSelection().getRanges()[ 0 ],
+					current,
+					dtd;
+				while ( ( current = range.getCommonAncestor( false, true ) ) && !current.is( 'body' ) )
+						range.splitBlock();
+				assert.areEqual( test.getValueAsHtml( 'split_list_output' ),
+								 editor.getData(), 'editor output data doesn\'t match.' );
+			},
+
+			// Test we could split up a list inside a table. 
+			test_split_list_in_table : function ()
+			{
+				var editor = ts.editor,
+					contentWithSelection = test.getValueAsHtml( 'split_list_in_table_input' );
+
+				test.setHtmlWithSelection( editor.document.getBody(), contentWithSelection );
+				var range = editor.getSelection().getRanges()[ 0 ],
+					current,
+					dtd;
+				while ( ( current = range.getCommonAncestor( false, true ) ) && !current.is( 'body' ) )
+						range.splitBlock();
+				assert.areEqual( test.getValueAsHtml( 'split_list_in_table_output' ),
+								 editor.getData(), 'editor output data doesn\'t match.' );
+			},
+
+
+			
+			// Test page break will always be inserted under body.
+			test_insert_pagebreak : function ()
+			{
+				var editor = ts.editor,
+						contentWithSelection = test.getValueAsHtml( 'insert_pagebreak_input' );
+				test.setHtmlWithSelection( editor.document.getBody(), contentWithSelection );
+				editor.execCommand( 'pagebreak' );
+				var snapshot = editor.document.getBody().getHtml();
+				assert.areEqual( test.getValueAsHtml( 'insert_pagebreak_output' ),
+								 test.fixHtml( editor.getData(), false, true ) , 'editor output data doesn\'t match.' );
+			}
+		} ) );
+} )();
+	</script>
+</head>
+<body>
+<textarea id="split_table_input">
+	<table>
+		<tr>
+			<th>head1</th>
+			<th>head2</th>
+		</tr>
+		<tr>
+			<td>^cell1</td>
+			<td>cell2</td>
+		</tr>
+	</table>
+</textarea>
+<textarea id="split_table_output">
+<table>
+	<tbody>
+		<tr>
+			<th>
+				head1</th>
+			<th>
+				head2</th>
+		</tr>
+	</tbody>
+</table>
+<table>
+	<tbody>
+		<tr>
+			<td>
+				cell1</td>
+			<td>
+				cell2</td>
+		</tr>
+	</tbody>
+</table>
+</textarea>
+
+<textarea id="split_list_input">
+<ol>
+	<li>
+		item1<ul>
+			<li>^item2</li>
+		</ul></li>
+</ol>
+</textarea>
+<textarea id="split_list_output">
+<ol>
+	<li>
+		item1</li>
+</ol>
+<ol>
+	<li>
+		<ul>
+			<li>
+				item2</li>
+		</ul>
+	</li>
+</ol>
+</textarea>
+
+<textarea id="split_list_in_table_input">
+<table>
+	<tbody>
+		<tr>
+			<td>
+				cell1
+				<ol>
+					<li>
+						item1<ul>
+							<li>^item2</li>
+						</ul>
+					</li>
+				</ol>
+			</td>
+			<td>cell2</td>
+		</tr>
+	</tbody>
+</table>
+</textarea>
+<textarea id="split_list_in_table_output">
+<table>
+	<tbody>
+		<tr>
+			<td>
+				cell1
+				<ol>
+					<li>
+						item1</li>
+				</ol>
+			</td>
+		</tr>
+	</tbody>
+</table>
+<table>
+	<tbody>
+		<tr>
+			<td>
+				<ol>
+					<li>
+						<ul>
+							<li>
+								item2</li>
+						</ul>
+					</li>
+				</ol>
+			</td>
+			<td>
+				cell2</td>
+		</tr>
+	</tbody>
+</table>
+</textarea>
+
+<textarea id="insert_pagebreak_input">
+<table>
+	<tbody>
+		<tr>
+			<td>
+				cell1
+				<ol>
+					<li>
+						item1<ul>
+							<li>^item2</li>
+						</ul>
+					</li>
+				</ol>
+			</td>
+			<td>cell2</td>
+		</tr>
+	</tbody>
+</table>
+</textarea>
+<textarea id="insert_pagebreak_output"><table>
+	<tbody>
+		<tr>
+			<td>
+				cell1
+				<ol>
+					<li>
+						item1</li>
+				</ol>
+			</td>
+		</tr>
+	</tbody>
+</table>
+<div style="page-break-after: always;">
+	<span style="display: none;">&amp;nbsp;</span></div>
+<table>
+	<tbody>
+		<tr>
+			<td>
+				<ol>
+					<li>
+						<ul>
+							<li>
+								item2</li>
+						</ul>
+					</li>
+				</ol>
+			</td>
+			<td>
+				cell2</td>
+		</tr>
+	</tbody>
+</table>
+</textarea>
+
+</body>
+</html>
