Index: /CKEditor/tests/tt/4651/1.html
===================================================================
--- /CKEditor/tests/tt/4651/1.html	(revision 4472)
+++ /CKEditor/tests/tt/4651/1.html	(revision 4472)
@@ -0,0 +1,71 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>Ticket #4651</title>
+	<meta name="tags" content="editor,unit,all">
+	<script type="text/javascript" src="../../cktester/cell.js"></script>
+	<script type="text/javascript">
+
+// Load the required plugins and launch the runner.
+CKEDITOR.test.runner.defer = true;
+CKEDITOR.plugins.load( [ 'styles', 'domiterator', 'htmldataprocessor' ] , function()
+{
+ CKEDITOR.test.runner.run();
+} );
+
+	</script>
+	<script type="text/javascript">
+	//<![CDATA[
+
+var testCase;
+
+CKEDITOR.test.addTestCase( testCase = (function()
+{
+	// Local references.
+	var assert			= CKEDITOR.test.assert;
+	var getInnerHtml	= CKEDITOR.test.getInnerHtml;
+
+	var doc = new CKEDITOR.dom.document( document );
+
+	return {
+
+		// Test <ins> has been applied inside paragraph instead of wrapping it.
+		test_applyInlineStyle_ins : function()
+		{
+			doc.getById( '_P1' ).setHtml( '<p>inserted text</p>' );
+
+			var range = new CKEDITOR.dom.range( doc );
+			// [<p>inserted text</p>]
+			range.setStart( doc.getById( '_P1' ), 0 );
+			range.setEnd( doc.getById( '_P1' ), 1 );
+
+			var style = new CKEDITOR.style( { element : 'ins' } );
+			style.applyToRange( range );
+			assert.areSame( '<p><ins>inserted text</ins></p>', getInnerHtml( '_P1' ) );
+		},
+
+		// Test <del> has been applied inside paragraph and wrapping <ins>.
+		test_applyInlineStyle_del : function()
+		{
+			doc.getById( '_P1' ).setHtml( '<p><ins>deleted text</ins></p>' );
+
+			var range = new CKEDITOR.dom.range( doc );
+			// [<p>inserted text</p>]
+			range.setStart( doc.getById( '_P1' ), 0 );
+			range.setEnd( doc.getById( '_P1' ), 1 );
+
+			var style = new CKEDITOR.style( { element : 'del' } );
+			style.applyToRange( range );
+			assert.areSame( '<p><del><ins>deleted text</ins></del></p>', getInnerHtml( '_P1' ) );
+		},
+
+		name : document.title
+	};
+})() );
+	//]]>
+	</script>
+</head>
+<body>
+	<div id="_P1"></div>
+</body>
+</html>
