}\r
};\r
\r
+( function()\r
+{\r
+\r
CKEDITOR.tools.extend( CKEDITOR.dom.element.prototype,\r
/** @lends CKEDITOR.dom.element.prototype */\r
{\r
:\r
function( propertyName )\r
{\r
- return this.getWindow().$.getComputedStyle( this.$, '' ).getPropertyValue( propertyName );\r
+ var style = this.getWindow().$.getComputedStyle( this.$, null );\r
+\r
+ // Firefox may return null if we call the above on a hidden iframe. (#9117)\r
+ return style ? style.getPropertyValue( propertyName ) : '';\r
},\r
\r
/**\r
{\r
// Removes the specified property from the current style object.\r
var $ = this.$.style;\r
+\r
+ // "removeProperty" need to be specific on the following styles.\r
+ if ( !$.removeProperty && ( name == 'border' || name == 'margin' || name == 'padding' ) )\r
+ {\r
+ var names = expandedRules( name );\r
+ for ( var i = 0 ; i < names.length ; i++ )\r
+ this.removeStyle( names[ i ] );\r
+ return;\r
+ }\r
+\r
$.removeProperty ? $.removeProperty( name ) : $.removeAttribute( CKEDITOR.tools.cssStyleToDomStyle( name ) );\r
\r
if ( !this.$.style.cssText )\r
}\r
});\r
\r
-( function()\r
-{\r
var sides = {\r
width : [ "border-left-width", "border-right-width","padding-left", "padding-right" ],\r
height : [ "border-top-width", "border-bottom-width", "padding-top", "padding-bottom" ]\r
};\r
\r
+ // Generate list of specific style rules, applicable to margin/padding/border.\r
+ function expandedRules( style )\r
+ {\r
+ var sides = [ 'top', 'left', 'right', 'bottom' ], components;\r
+\r
+ if ( style == 'border' )\r
+ components = [ 'color', 'style', 'width' ];\r
+\r
+ var styles = [];\r
+ for ( var i = 0 ; i < sides.length ; i++ )\r
+ {\r
+\r
+ if ( components )\r
+ {\r
+ for ( var j = 0 ; j < components.length ; j++ )\r
+ styles.push( [ style, sides[ i ], components[j] ].join( '-' ) );\r
+ }\r
+ else\r
+ styles.push( [ style, sides[ i ] ].join( '-' ) );\r
+ }\r
+\r
+ return styles;\r
+ }\r
+\r
function marginAndPaddingSize( type )\r
{\r
var adjustment = 0;\r