@@ -5,6 +5,7 @@ define( [
55 "./var/rcssNum" ,
66 "./css/var/rnumnonpx" ,
77 "./css/var/cssExpand" ,
8+ "./css/isAutoPx" ,
89 "./css/var/getStyles" ,
910 "./css/var/swap" ,
1011 "./css/curCSS" ,
@@ -16,7 +17,7 @@ define( [
1617 "./core/init" ,
1718 "./core/ready" ,
1819 "./selector" // contains
19- ] , function ( jQuery , access , camelCase , rcssNum , rnumnonpx , cssExpand ,
20+ ] , function ( jQuery , access , camelCase , rcssNum , rnumnonpx , cssExpand , isAutoPx ,
2021 getStyles , swap , curCSS , adjustCSS , addGetHookIf , support , finalPropName ) {
2122
2223"use strict" ;
@@ -198,30 +199,6 @@ jQuery.extend( {
198199 }
199200 } ,
200201
201- // Don't automatically add "px" to these possibly-unitless properties
202- cssNumber : {
203- "animationIterationCount" : true ,
204- "columnCount" : true ,
205- "fillOpacity" : true ,
206- "flexGrow" : true ,
207- "flexShrink" : true ,
208- "fontWeight" : true ,
209- "gridArea" : true ,
210- "gridColumn" : true ,
211- "gridColumnEnd" : true ,
212- "gridColumnStart" : true ,
213- "gridRow" : true ,
214- "gridRowEnd" : true ,
215- "gridRowStart" : true ,
216- "lineHeight" : true ,
217- "opacity" : true ,
218- "order" : true ,
219- "orphans" : true ,
220- "widows" : true ,
221- "zIndex" : true ,
222- "zoom" : true
223- } ,
224-
225202 // Add in properties whose names you wish to fix before
226203 // setting or getting the value
227204 cssProps : { } ,
@@ -267,11 +244,9 @@ jQuery.extend( {
267244 return ;
268245 }
269246
270- // If a number was passed in, add the unit (except for certain CSS properties)
271- // The isCustomProp check can be removed in jQuery 4.0 when we only auto-append
272- // "px" to a few hardcoded values.
273- if ( type === "number" && ! isCustomProp ) {
274- value += ret && ret [ 3 ] || ( jQuery . cssNumber [ origName ] ? "" : "px" ) ;
247+ // If the value is a number, add `px` for certain CSS properties
248+ if ( type === "number" ) {
249+ value += ret && ret [ 3 ] || ( isAutoPx ( origName ) ? "px" : "" ) ;
275250 }
276251
277252 // background-* props affect original clone's values