Index: /CKEditor/tests/tt/4772/1.html
===================================================================
--- /CKEditor/tests/tt/4772/1.html	(revision 4989)
+++ /CKEditor/tests/tt/4772/1.html	(revision 4989)
@@ -0,0 +1,57 @@
+<!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: #4772</title>
+	<meta name="tags" content="editor,unit,stable">
+	<script type="text/javascript" src="../../cktester/cell.js"></script>
+	<script type="text/javascript">
+//<![CDATA[
+
+	// Load the required plugins and launch the runner.
+	CKEDITOR.test.runner.defer = true;
+	CKEDITOR.plugins.load( [ 'styles', 'domiterator', 'htmldataprocessor' ] , function()
+	{
+	 	CKEDITOR.test.runner.run();
+	} );
+
+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 <xxx style="color:xxx"> should be replaced
+		// inside link instead of wrapping it.
+		test_applyInlineStyle_fontColor_link: function()
+		{
+			var range = new CKEDITOR.dom.range( doc );
+			range.selectNodeContents( doc.getById( '_P1') );
+			// <p id="_P1">[some text and <a href="#">a link</a>]</p>
+
+			var style = new CKEDITOR.style( {
+				element : 'span', 
+				styles : { 'color' : 'red' },
+				childRule : function( element ) {
+					return element.getName( ) != 'a';
+				} } );
+
+			style.applyToRange( range );
+			assert.areSame( '<span style="color:red;">some text and </span><a href="#"></a><span style="color:red;"><a href="#">a link</a></span>', getInnerHtml( '_P1' ) );
+		},
+
+		name : document.title
+	};
+})() );
+	//]]>
+	</script>
+</head>
+<body>
+	<p id="_P1">some text and <a href="#">a link</a></p>
+</body>
+</html>
