]> source.dussan.org Git - jquery.git/commitdiff
Use window.getComputedStyle to prevent breaking jsdom/node.js . Fixes #12235
authorRick Waldron <waldron.rick@gmail.com>
Fri, 10 Aug 2012 23:34:01 +0000 (19:34 -0400)
committerRick Waldron <waldron.rick@gmail.com>
Fri, 10 Aug 2012 23:34:01 +0000 (19:34 -0400)
src/css.js

index 19dbb049a2a6df9f061771ef028bdc53f0732a0b..518513a2b38d6523d059d72a5e8338563d079784 100644 (file)
@@ -279,11 +279,11 @@ jQuery.extend({
 });
 
 // NOTE: To any future maintainer, we've used both window.getComputedStyle
-// and getComputedStyle here to produce a better gzip size
+// because jsdom on node.js will break without it.
 if ( window.getComputedStyle ) {
        curCSS = function( elem, name ) {
                var ret, width, minWidth, maxWidth,
-                       computed = getComputedStyle( elem, null ),
+                       computed = window.getComputedStyle( elem, null ),
                        style = elem.style;
 
                if ( computed ) {