Use window.getComputedStyle to prevent breaking jsdom/node.js . Fixes #12235

This commit is contained in:
Rick Waldron 2012-08-10 19:34:01 -04:00
parent 77412e0305
commit 3722aef8be

View 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 ) {