Index: /CKEditor/trunk/_source/core/htmlparser/element.js
===================================================================
--- /CKEditor/trunk/_source/core/htmlparser/element.js (revision 7050)
+++ /CKEditor/trunk/_source/core/htmlparser/element.js (revision 7051)
@@ -67,13 +67,16 @@
CKEDITOR.htmlParser.cssStyle = function()
{
- var styleText, arg = arguments[ 0 ],rules = {};
+ var styleText,
+ arg = arguments[ 0 ],
+ rules = {};
+
styleText = arg instanceof CKEDITOR.htmlParser.element ? arg.attributes.style : arg;
- // html-encoded quote might be introduced by 'font-family'
- // from MS-Word which confused the following regexp. e.g.
- //'font-family: "Lucida, Console"'
- ( styleText || '' )
- .replace( /"/g, '"' )
- .replace( /\s*([^ :;]+)\s*:\s*([^;]+)\s*(?=;|$)/g,
+ // html-encoded quote might be introduced by 'font-family'
+ // from MS-Word which confused the following regexp. e.g.
+ //'font-family: "Lucida, Console"'
+ ( styleText || '' )
+ .replace( /"/g, '"' )
+ .replace( /\s*([^ :;]+)\s*:\s*([^;]+)\s*(?=;|$)/g,
function( match, name, value )
{
@@ -83,21 +86,25 @@
return {
+
rules : rules,
+
/**
* Apply the styles onto the specified element or object.
* @param {CKEDITOR.htmlParser.element|CKEDITOR.dom.element|Object} obj
*/
- populate : function( obj ){
+ populate : function( obj )
+ {
var style = this.toString();
- if ( style )
- {
- obj instanceof CKEDITOR.dom.element ?
- obj.setAttribute( 'style', style ) :
- obj instanceof CKEDITOR.htmlParser.element ?
- obj.attributes.style = style :
- obj.style = style;
- }
+ if ( style )
+ {
+ obj instanceof CKEDITOR.dom.element ?
+ obj.setAttribute( 'style', style ) :
+ obj instanceof CKEDITOR.htmlParser.element ?
+ obj.attributes.style = style :
+ obj.style = style;
+ }
},
- toString :function()
+
+ toString : function()
{
var output = [];