@@ -85,7 +85,12 @@ var getOpacity = (hasOpacity ? function(element){
85
85
86
86
var floatName = ( html . style . cssFloat == null ) ? 'styleFloat' : 'cssFloat' ,
87
87
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
+ }
89
94
90
95
//<ltIE9>
91
96
var removeStyle = function ( style , property ) {
@@ -100,7 +105,7 @@ var removeStyle = function(style, property){
100
105
Element . implement ( {
101
106
102
107
getComputedStyle : function ( property ) {
103
- if ( ! hasGetComputedStyle && this . currentStyle ) return this . currentStyle [ property . camelCase ( ) ] ;
108
+ if ( ! hasGetComputedStyle && this . currentStyle ) return this . currentStyle [ camelCase ( property ) ] ;
104
109
var defaultView = Element . getDocument ( this ) . defaultView ,
105
110
computed = defaultView ? defaultView . getComputedStyle ( this , null ) : null ;
106
111
return ( computed ) ? computed . getPropertyValue ( ( property == floatName ) ? 'float' : property . hyphenate ( ) ) : '' ;
@@ -112,7 +117,7 @@ Element.implement({
112
117
setOpacity ( this , value ) ;
113
118
return this ;
114
119
}
115
- property = ( property == 'float' ? floatName : property ) . camelCase ( ) ;
120
+ property = camelCase ( property == 'float' ? floatName : property ) ;
116
121
if ( typeOf ( value ) != 'string' ) {
117
122
var map = ( Element . Styles [ property ] || '@' ) . split ( ' ' ) ;
118
123
value = Array . from ( value ) . map ( function ( val , i ) {
@@ -133,7 +138,7 @@ Element.implement({
133
138
134
139
getStyle : function ( property ) {
135
140
if ( property == 'opacity' ) return getOpacity ( this ) ;
136
- property = ( property == 'float' ? floatName : property ) . camelCase ( ) ;
141
+ property = camelCase ( property == 'float' ? floatName : property ) ;
137
142
if ( supportBorderRadius && property . indexOf ( 'borderRadius' ) != - 1 ) {
138
143
return [ 'borderTopLeftRadius' , 'borderTopRightRadius' , 'borderBottomRightRadius' , 'borderBottomLeftRadius' ] . map ( function ( corner ) {
139
144
return this . style [ corner ] || '0px' ;
0 commit comments