Skip to content

Commit 3722aef

Browse files
committed
Use window.getComputedStyle to prevent breaking jsdom/node.js . Fixes #12235
1 parent 77412e0 commit 3722aef

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/css.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,11 +279,11 @@ jQuery.extend({
279279
});
280280

281281
// NOTE: To any future maintainer, we've used both window.getComputedStyle
282-
// and getComputedStyle here to produce a better gzip size
282+
// because jsdom on node.js will break without it.
283283
if ( window.getComputedStyle ) {
284284
curCSS = function( elem, name ) {
285285
var ret, width, minWidth, maxWidth,
286-
computed = getComputedStyle( elem, null ),
286+
computed = window.getComputedStyle( elem, null ),
287287
style = elem.style;
288288

289289
if ( computed ) {

0 commit comments

Comments
 (0)