Index: /CKEditor/trunk/CHANGES.html
===================================================================
--- /CKEditor/trunk/CHANGES.html	(revision 7621)
+++ /CKEditor/trunk/CHANGES.html	(revision 7622)
@@ -60,4 +60,5 @@
 		<li><a href="http://dev.ckeditor.com/ticket/1961">#1961</a> : The "id" attribute will be appended to anchors alongside with the "name" attribute.</li>
 		<li><a href="http://dev.ckeditor.com/ticket/9219">#9219</a> : Protect the &lt;source&gt; element while parsing the contents.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/9281">#9281</a> : [Safari] Fixed inline style breaks dialog advanced tab.</li>
 	</ul>
 	<h3>
Index: /CKEditor/trunk/_source/core/tools.js
===================================================================
--- /CKEditor/trunk/_source/core/tools.js	(revision 7621)
+++ /CKEditor/trunk/_source/core/tools.js	(revision 7622)
@@ -757,5 +757,80 @@
 		{
 			return Array.prototype.slice.call( arguments ).join( '-' );
+		},
+
+		/**
+		 * Try to avoid differences in the style attribute.
+		 *
+		 * @param {String} styleText The style data to be normalized.
+		 * @param {Boolean} [nativeNormalize=false] Parse the data using the browser.
+		 * @returns {String} The normalized value.
+		 */
+		normalizeCssText: function( styleText, nativeNormalize ) {
+			var props = [],
+				name,
+				parsedProps = CKEDITOR.tools.parseCssText( styleText, true, nativeNormalize );
+
+			for ( name in parsedProps )
+				props.push( name + ':' + parsedProps[ name ] );
+
+			props.sort();
+
+			return props.length ? ( props.join( ';' ) + ';' ) : '';
+		},
+
+		/**
+		 * Find and convert <code>rgb(x,x,x)</code> colors definition to hexadecimal notation.
+		 * @param {String} styleText The style data (or just a string containing rgb colors) to be converted.
+		 * @returns {String} The style data with rgb colors converted to hexadecimal equivalents.
+		 */
+		convertRgbToHex: function( styleText ) {
+			return styleText.replace( /(?:rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\))/gi, function( match, red, green, blue ) {
+				var color = [ red, green, blue ];
+				// Add padding zeros if the hex value is less than 0x10.
+				for ( var i = 0; i < 3; i++ )
+					color[ i ] = ( '0' + parseInt( color[ i ], 10 ).toString( 16 ) ).slice( -2 );
+				return '#' + color.join( '' );
+			});
+		},
+
+		/**
+		 * Turn inline style text properties into one hash.
+		 *
+		 * @param {String} styleText The style data to be parsed.
+		 * @param {Boolean} [normalize=false] Normalize properties and values
+		 * (e.g. trim spaces, convert to lower case).
+		 * @param {Boolean} [nativeNormalize=false] Parse the data using the browser.
+		 * @returns {String} The object containing parsed properties.
+		 */
+		parseCssText: function( styleText, normalize, nativeNormalize ) {
+			var retval = {};
+
+			if ( nativeNormalize ) {
+				// Injects the style in a temporary span object, so the browser parses it,
+				// retrieving its final format.
+				var temp = new CKEDITOR.dom.element( 'span' );
+				temp.setAttribute( 'style', styleText );
+				styleText = CKEDITOR.tools.convertRgbToHex( temp.getAttribute( 'style' ) || '' );
+			}
+
+			// IE will leave a single semicolon when failed to parse the style text. (#3891)
+			if ( !styleText || styleText == ';' )
+				return retval;
+
+			styleText.replace( /&quot;/g, '"' ).replace( /\s*([^:;\s]+)\s*:\s*([^;]+)\s*(?=;|$)/g, function( match, name, value ) {
+				if ( normalize ) {
+					name = name.toLowerCase();
+					// Normalize font-family property, ignore quotes and being case insensitive. (#7322)
+					// http://www.w3.org/TR/css3-fonts/#font-family-the-font-family-property
+					if ( name == 'font-family' )
+						value = value.toLowerCase().replace( /["']/g, '' ).replace( /\s*,\s*/g, ',' );
+					value = CKEDITOR.tools.trim( value );
+				}
+
+				retval[ name ] = value;
+			});
+			return retval;
 		}
+
 	};
 })();
Index: /CKEditor/trunk/_source/plugins/dialogadvtab/plugin.js
===================================================================
--- /CKEditor/trunk/_source/plugins/dialogadvtab/plugin.js	(revision 7621)
+++ /CKEditor/trunk/_source/plugins/dialogadvtab/plugin.js	(revision 7622)
@@ -146,21 +146,10 @@
 							var styles = this.getValue();
 
-							// Remove the current value.
-							if ( styles )
-							{
-								styles = styles
-									.replace( new RegExp( '\\s*' + name + '\s*:[^;]*(?:$|;\s*)', 'i' ), '' )
-									.replace( /^[;\s]+/, '' )
-									.replace( /\s+$/, '' );
-							}
-
-							if ( value )
-							{
-								styles && !(/;\s*$/).test( styles ) && ( styles += '; ' );
-								styles += name + ': ' + value;
-							}
+							var tmp = editor.document.createElement( 'span' );
+							tmp.setAttribute( 'style', styles );
+							tmp.setStyle( name, value );
+							styles = CKEDITOR.tools.normalizeCssText( tmp.getAttribute( 'style' ) );
 
 							this.setValue( styles, 1 );
-
 						},
 
