@@ -1226,21 +1226,19 @@ License: MIT License (see homepage)
1226
1226
}
1227
1227
function camelize ( str )
1228
1228
{
1229
- var
1230
- bits = str . split ( HYPHEN ) , len = bits . length , new_str , i = 1 ;
1231
- if ( len == 1 ) { return bits [ 0 ] ; }
1232
- if ( str . charAt ( 0 ) == HYPHEN ) {
1233
- new_str = bits [ 0 ] . charAt ( 0 ) . toUpperCase ( ) + bits [ 0 ] . substring ( 1 ) ;
1234
- } else {
1235
- new_str = bits [ 0 ] ;
1236
- }
1237
- while ( i < len ) {
1238
- new_str += bits [ i ] . charAt ( 0 ) . toUpperCase ( ) + bits [ i ] . substring ( 1 ) ;
1239
- i ++ ;
1240
- }
1241
- return new_str ;
1229
+ var
1230
+ regex = / ( - [ a - z ] ) / g,
1231
+ func = function ( bit ) {
1232
+ return bit . toUpperCase ( ) . replace ( HYPHEN , EMPTY ) ;
1233
+ } ;
1234
+ camelize = function ( str )
1235
+ {
1236
+ return is ( str , STRING ) ? low ( str ) . replace ( regex , func )
1237
+ : str ;
1238
+ } ;
1239
+ return camelize ( str ) ;
1242
1240
}
1243
- function zero_out ( str )
1241
+ function zero_out ( str )
1244
1242
{
1245
1243
if ( is ( str , STRING ) )
1246
1244
{
@@ -2081,8 +2079,7 @@ License: MIT License (see homepage)
2081
2079
html = value ,
2082
2080
el = arg [ 3 ] || NULL ,
2083
2081
// property test vars
2084
- property , settable = TRUE , i ,
2085
- computed = WINDOW . getComputedStyle ,
2082
+ property , val , i ,
2086
2083
VISIBILITY = 'visibility' ,
2087
2084
HIDDEN = 'hidden' ,
2088
2085
// selector test vars
@@ -2106,38 +2103,36 @@ License: MIT License (see homepage)
2106
2103
{
2107
2104
// test element
2108
2105
el = newElement ( DIV ) ;
2109
- // are property and value flowing in separately?
2110
- if ( value )
2111
- {
2112
- property = what ;
2113
- value = arrayify ( value ) ;
2114
- }
2115
- else
2116
- {
2117
- what = what . split ( REGEXP_P_V ) ;
2118
- property = what [ 0 ] ;
2119
- value = [ trim ( what [ 1 ] ) ] ;
2120
- // reset what for the cache
2121
- what = arg [ 1 ] ;
2122
- }
2123
- __body . appendChild ( el ) ;
2124
- toggleExpando ( ) ;
2125
- if ( ! addInlineStyle ( el , property , value [ 0 ] ) )
2126
- {
2127
- settable = FALSE ;
2128
- }
2129
- toggleExpando ( ) ;
2130
- if ( settable )
2131
- {
2132
- i = value . length ;
2133
- while ( i -- &&
2134
- ! result )
2135
- {
2136
- result = ( zero_out ( getCSSValue ( el , property ) ) == value [ i ] ) ;
2137
- }
2138
- }
2139
- // cleanup
2140
- __body . removeChild ( el ) ;
2106
+ // are property and value flowing in separately?
2107
+ if ( value )
2108
+ {
2109
+ property = what ;
2110
+ value = arrayify ( value ) ;
2111
+ }
2112
+ else
2113
+ {
2114
+ what = what . split ( REGEXP_P_V ) ;
2115
+ property = what [ 0 ] ;
2116
+ value = [ trim ( what [ 1 ] ) ] ;
2117
+ // reset what for the cache
2118
+ what = arg [ 1 ] ;
2119
+ }
2120
+ // camel case
2121
+ property = camelize ( property ) ;
2122
+ if ( el . style [ property ] !== UNDEFINED )
2123
+ {
2124
+ // set it
2125
+ el . style [ property ] = value [ 0 ] ;
2126
+ // get it back
2127
+ val = zero_out ( el . style [ property ] ) ;
2128
+ // test
2129
+ i = value . length ;
2130
+ while ( i -- &&
2131
+ ! result )
2132
+ {
2133
+ result = ( val === value [ i ] ) ;
2134
+ }
2135
+ }
2141
2136
}
2142
2137
// selector test
2143
2138
else if ( type == SELECTOR )
0 commit comments