Skip to content

Commit 5592177

Browse files
committed
CSS: Update the jQuery.cssNumber implementation for jQuery 4.x
Update the `jQuery.cssNumber` shim to use the `3.7.0` implementation.
1 parent 9fd7770 commit 5592177

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

src/jquery/css.js

+12-3
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ if ( jQueryVersionSince( "3.4.0" ) && typeof Proxy !== "undefined" ) {
8181
}
8282

8383
// In jQuery >=4 where jQuery.cssNumber is missing fill it with the latest 3.x version:
84-
// https://github.com/jquery/jquery/blob/3.6.0/src/css.js#L212-L233
84+
// https://github.com/jquery/jquery/blob/3.7.0/src/css.js#L216-L246
8585
// This way, number values for the CSS properties below won't start triggering
8686
// Migrate warnings when jQuery gets updated to >=4.0.0 (gh-438).
8787
if ( jQueryVersionSince( "4.0.0" ) ) {
@@ -90,8 +90,9 @@ if ( jQueryVersionSince( "4.0.0" ) ) {
9090
// in a `jQuery.fn.css` patch and this usage shouldn't warn.
9191
internalCssNumber = {
9292
animationIterationCount: true,
93+
aspectRatio: true,
94+
borderImageSlice: true,
9395
columnCount: true,
94-
fillOpacity: true,
9596
flexGrow: true,
9697
flexShrink: true,
9798
fontWeight: true,
@@ -106,9 +107,17 @@ if ( jQueryVersionSince( "4.0.0" ) ) {
106107
opacity: true,
107108
order: true,
108109
orphans: true,
110+
scale: true,
109111
widows: true,
110112
zIndex: true,
111-
zoom: true
113+
zoom: true,
114+
115+
// SVG-related
116+
fillOpacity: true,
117+
floodOpacity: true,
118+
stopOpacity: true,
119+
strokeMiterlimit: true,
120+
strokeOpacity: true
112121
};
113122

114123
if ( typeof Proxy !== "undefined" ) {

0 commit comments

Comments
 (0)