]> source.dussan.org Git - jquery.git/commitdiff
Make sure that the defaultView exists before attempting to get at the computedStyle...
authorJohn Resig <jeresig@gmail.com>
Thu, 10 Dec 2009 04:58:49 +0000 (20:58 -0800)
committerJohn Resig <jeresig@gmail.com>
Thu, 10 Dec 2009 04:58:49 +0000 (20:58 -0800)
src/css.js

index 7215fe620506884607f852a32c56b8d429f04ceb..5b6b7b9b6bf8cf07936ac1668060083f7035a984 100644 (file)
@@ -141,7 +141,13 @@ jQuery.extend({
 
                        name = name.replace( rupper, "-$1" ).toLowerCase();
 
-                       var computedStyle = elem.ownerDocument.defaultView.getComputedStyle( elem, null );
+                       var defaultView = elem.ownerDocument.defaultView;
+
+                       if ( !defaultView ) {
+                               return null;
+                       }
+
+                       var computedStyle = defaultView.getComputedStyle( elem, null );
 
                        if ( computedStyle ) {
                                ret = computedStyle.getPropertyValue( name );