git.asbjorn.biz
/
jquery.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f569099
)
fix for #3546. css now works with other windows than just the one it was loaded in.
author
Brandon Aaron
<brandon.aaron@gmail.com>
Wed, 22 Apr 2009 04:39:44 +0000
(
04:39
+0000)
committer
Brandon Aaron
<brandon.aaron@gmail.com>
Wed, 22 Apr 2009 04:39:44 +0000
(
04:39
+0000)
src/css.js
patch
|
blob
|
history
diff --git
a/src/css.js
b/src/css.js
index
9551bc9
..
b8a1350
100644
(file)
--- a/
src/css.js
+++ b/
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,
// 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";
// normalize float css property
styleFloat = jQuery.support.cssFloat ? "cssFloat" : "styleFloat";
@@
-140,7
+140,7
@@
jQuery.extend({
if ( !force && style && style[ name ] ) {
ret = style[ name ];
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 ) )
// Only "float" is needed here
if ( /float/i.test( name ) )
@@
-148,7
+148,7
@@
jQuery.extend({
name = name.replace( /([A-Z])/g, "-$1" ).toLowerCase();
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 );
if ( computedStyle )
ret = computedStyle.getPropertyValue( name );