Skip to content
Permalink
Browse files

fix for #3546. css now works with other windows than just the one it …

…was loaded in.
  • Loading branch information
brandonaaron committed Apr 22, 2009
1 parent f569099 commit 8be57929750eac38b0eb331cd99def3d88302cc1
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/css.js
@@ -1,7 +1,7 @@
// exclude the following css properties to add px
var exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i,
// cache defaultView
defaultView = document.defaultView || {},
// cache check for defaultView.getComputedStyle
getComputedStyle = document.defaultView && document.defaultView.getComputedStyle,
// normalize float css property
styleFloat = jQuery.support.cssFloat ? "cssFloat" : "styleFloat";

@@ -140,15 +140,15 @@ jQuery.extend({
if ( !force && style && style[ name ] ) {
ret = style[ name ];

} else if ( defaultView.getComputedStyle ) {
} else if ( getComputedStyle ) {

// Only "float" is needed here
if ( /float/i.test( name ) )
name = "float";

name = name.replace( /([A-Z])/g, "-$1" ).toLowerCase();

var computedStyle = defaultView.getComputedStyle( elem, null );
var computedStyle = elem.ownerDocument.defaultView.getComputedStyle( elem, null );

if ( computedStyle )
ret = computedStyle.getPropertyValue( name );

0 comments on commit 8be5792

Please sign in to comment.
You can’t perform that action at this time.