Index: /CKEditor/trunk/_source/plugins/styles/plugin.js
===================================================================
--- /CKEditor/trunk/_source/plugins/styles/plugin.js	(revision 6602)
+++ /CKEditor/trunk/_source/plugins/styles/plugin.js	(revision 6603)
@@ -20,9 +20,9 @@
 
 /**
- * Registers a function to be called whenever a style changes its state in the
+ * Registers a function to be called whenever the selection position changes in the
  * editing area. The current state is passed to the function. The possible
  * states are {@link CKEDITOR.TRISTATE_ON} and {@link CKEDITOR.TRISTATE_OFF}.
  * @param {CKEDITOR.style} style The style to be watched.
- * @param {Function} callback The function to be called when the style state changes.
+ * @param {Function} callback The function to be called.
  * @example
  * // Create a style object for the &lt;b&gt; element.
@@ -80,10 +80,12 @@
 (function()
 {
-	var blockElements	= { address:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,p:1,pre:1 };
-	var objectElements	= { a:1,embed:1,hr:1,img:1,li:1,object:1,ol:1,table:1,td:1,tr:1,th:1,ul:1,dl:1,dt:1,dd:1,form:1};
-
-	var semicolonFixRegex = /\s*(?:;\s*|$)/;
-
-	var notBookmark = CKEDITOR.dom.walker.bookmark( 0, 1 );
+	var blockElements	= { address:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,p:1,pre:1 },
+		objectElements	= { a:1,embed:1,hr:1,img:1,li:1,object:1,ol:1,table:1,td:1,tr:1,th:1,ul:1,dl:1,dt:1,dd:1,form:1};
+
+	var semicolonFixRegex = /\s*(?:;\s*|$)/,
+		varRegex = /#\((.+?)\)/g;
+
+	var notBookmark = CKEDITOR.dom.walker.bookmark( 0, 1 ),
+		nonWhitespaces = CKEDITOR.dom.walker.whitespaces( 1 );
 
 	CKEDITOR.style = function( styleDefinition, variablesValues )
@@ -100,5 +102,5 @@
 
 		this.type =
-			( element == '#' || blockElements[ element ] ) ?
+			blockElements[ element ] ?
 				CKEDITOR.STYLE_BLOCK
 			: objectElements[ element ] ?
@@ -808,10 +810,10 @@
 
 		range.moveToBookmark( bookmark );
-}
+	}
 
 	function applyObjectStyle( range )
 	{
 		var root = range.getCommonAncestor( true, true ),
-				element = root.getAscendant( this.element, true );
+			element = root.getAscendant( this.element, true );
 		element && setupElement( element, this );
 	}
@@ -820,12 +822,12 @@
 	{
 		var root = range.getCommonAncestor( true, true ),
-				element = root.getAscendant( this.element, true );
+			element = root.getAscendant( this.element, true );
 
 		if ( !element )
 			return;
 
-		var style = this;
-		var def = style._.definition;
-		var attributes = def.attributes;
+		var style = this,
+			def = style._.definition,
+			attributes = def.attributes;
 		var styles = CKEDITOR.style.getStyleText( def );
 
@@ -911,7 +913,9 @@
 	}
 
-	// Replace the original block with new one, with special treatment
-	// for <pre> blocks to make sure content format is well preserved, and merging/splitting adjacent
-	// when necessary.(#3188)
+	/**
+	 * Replace the original block with new one, with special treatment
+	 * for <pre> blocks to make sure content format is well preserved, and merging/splitting adjacent
+	 * when necessary.(#3188)
+	 */
 	function replaceBlock( block, newBlock )
 	{
@@ -951,5 +955,4 @@
 	}
 
-	var nonWhitespaces = CKEDITOR.dom.walker.whitespaces( 1 );
 	/**
 	 * Merge a <pre> block with a previous sibling if available.
@@ -1020,4 +1023,5 @@
 		return headBookmark + str.replace( regexp, replacement ) + tailBookmark;
 	}
+
 	/**
 	 * Converting a list of <pre> into blocks with format well preserved.
@@ -1155,7 +1159,6 @@
 			attribs = def.attributes,
 			styles = def.styles,
-			overrides = getOverrides( style );
-
-		var innerElements = element.getElementsByTag( style.element );
+			overrides = getOverrides( style )
+			innerElements = element.getElementsByTag( style.element );
 
 		for ( var i = innerElements.count(); --i >= 0 ; )
@@ -1176,5 +1179,4 @@
 			}
 		}
-
 	}
 
@@ -1260,9 +1262,7 @@
 	function getElement( style, targetDocument, element )
 	{
-		var el;
-
-		var def = style._.definition;
-
-		var elementName = style.element;
+		var el,
+			def = style._.definition,
+			elementName = style.element;
 
 		// The "*" element name will always be a span for this function.
@@ -1290,7 +1290,7 @@
 	function setupElement( el, style )
 	{
-		var def = style._.definition;
-		var attributes = def.attributes;
-		var styles = CKEDITOR.style.getStyleText( def );
+		var def = style._.definition,
+			attributes = def.attributes,
+			styles = CKEDITOR.style.getStyleText( def );
 
 		// Assign all defined attributes.
@@ -1310,5 +1310,4 @@
 	}
 
-	var varRegex = /#\((.+?)\)/g;
 	function replaceVariables( list, variablesValues )
 	{
@@ -1321,5 +1320,4 @@
 		}
 	}
-
 
 	// Returns an object that can be used for style matching comparison.
@@ -1551,9 +1549,9 @@
  * 	{ name : 'Blue Title'		, element : 'h3', styles : { 'color' : 'Blue' } },
  * 	{ name : 'Red Title'		, element : 'h3', styles : { 'color' : 'Red' } },
- * 
+ *
  * 	// Inline Styles
  * 	{ name : 'Marker: Yellow'	, element : 'span', styles : { 'background-color' : 'Yellow' } },
  * 	{ name : 'Marker: Green'	, element : 'span', styles : { 'background-color' : 'Lime' } },
- * 
+ *
  * 	// Object Styles
  * 	{
