@@ -7,6 +7,7 @@ define( [
77 "./var/rcssNum" ,
88 "./css/var/rnumnonpx" ,
99 "./css/var/cssExpand" ,
10+ "./css/var/isAutoPx" ,
1011 "./css/var/getStyles" ,
1112 "./css/var/swap" ,
1213 "./css/curCSS" ,
@@ -19,7 +20,7 @@ define( [
1920 "./core/ready" ,
2021 "./selector" // contains
2122] , function ( jQuery , pnum , access , camelCase , document , rcssNum , rnumnonpx , cssExpand ,
22- getStyles , swap , curCSS , adjustCSS , addGetHookIf , support , finalPropName ) {
23+ isAutoPx , getStyles , swap , curCSS , adjustCSS , addGetHookIf , support , finalPropName ) {
2324
2425"use strict" ;
2526
@@ -183,23 +184,6 @@ jQuery.extend( {
183184 }
184185 } ,
185186
186- // Don't automatically add "px" to these possibly-unitless properties
187- cssNumber : {
188- "animationIterationCount" : true ,
189- "columnCount" : true ,
190- "fillOpacity" : true ,
191- "flexGrow" : true ,
192- "flexShrink" : true ,
193- "fontWeight" : true ,
194- "lineHeight" : true ,
195- "opacity" : true ,
196- "order" : true ,
197- "orphans" : true ,
198- "widows" : true ,
199- "zIndex" : true ,
200- "zoom" : true
201- } ,
202-
203187 // Add in properties whose names you wish to fix before
204188 // setting or getting the value
205189 cssProps : { } ,
@@ -245,9 +229,9 @@ jQuery.extend( {
245229 return ;
246230 }
247231
248- // If a number was passed in , add the unit (except for certain CSS properties)
232+ // If the value is a number , add `px` for certain CSS properties
249233 if ( type === "number" ) {
250- value += ret && ret [ 3 ] || ( jQuery . cssNumber [ origName ] ? "" : "px " ) ;
234+ value += ret && ret [ 3 ] || ( isAutoPx ( origName ) ? "px " : "" ) ;
251235 }
252236
253237 // background-* props affect original clone's values
0 commit comments