@@ -85,7 +85,12 @@ var getOpacity = (hasOpacity ? function(element){
8585
8686var floatName = ( html . style . cssFloat == null ) ? 'styleFloat' : 'cssFloat' ,
8787 namedPositions = { left : '0%' , top : '0%' , center : '50%' , right : '100%' , bottom : '100%' } ,
88- hasBackgroundPositionXY = ( html . style . backgroundPositionX != null ) ;
88+ hasBackgroundPositionXY = ( html . style . backgroundPositionX != null ) ,
89+ prefixPattern = / ^ - ( m s ) - / ;
90+
91+ var camelCase = function ( property ) {
92+ return property . replace ( prefixPattern , '$1-' ) . camelCase ( ) ;
93+ }
8994
9095//<ltIE9>
9196var removeStyle = function ( style , property ) {
@@ -100,7 +105,7 @@ var removeStyle = function(style, property){
100105Element . implement ( {
101106
102107 getComputedStyle : function ( property ) {
103- if ( ! hasGetComputedStyle && this . currentStyle ) return this . currentStyle [ property . camelCase ( ) ] ;
108+ if ( ! hasGetComputedStyle && this . currentStyle ) return this . currentStyle [ camelCase ( property ) ] ;
104109 var defaultView = Element . getDocument ( this ) . defaultView ,
105110 computed = defaultView ? defaultView . getComputedStyle ( this , null ) : null ;
106111 return ( computed ) ? computed . getPropertyValue ( ( property == floatName ) ? 'float' : property . hyphenate ( ) ) : '' ;
@@ -112,7 +117,7 @@ Element.implement({
112117 setOpacity ( this , value ) ;
113118 return this ;
114119 }
115- property = ( property == 'float' ? floatName : property ) . camelCase ( ) ;
120+ property = camelCase ( property == 'float' ? floatName : property ) ;
116121 if ( typeOf ( value ) != 'string' ) {
117122 var map = ( Element . Styles [ property ] || '@' ) . split ( ' ' ) ;
118123 value = Array . from ( value ) . map ( function ( val , i ) {
@@ -133,7 +138,7 @@ Element.implement({
133138
134139 getStyle : function ( property ) {
135140 if ( property == 'opacity' ) return getOpacity ( this ) ;
136- property = ( property == 'float' ? floatName : property ) . camelCase ( ) ;
141+ property = camelCase ( property == 'float' ? floatName : property ) ;
137142 if ( supportBorderRadius && property . indexOf ( 'borderRadius' ) != - 1 ) {
138143 return [ 'borderTopLeftRadius' , 'borderTopRightRadius' , 'borderBottomRightRadius' , 'borderBottomLeftRadius' ] . map ( function ( corner ) {
139144 return this . style [ corner ] || '0px' ;
0 commit comments